summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-12-23 14:41:50 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-12-23 16:05:39 +0100
commite0b9beb63dead017b6849ebcaa91c04a57f955c6 (patch)
treef544b7eec2f173feba8fcd60c8a9f0828ff1957c /src
parent7ac4e55cb979dff890f1575e771e5f2def9e3131 (diff)
QFileInfoGatherer: don't pass empty list to QFileSystemWatcher
When an empty list is passed to QFileSystemWatcher::unwatchPaths() a warning is printed out. To avoid this, check if the container is not empty before calling unwatchPaths() Fixes: QTBUG-80965 Change-Id: I23a7946e1e16a8d899abf6cce6b75a6f3662ca0f Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp
index 0beca82f28..7342efbd0d 100644
--- a/src/widgets/dialogs/qfileinfogatherer.cpp
+++ b/src/widgets/dialogs/qfileinfogatherer.cpp
@@ -232,7 +232,7 @@ void QFileInfoGatherer::watchPaths(const QStringList &paths)
void QFileInfoGatherer::unwatchPaths(const QStringList &paths)
{
#if QT_CONFIG(filesystemwatcher)
- if (m_watcher)
+ if (m_watcher && !paths.isEmpty())
m_watcher->removePaths(paths);
#else
Q_UNUSED(paths);