summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Weimer <bweimer@blackberry.com>2014-04-10 15:31:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-16 15:21:50 +0200
commit2ba9a2584f90bf2849182143d90c988ddb937c3a (patch)
treeefc0601f447e9fb275c90f0adcd0adac54969ae1
parentd0cf69eaff95e5c15573b5673deda8fd85a61dcd (diff)
Fix polling file system watcher addPaths
Fixes QFileSystemWatcher::addPath() auto test when polling file system watcher is in use: adding the same path twice should fail. Change-Id: I2a0df3ffa587fa90fae744858f4471d667443e6f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
-rw-r--r--src/corelib/io/qfilesystemwatcher_polling.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_polling.cpp b/src/corelib/io/qfilesystemwatcher_polling.cpp
index 689f05bb1b..401f95ae82 100644
--- a/src/corelib/io/qfilesystemwatcher_polling.cpp
+++ b/src/corelib/io/qfilesystemwatcher_polling.cpp
@@ -65,14 +65,16 @@ QStringList QPollingFileSystemWatcherEngine::addPaths(const QStringList &paths,
if (!fi.exists())
continue;
if (fi.isDir()) {
- if (!directories->contains(path))
- directories->append(path);
+ if (directories->contains(path))
+ continue;
+ directories->append(path);
if (!path.endsWith(QLatin1Char('/')))
fi = QFileInfo(path + QLatin1Char('/'));
this->directories.insert(path, fi);
} else {
- if (!files->contains(path))
- files->append(path);
+ if (files->contains(path))
+ continue;
+ files->append(path);
this->files.insert(path, fi);
}
it.remove();