diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2011-02-02 11:40:59 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2011-02-10 09:57:05 (GMT) |
commit | d0b2922bc2f8f40828598aac19617184007c7df5 (patch) | |
tree | a363850acbcdbb0c404c14213795e6ada6435ac2 /src/gui | |
parent | 02500f25cc7ce5c7a9109c6cf433c79001e0594e (diff) | |
download | Qt-d0b2922bc2f8f40828598aac19617184007c7df5.zip Qt-d0b2922bc2f8f40828598aac19617184007c7df5.tar.gz Qt-d0b2922bc2f8f40828598aac19617184007c7df5.tar.bz2 |
Fix few QFileDialog static method issues in Symbian^3
- The selected file path now uses slashes instead of Symbian native
backslashes as directory separator.
- If default file is specified in dir parameter of getSaveFileName in
addition to directory, that will be used as default suggested
filename.
- Clarified documentation a bit.
Task-number: QTBUG-17135
Reviewed-by: Janne Koskinen
(cherry picked from commit 5b89e67619d15e817a81c8f39072a210c7cd5f4c)
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qfiledialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/dialogs/qfiledialog_symbian.cpp | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 5ff8d1e..27c58a5 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -1770,7 +1770,7 @@ QString QFileDialog::getOpenFileName(QWidget *parent, On Symbian^3 the parameter \a selectedFilter has no meaning and the \a options parameter is only used to define if the native file dialog is - used. + used. On Symbian^3, this function can only return a single filename. \warning Do not delete \a parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the diff --git a/src/gui/dialogs/qfiledialog_symbian.cpp b/src/gui/dialogs/qfiledialog_symbian.cpp index e7197bd..b8ea5e5 100644 --- a/src/gui/dialogs/qfiledialog_symbian.cpp +++ b/src/gui/dialogs/qfiledialog_symbian.cpp @@ -140,11 +140,13 @@ static QString launchSymbianDialog(const QString dialogCaption, const QString st CleanupStack::PushL(extensionFilter); extensionFilter->setFilter(filter); select = AknCommonDialogsDynMem::RunSelectDlgLD(types, target, - startFolder, NULL, NULL, titlePtr, extensionFilter); + startFolder, 0, 0, titlePtr, extensionFilter); CleanupStack::Pop(extensionFilter); } else if (dialogMode == DialogSave) { + QString defaultFileName = QFileDialogPrivate::initialSelection(startDirectory); + target = qt_QString2TPtrC(defaultFileName); select = AknCommonDialogsDynMem::RunSaveDlgLD(types, target, - startFolder, NULL, NULL, titlePtr); + startFolder, 0, 0, titlePtr); } else if (dialogMode == DialogFolder) { select = AknCommonDialogsDynMem::RunFolderSelectDlgLD(types, target, startFolder, 0, 0, titlePtr, NULL, NULL); @@ -160,8 +162,10 @@ static QString launchSymbianDialog(const QString dialogCaption, const QString st startFolder = qt_QString2TPtrC(dir); } } - if (select) - selection.append(qt_TDesC2QString(target)); + if (select) { + QFileInfo fi(qt_TDesC2QString(target)); + selection = fi.absoluteFilePath(); + } #endif return selection; } |