From 0176ffd25d8cb27261d20946f2629c87ecdfc8cc Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 10 Aug 2015 14:57:06 +0200 Subject: [PATCH] FolderWatcher win: Skip unneeded notifications #3353 --- src/gui/folderwatcher_win.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/folderwatcher_win.cpp b/src/gui/folderwatcher_win.cpp index 4137ea0f4b..f815b7c465 100644 --- a/src/gui/folderwatcher_win.cpp +++ b/src/gui/folderwatcher_win.cpp @@ -87,8 +87,17 @@ void WatcherThread::watchChanges(size_t fileNotifyBufferSize, } longfile = QDir::cleanPath(longfile); - qDebug() << Q_FUNC_INFO << "Found change in" << longfile << "action:" << curEntry->Action; - emit changed(longfile); + // Skip modifications of folders: One of these is triggered for changes + // and new files in a folder, probably because of the folder's mtime + // changing. We don't need them. + bool skip = curEntry->Action == FILE_ACTION_MODIFIED + && QFileInfo(longfile).isDir(); + + if (!skip) { + //qDebug() << Q_FUNC_INFO << "Found change in" << longfile + // << "action:" << curEntry->Action; + emit changed(longfile); + } if (curEntry->NextEntryOffset == 0) { break;