summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-30 02:05:47 +0200
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-30 02:05:47 +0200
commit6d72f18c1e2fc5e88841af2d6c8c10bd2576ea58 (patch)
tree57fe9cddcf3f3c481f7a96c70ae476dfe798d82d /src
parentc4b8a1a818b285ab3b25744fbf35cb1eb43b5dbd (diff)
parent30ada569454de1ec1d10bf7261d413ddd9b962a5 (diff)
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix QFileSystemModel to not install useless watchers on the filesystem
Diffstat (limited to 'src')
-rw-r--r--src/gui/dialogs/qfilesystemmodel.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp
index 6fd947ce3b..3757ad7295 100644
--- a/src/gui/dialogs/qfilesystemmodel.cpp
+++ b/src/gui/dialogs/qfilesystemmodel.cpp
@@ -1361,6 +1361,16 @@ QModelIndex QFileSystemModel::setRootPath(const QString &newPath)
if (!showDrives && !newPathDir.exists())
return d->index(rootPath());
+ //We remove the watcher on the previous path
+ if (!rootPath().isEmpty()) {
+ //This remove the watcher for the old rootPath
+ d->fileInfoGatherer.removePath(rootPath());
+ //This line "marks" the node as dirty, so the next fetchMore
+ //call on the path will ask the gatherer to install a watcher again
+ //But it doesn't re-fetch everything
+ d->node(rootPath())->populatedChildren = false;
+ }
+
// We have a new valid root path
d->rootDir = newPathDir;
QModelIndex newRootIndex;