comparison src/fswatcher.h @ 584:09b9849b9800 fswatcher

Make a start with explicit FSEvents support on OS/X (see long comment added in this commit). Note that this branch doesn't currently build.
author Chris Cannam
date Mon, 12 Mar 2012 17:25:41 +0000
parents 533519ebc0cb
children fa242885a233
comparison
equal deleted inserted replaced
583:e40e3ebe9f2e 584:09b9849b9800
23 #include <QString> 23 #include <QString>
24 #include <QSet> 24 #include <QSet>
25 #include <QHash> 25 #include <QHash>
26 #include <QMap> 26 #include <QMap>
27 #include <QStringList> 27 #include <QStringList>
28
29 #ifndef Q_OS_MAC
30 // We don't use QFileSystemWatcher on OS/X.
31 // See comments at top of fswatcher.cpp for an explanation.
28 #include <QFileSystemWatcher> 32 #include <QFileSystemWatcher>
33 #endif
29 34
30 class FsWatcher : public QObject 35 class FsWatcher : public QObject
31 { 36 {
32 Q_OBJECT 37 Q_OBJECT
33 38
91 void fsDirectoryChanged(QString); 96 void fsDirectoryChanged(QString);
92 void fsFileChanged(QString); 97 void fsFileChanged(QString);
93 98
94 private: 99 private:
95 // call with lock already held 100 // call with lock already held
101 void clearWatchedPaths();
102
103 // call with lock already held
96 void addWorkDirectory(QString path); 104 void addWorkDirectory(QString path);
97 105
98 // call with lock already held 106 // call with lock already held
99 bool shouldIgnore(QString path); 107 bool shouldIgnore(QString path);
100 108
140 QMutex m_mutex; 148 QMutex m_mutex;
141 149
142 QString m_workDirPath; 150 QString m_workDirPath;
143 int m_lastToken; 151 int m_lastToken;
144 size_t m_lastCounter; 152 size_t m_lastCounter;
153
154 #ifdef Q_OS_MAC
155 void *m_stream;
156 #else
145 QFileSystemWatcher m_watcher; 157 QFileSystemWatcher m_watcher;
158 #endif
146 }; 159 };
147 160
148 #endif 161 #endif