diff options
author | Charles Yin <charles.yin@nokia.com> | 2012-03-20 13:49:15 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-20 05:37:59 +0100 |
commit | 11741f9d778ab1f2221b9b568e16920ad8dca393 (patch) | |
tree | 451d66a25867593f57b4fe59583426710b2bf590 /src/imports/folderlistmodel/qquickfolderlistmodel.cpp | |
parent | 87308c93c8a6359377d5546f0ef87d27737787d8 (diff) |
Fix FolderListModel path issue on Windows
Task-number: QTBUG-24777
Change-Id: I819c2e07b23e8740f7570f117dafb2340f7c00e9
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/imports/folderlistmodel/qquickfolderlistmodel.cpp')
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp index 294fe184d2..0aabb7ae74 100644 --- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp @@ -43,8 +43,8 @@ #include "qquickfolderlistmodel.h" #include "fileinfothread_p.h" #include "fileproperty_p.h" -#include <QDebug> #include <qqmlcontext.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE @@ -365,7 +365,8 @@ void QQuickFolderListModel::setFolder(const QUrl &folder) if (folder == d->currentDir) return; - QString resolvedPath = QDir::cleanPath(folder.path()); + QString localPath = QQmlEnginePrivate::urlToLocalFileOrQrc(folder); + QString resolvedPath = QDir::cleanPath(QUrl(localPath).path()); beginResetModel(); @@ -407,7 +408,8 @@ void QQuickFolderListModel::setRootFolder(const QUrl &path) if (path.isEmpty()) return; - QString resolvedPath = QDir::cleanPath(path.path()); + QString localPath = QQmlEnginePrivate::urlToLocalFileOrQrc(path); + QString resolvedPath = QDir::cleanPath(QUrl(localPath).path()); QFileInfo info(resolvedPath); if (!info.exists() || !info.isDir()) |