Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix FolderListModel path issue on Windows
Task-number: QTBUG-24777
Change-Id: I819c2e07b23e8740f7570f117dafb2340f7c00e9
Reviewed-by: Martin Jones <martin.jones@nokia.com>
  • Loading branch information
yinyunqiao authored and Qt by Nokia committed Mar 20, 2012
1 parent 87308c9 commit 11741f9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/imports/folderlistmodel/folderlistmodel.pro
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions src/imports/folderlistmodel/qquickfolderlistmodel.cpp
Expand Up @@ -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

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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())
Expand Down
Expand Up @@ -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

0 comments on commit 11741f9

Please sign in to comment.