summaryrefslogtreecommitdiffstats
path: root/src/dialogs/qfiledialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialogs/qfiledialog.cpp')
-rw-r--r--src/dialogs/qfiledialog.cpp33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/dialogs/qfiledialog.cpp b/src/dialogs/qfiledialog.cpp
index d696204..7d08986 100644
--- a/src/dialogs/qfiledialog.cpp
+++ b/src/dialogs/qfiledialog.cpp
@@ -95,6 +95,10 @@
#include "qvbox.h"
#include "qwidgetstack.h"
+#ifdef Q_WS_X11
+#include "private/qtkdeintegration_x11_p.h"
+#endif
+
#ifdef Q_WS_WIN
#ifdef QT_THREAD_SUPPORT
# include <private/qmutexpool_p.h>
@@ -3489,7 +3493,11 @@ QString QFileDialog::getOpenFileName( const QString & startWith,
if ( workingDirectory->isNull() )
*workingDirectory = ::toRootIfNotExists( QDir::currentDirPath() );
-#if defined(Q_WS_WIN)
+#if defined(Q_WS_X11)
+ if ( qt_use_native_dialogs && QKDEIntegration::enabled())
+ return QKDEIntegration::getOpenFileNames( filter, workingDirectory, parent, name,
+ caption, selectedFilter, false ).first();
+#elif defined(Q_WS_WIN)
if ( qt_use_native_dialogs && qApp->style().styleHint( QStyle::SH_GUIStyle ) == WindowsStyle )
return winGetOpenFileName( initialSelection, filter, workingDirectory,
parent, name, caption, selectedFilter );
@@ -3610,7 +3618,11 @@ QString QFileDialog::getSaveFileName( const QString & startWith,
if ( workingDirectory->isNull() )
*workingDirectory = ::toRootIfNotExists( QDir::currentDirPath() );
-#if defined(Q_WS_WIN)
+#if defined(Q_WS_X11)
+ if ( qt_use_native_dialogs && QKDEIntegration::enabled())
+ return QKDEIntegration::getSaveFileName( initialSelection, filter, workingDirectory,
+ parent, name, caption, selectedFilter );
+#elif defined(Q_WS_WIN)
if ( qt_use_native_dialogs && qApp->style().styleHint( QStyle::SH_GUIStyle ) == WindowsStyle )
return winGetSaveFileName( initialSelection, filter, workingDirectory,
parent, name, caption, selectedFilter );
@@ -4500,7 +4512,17 @@ QString QFileDialog::getExistingDirectory( const QString & dir,
if ( workingDirectory )
wd = *workingDirectory;
-#if defined(Q_WS_WIN)
+#if defined(Q_WS_X11)
+ QString initialDir;
+ if ( !dir.isEmpty() ) {
+ QUrlOperator u( dir );
+ if ( QFileInfo( u.path() ).isDir() )
+ initialDir = dir;
+ } else
+ initialDir = QString::null;
+ if ( qt_use_native_dialogs && QKDEIntegration::enabled())
+ return QKDEIntegration::getExistingDirectory( initialDir, parent, name, caption );
+#elif defined(Q_WS_WIN)
QString initialDir;
if ( !dir.isEmpty() ) {
QUrlOperator u( dir );
@@ -5664,7 +5686,10 @@ QStringList QFileDialog::getOpenFileNames( const QString & filter,
}
}
-#if defined(Q_WS_WIN)
+#if defined(Q_WS_X11)
+ if ( qt_use_native_dialogs && QKDEIntegration::enabled())
+ return QKDEIntegration::getOpenFileNames( filter, workingDirectory, parent, name, caption, selectedFilter, true );
+#elif defined(Q_WS_WIN)
if ( qt_use_native_dialogs && qApp->style().styleHint( QStyle::SH_GUIStyle ) == WindowsStyle )
return winGetOpenFileNames( filter, workingDirectory, parent, name, caption, selectedFilter );
#elif defined(Q_WS_MAC)