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>
This commit is contained in:
Christian Ehrlicher 2019-12-23 14:41:50 +01:00
parent 7ac4e55cb9
commit e0b9beb63d

View File

@ -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);