diff options
author | Joni Poikelin <joni.poikelin@theqtcompany.com> | 2016-03-10 09:19:24 +0200 |
---|---|---|
committer | Joni Poikelin <joni.poikelin@theqtcompany.com> | 2016-03-11 05:48:49 +0000 |
commit | a05f3ee00c903c5fa5965187c72dae04f960e2e4 (patch) | |
tree | 77673b6c272306a1186079587bbf65d1c2a27d99 /src/imports/folderlistmodel | |
parent | 3f47a108bc7862afda1f796ca45096878d88ff4d (diff) |
Prevent worker thread of FolderListModel from starting immediately
Worker thead may have started iterating through filesystem before
component was completely initialized, resulting in unnecessary and
unexpected results.
Task-number: QTBUG-49898
Change-Id: Ibaa2572139b0aed2fdc9bd3bbcdffa58791e38d7
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/imports/folderlistmodel')
-rw-r--r-- | src/imports/folderlistmodel/fileinfothread.cpp | 1 | ||||
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.cpp | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/src/imports/folderlistmodel/fileinfothread.cpp b/src/imports/folderlistmodel/fileinfothread.cpp index ebdfba42a8..b9cc9cac22 100644 --- a/src/imports/folderlistmodel/fileinfothread.cpp +++ b/src/imports/folderlistmodel/fileinfothread.cpp @@ -59,7 +59,6 @@ FileInfoThread::FileInfoThread(QObject *parent) connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(dirChanged(QString))); connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(updateFile(QString))); #endif // !QT_NO_FILESYSTEMWATCHER - start(LowPriority); } FileInfoThread::~FileInfoThread() diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp index 8bfbf09769..d01fc5e74e 100644 --- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp @@ -531,6 +531,7 @@ void QQuickFolderListModel::componentComplete() QString localPath = QQmlFile::urlToLocalFileOrQrc(d->currentDir); if (localPath.isEmpty() || !QDir(localPath).exists()) setFolder(QUrl::fromLocalFile(QDir::currentPath())); + d->fileInfoThread.start(QThread::LowPriority); } /*! |