comparison mainwindow.h @ 238:e2f2c6e3c01b

* Attempt a different way of handling filesystem updates, that's more forgiving of fs changes caused by hg itself
author Chris Cannam
date Mon, 10 Jan 2011 13:30:19 +0000
parents c9a7e4ec2f78
children 661f5808aa0a
comparison
equal deleted inserted replaced
237:c9a7e4ec2f78 238:e2f2c6e3c01b
29 #include <QFileSystemWatcher> 29 #include <QFileSystemWatcher>
30 30
31 QT_BEGIN_NAMESPACE 31 QT_BEGIN_NAMESPACE
32 class QAction; 32 class QAction;
33 class QMenu; 33 class QMenu;
34 class QTimer;
34 QT_END_NAMESPACE 35 QT_END_NAMESPACE
35 36
36 class MainWindow : public QMainWindow 37 class MainWindow : public QMainWindow
37 { 38 {
38 Q_OBJECT 39 Q_OBJECT
58 void closeEvent(QCloseEvent *event); 59 void closeEvent(QCloseEvent *event);
59 60
60 public slots: 61 public slots:
61 void open(QString local); 62 void open(QString local);
62 void hgRefresh(); 63 void hgRefresh();
64 void commandStarting(HgAction);
63 void commandCompleted(HgAction action, QString stdOut); 65 void commandCompleted(HgAction action, QString stdOut);
64 void commandFailed(HgAction action, QString stdErr); 66 void commandFailed(HgAction action, QString stdErr);
65 void enableDisableActions(); 67 void enableDisableActions();
66 68
67 private slots: 69 private slots:
102 void hgServe(); 104 void hgServe();
103 void hgIgnore(); 105 void hgIgnore();
104 106
105 void fsDirectoryChanged(QString); 107 void fsDirectoryChanged(QString);
106 void fsFileChanged(QString); 108 void fsFileChanged(QString);
109 void checkFilesystem();
110 void actuallyRestoreFileSystemWatcher();
107 111
108 private: 112 private:
109 void hgQueryBranch(); 113 void hgQueryBranch();
110 void hgQueryHeads(); 114 void hgQueryHeads();
111 void hgQueryParents(); 115 void hgQueryParents();
152 QString format3(QString, QString, QString); 156 QString format3(QString, QString, QString);
153 157
154 void clearState(); 158 void clearState();
155 159
156 void updateFileSystemWatcher(); 160 void updateFileSystemWatcher();
161 void suspendFileSystemWatcher();
162 void restoreFileSystemWatcher();
157 163
158 bool firstStart; 164 bool firstStart;
159 165
160 bool showAllFiles; 166 bool showAllFiles;
161 167
208 QString findDiffBinaryName(); 214 QString findDiffBinaryName();
209 QString findMergeBinaryName(); 215 QString findMergeBinaryName();
210 QString findEditorBinaryName(); 216 QString findEditorBinaryName();
211 217
212 QFileSystemWatcher *fsWatcher; 218 QFileSystemWatcher *fsWatcher;
219 QTimer *m_fsWatcherGeneralTimer;
220 QTimer *m_fsWatcherRestoreTimer;
213 221
214 QString lastStatOutput; 222 QString lastStatOutput;
215 QStringList lastRevertedFiles; 223 QStringList lastRevertedFiles;
216 224
217 bool justMerged; 225 bool justMerged;