From: Charles Yin Date: Tue, 20 Mar 2012 03:49:15 +0000 (+1000) Subject: Fix FolderListModel path issue on Windows X-Git-Tag: submit/tizen/20131211.000705~2293 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11741f9d778ab1f2221b9b568e16920ad8dca393;p=platform%2Fupstream%2Fqtdeclarative.git Fix FolderListModel path issue on Windows Task-number: QTBUG-24777 Change-Id: I819c2e07b23e8740f7570f117dafb2340f7c00e9 Reviewed-by: Martin Jones --- diff --git a/src/imports/folderlistmodel/folderlistmodel.pro b/src/imports/folderlistmodel/folderlistmodel.pro index 592d8375c..f30c2b209 100644 --- a/src/imports/folderlistmodel/folderlistmodel.pro +++ b/src/imports/folderlistmodel/folderlistmodel.pro @@ -2,7 +2,7 @@ TARGET = qmlfolderlistmodelplugin TARGETPATH = Qt/labs/folderlistmodel include(../qimportbase.pri) -QT += qml +QT += core-private qml qml-private v8-private SOURCES += qquickfolderlistmodel.cpp plugin.cpp \ fileinfothread.cpp diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp index 294fe184d..0aabb7ae7 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 #include +#include 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()) diff --git a/tests/auto/qml/qquickfolderlistmodel/qquickfolderlistmodel.pro b/tests/auto/qml/qquickfolderlistmodel/qquickfolderlistmodel.pro index 68c0d79f9..7cda6f1ef 100644 --- a/tests/auto/qml/qquickfolderlistmodel/qquickfolderlistmodel.pro +++ b/tests/auto/qml/qquickfolderlistmodel/qquickfolderlistmodel.pro @@ -9,6 +9,4 @@ include (../../shared/util.pri) TESTDATA = data/* CONFIG += parallel_test -QT += core-private gui-private qml-private testlib - -win32:CONFIG += insignificant_test # QTBUG-24777 +QT += core-private gui-private qml-private testlib \ No newline at end of file