diff options
author | Timothy Pearson <[email protected]> | 2011-10-06 13:29:55 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-10-06 13:29:55 -0500 |
commit | d71a83ef0d306b8e23b2be5baa3e347116ba8253 (patch) | |
tree | 7e97f8f0eaf491f1700e537a9c87b03863e2a8fa /src/dialogs/qfiledialog.cpp | |
parent | b1444fa097ab72348e6b86526d2d7d7ab673529e (diff) | |
download | qt3-d71a83ef0d306b8e23b2be5baa3e347116ba8253.tar.gz qt3-d71a83ef0d306b8e23b2be5baa3e347116ba8253.zip |
Apply qtkdeintegration patches to Qt3v3.5.13
This partially resolves Bug #528
Diffstat (limited to 'src/dialogs/qfiledialog.cpp')
-rw-r--r-- | src/dialogs/qfiledialog.cpp | 33 |
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) |