comparison src/fswatcher.cpp @ 562:65d77437b5e8

Switch off debug output
author Chris Cannam
date Tue, 28 Feb 2012 14:36:26 +0000
parents 533519ebc0cb
children 0a094020c2d4
comparison
equal deleted inserted replaced
561:1ff2a1bf0a40 562:65d77437b5e8
21 #include <QMutexLocker> 21 #include <QMutexLocker>
22 #include <QDir> 22 #include <QDir>
23 23
24 #include <deque> 24 #include <deque>
25 25
26 #define DEBUG_FSWATCHER 1 26 //#define DEBUG_FSWATCHER 1
27 27
28 /* 28 /*
29 * Watching the filesystem is trickier than it seems at first glance. 29 * Watching the filesystem is trickier than it seems at first glance.
30 * 30 *
31 * We ideally should watch every directory, and every file that is 31 * We ideally should watch every directory, and every file that is
64 void 64 void
65 FsWatcher::setWorkDirPath(QString path) 65 FsWatcher::setWorkDirPath(QString path)
66 { 66 {
67 QMutexLocker locker(&m_mutex); 67 QMutexLocker locker(&m_mutex);
68 if (m_workDirPath == path) return; 68 if (m_workDirPath == path) return;
69 m_watcher.removePaths(m_watcher.directories()); 69 // annoyingly, removePaths prints a warning if given an empty list
70 m_watcher.removePaths(m_watcher.files()); 70 if (!m_watcher.directories().empty()) {
71 m_watcher.removePaths(m_watcher.directories());
72 }
73 if (!m_watcher.files().empty()) {
74 m_watcher.removePaths(m_watcher.files());
75 }
71 m_workDirPath = path; 76 m_workDirPath = path;
72 addWorkDirectory(path); 77 addWorkDirectory(path);
73 debugPrint(); 78 debugPrint();
74 } 79 }
75 80