summaryrefslogtreecommitdiff
path: root/src/imports/dialogs/qquickfiledialog.cpp
diff options
context:
space:
mode:
authorRichard Dale <richard.dale@codethink.co.uk>2013-07-04 09:56:26 +0100
committerRichard Dale <richard.dale@codethink.co.uk>2013-07-04 09:56:26 +0100
commit774d0310883a9526210c4530bbb9d0af26d88699 (patch)
treed79e075f964ef213a31ee290c00d9438f3b139dc /src/imports/dialogs/qquickfiledialog.cpp
parent9b3d0a24b65f6a0725951a4df0239ef19a8d3f64 (diff)
parent811337a73c160447e5218ae55e93df99ac3d9edd (diff)
downloadqtdeclarative-baserock/morph.tar.gz
Merge v5.1.0 releasebaserock/morph
Diffstat (limited to 'src/imports/dialogs/qquickfiledialog.cpp')
-rw-r--r--src/imports/dialogs/qquickfiledialog.cpp29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/imports/dialogs/qquickfiledialog.cpp b/src/imports/dialogs/qquickfiledialog.cpp
index f78e8a6f8d..2ee4afc5d2 100644
--- a/src/imports/dialogs/qquickfiledialog.cpp
+++ b/src/imports/dialogs/qquickfiledialog.cpp
@@ -64,13 +64,13 @@ QT_BEGIN_NAMESPACE
/*!
\qmlsignal QtQuick::Dialogs::AbstractFileDialog::accepted
- The \a accepted signal is emitted by \l accept().
+ This signal is emitted by \l accept().
*/
/*!
\qmlsignal QtQuick::Dialogs::AbstractFileDialog::rejected
- The \a accepted signal is emitted by \l reject().
+ This signal is emitted by \l reject().
*/
/*!
@@ -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;
}
/*!
@@ -118,13 +115,13 @@ QList<QUrl> QQuickFileDialog::fileUrls()
*/
/*!
- \qmlproperty bool AbstractFileDialog::filePaths
+ \qmlproperty bool AbstractFileDialog::fileUrls
A list of files to be populated as the user chooses.
*/
/*!
- \brief Clears \l filePaths
+ \brief Clears \l fileUrls
*/
void QQuickFileDialog::clearSelection()
{
@@ -132,20 +129,18 @@ void QQuickFileDialog::clearSelection()
}
/*!
- \brief Adds one file to \l filePaths
+ \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;