diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-30 00:05:47 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-30 00:05:47 (GMT) |
commit | 6d72f18c1e2fc5e88841af2d6c8c10bd2576ea58 (patch) | |
tree | 57fe9cddcf3f3c481f7a96c70ae476dfe798d82d /src | |
parent | c4b8a1a818b285ab3b25744fbf35cb1eb43b5dbd (diff) | |
parent | 30ada569454de1ec1d10bf7261d413ddd9b962a5 (diff) | |
download | Qt-6d72f18c1e2fc5e88841af2d6c8c10bd2576ea58.zip Qt-6d72f18c1e2fc5e88841af2d6c8c10bd2576ea58.tar.gz Qt-6d72f18c1e2fc5e88841af2d6c8c10bd2576ea58.tar.bz2 |
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.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index 6fd947c..3757ad7 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; |