summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2011-02-02 13:40:59 +0200
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2011-02-02 14:04:43 +0200
commit5b89e67619d15e817a81c8f39072a210c7cd5f4c (patch)
treeda0f978a0a4ddef0e2f394d8c4d98cd052e4e8f4 /src/gui
parenta2947892482bc2eee4d29e17f21423be8fc1ded5 (diff)
downloadqt4-tools-5b89e67619d15e817a81c8f39072a210c7cd5f4c.tar.gz
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
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/qfiledialog.cpp2
-rw-r--r--src/gui/dialogs/qfiledialog_symbian.cpp12
2 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index 5ff8d1ee5e..27c58a5460 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 e7197bd33d..b8ea5e57db 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;
}