From e0b9beb63dead017b6849ebcaa91c04a57f955c6 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Mon, 23 Dec 2019 14:41:50 +0100 Subject: 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 --- src/widgets/dialogs/qfileinfogatherer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/dialogs/qfileinfogatherer.cpp') 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); -- cgit v1.2.3