aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/dialogs/qquickfiledialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/dialogs/qquickfiledialog.cpp')
-rw-r--r--src/imports/dialogs/qquickfiledialog.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/imports/dialogs/qquickfiledialog.cpp b/src/imports/dialogs/qquickfiledialog.cpp
index f5d1a06d04..2ee4afc5d2 100644
--- a/src/imports/dialogs/qquickfiledialog.cpp
+++ b/src/imports/dialogs/qquickfiledialog.cpp
@@ -105,10 +105,7 @@ QQuickFileDialog::~QQuickFileDialog()
QList<QUrl> QQuickFileDialog::fileUrls()
{
- QList<QUrl> ret;
- foreach (QString path, m_selections)
- ret << QUrl::fromLocalFile(path);
- return ret;
+ return m_selections;
}
/*!
@@ -134,18 +131,16 @@ void QQuickFileDialog::clearSelection()
/*!
\brief Adds one file to \l fileUrls
- \l path should be given as an absolute file system path. If it is given as a
- file:// URL, it will be converted to a path. Returns true on success,
- false if the given path is not valid given the current setting properties.
+ \l path should be given as an absolute file:// path URL.
+ Returns true on success, false if the given path is
+ not valid given the current property settings.
*/
-bool QQuickFileDialog::addSelection(QString path)
+bool QQuickFileDialog::addSelection(const QUrl &path)
{
- if (path.startsWith("file:"))
- path = QUrl(path).toLocalFile();
- QFileInfo info(path);
+ QFileInfo info(path.toLocalFile());
if (info.exists() && ((info.isDir() && m_selectFolder) || !info.isDir())) {
if (m_selectFolder)
- m_selections.append(pathFolder(path).toLocalFile());
+ m_selections.append(pathFolder(path.toLocalFile()));
else
m_selections.append(path);
return true;