aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/dialogs
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-08-01 15:39:56 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-01 16:33:26 +0200
commit41d813908a6d178ce15baba32cedef383fa65a51 (patch)
treebe7613591ca4065f3a60c7bc2612a7b83ccdc06e /src/imports/dialogs
parent2e4993fe61a2cbd01549c953701a9ac551c3d992 (diff)
More QUrl/QString conversion in FileDialog implementation
Followup to 6499098a04c7a8a1193413500cd562f781df38bb : because the signals in QPlatformFileDialogHelper emit URLs and QFileDialog does not provide compatible signals, the bridge class QFileDialogHelper must provide slots to convert strings to URLs and emit the signals. Therefore QFileDialogHelper needs the Q_OBJECT macro, and therefore it helps to move its declaration to the private header to avoid confusing moc. Change-Id: I088ff73d107a460af3f8695401276b45a66b5d59 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Diffstat (limited to 'src/imports/dialogs')
-rw-r--r--src/imports/dialogs/qquickabstractfiledialog.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/imports/dialogs/qquickabstractfiledialog.cpp b/src/imports/dialogs/qquickabstractfiledialog.cpp
index e415ebc7e4..3a0d5baa83 100644
--- a/src/imports/dialogs/qquickabstractfiledialog.cpp
+++ b/src/imports/dialogs/qquickabstractfiledialog.cpp
@@ -115,10 +115,9 @@ QUrl QQuickAbstractFileDialog::folder()
void QQuickAbstractFileDialog::setFolder(const QUrl &f)
{
- QString dir = f.path();
if (m_dlgHelper)
- m_dlgHelper->setDirectory(dir);
- m_options->setInitialDirectory(dir);
+ m_dlgHelper->setDirectory(f);
+ m_options->setInitialDirectory(f);
emit folderChanged();
}
@@ -159,7 +158,9 @@ QUrl QQuickAbstractFileDialog::fileUrl()
QList<QUrl> QQuickAbstractFileDialog::fileUrls()
{
- return m_dlgHelper->selectedFiles();
+ if (m_dlgHelper)
+ return m_dlgHelper->selectedFiles();
+ return QList<QUrl>();
}
void QQuickAbstractFileDialog::updateModes()