Mercurial > hg > easyhg
comparison filestates.h @ 94:44ed7766d55a
* Clear selections when Esc pressed; some refactoring
author | Chris Cannam |
---|---|
date | Wed, 24 Nov 2010 14:41:52 +0000 |
parents | 06f4fffd5287 |
children | 087d7cdde662 |
comparison
equal
deleted
inserted
replaced
93:dfb7a274b90f | 94:44ed7766d55a |
---|---|
17 | 17 |
18 #ifndef FILESTATES_H | 18 #ifndef FILESTATES_H |
19 #define FILESTATES_H | 19 #define FILESTATES_H |
20 | 20 |
21 #include <QStringList> | 21 #include <QStringList> |
22 #include <QMap> | |
23 #include <QString> | |
22 | 24 |
23 class FileStates | 25 class FileStates |
24 { | 26 { |
25 public: | 27 public: |
26 FileStates() { } | 28 FileStates(); |
27 FileStates(QString text); | |
28 | 29 |
29 enum State { | 30 enum State { |
30 | 31 |
31 UpToDate, | 32 Clean, |
32 Modified, | 33 Modified, |
33 Added, | 34 Added, |
34 Unknown, | 35 Unknown, |
35 Removed, | 36 Removed, |
36 Missing, | 37 Missing, |
37 | 38 |
38 FirstState = UpToDate, | 39 FirstState = Clean, |
39 LastState = Missing | 40 LastState = Missing |
40 }; | 41 }; |
41 | 42 |
42 QStringList modified; | 43 void parseStates(QString text); |
43 QStringList added; | |
44 QStringList unknown; | |
45 QStringList removed; | |
46 QStringList missing; | |
47 | 44 |
48 QStringList getFilesInState(State); | 45 void clearBuckets(); |
49 State getStateOfFile(QString file); | 46 |
47 QStringList getFilesInState(State) const; | |
48 | |
49 QStringList modified() const { return m_modified; } | |
50 QStringList added() const { return m_added; } | |
51 QStringList unknown() const { return m_unknown; } | |
52 QStringList removed() const { return m_removed; } | |
53 QStringList missing() const { return m_missing; } | |
54 | |
55 State getStateOfFile(QString file) const; | |
56 | |
57 private: | |
58 QStringList m_modified; | |
59 QStringList m_added; | |
60 QStringList m_unknown; | |
61 QStringList m_removed; | |
62 QStringList m_missing; | |
63 QMap<QString, State> m_stateMap; | |
64 | |
65 State charToState(QChar, bool * = 0); | |
66 QStringList *stateToBucket(State); | |
50 }; | 67 }; |
51 | 68 |
52 #endif // FILESTATES_H | 69 #endif // FILESTATES_H |