summaryrefslogtreecommitdiff
path: root/src/plugins/git/commitdata.h
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2012-10-28 21:54:24 +0200
committerOrgad Shaneh <orgads@gmail.com>2012-10-29 14:59:29 +0100
commitab85e7342e7b51a10b6bf5ebc66c1a47c70f3fa6 (patch)
tree924bc36fe00fcc530cd88a50f150afb44291b6d3 /src/plugins/git/commitdata.h
parent0f2f2a59d2eda4f7a2d79957649c2af4a3f6bc46 (diff)
downloadqt-creator-ab85e7342e7b51a10b6bf5ebc66c1a47c70f3fa6.tar.gz
Git: Extract FileState from CommitData
* Add a QFlags type for it and use it * Clean up GitClient::addAndCommit * Rename Updated -> Unmerged Change-Id: Id96f71fb78af923605f5773f65a5625244a49499 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git/commitdata.h')
-rw-r--r--src/plugins/git/commitdata.h45
1 files changed, 20 insertions, 25 deletions
diff --git a/src/plugins/git/commitdata.h b/src/plugins/git/commitdata.h
index 093c7cc138..27293746a1 100644
--- a/src/plugins/git/commitdata.h
+++ b/src/plugins/git/commitdata.h
@@ -64,33 +64,26 @@ struct GitSubmitEditorPanelData
QDebug operator<<(QDebug d, const GitSubmitEditorPanelData &);
+enum FileState {
+ UntrackedFile = 0,
+
+ StagedFile = 0x01,
+ ModifiedFile = 0x02,
+ AddedFile = 0x04,
+ DeletedFile = 0x08,
+ RenamedFile = 0x10,
+ CopiedFile = 0x20,
+ UnmergedFile = 0x40,
+
+ UnknownFileState = 0x800
+};
+Q_DECLARE_FLAGS(FileStates, FileState)
+
class CommitData
{
public:
- enum FileState {
- UntrackedFile = 0,
-
- StagedFile = 0x01,
- ModifiedFile = 0x02,
- AddedFile = 0x04,
- DeletedFile = 0x08,
- RenamedFile = 0x10,
- CopiedFile = 0x20,
- UpdatedFile = 0x40,
-
- ModifiedStagedFile = StagedFile | ModifiedFile,
- AddedStagedFile = StagedFile | AddedFile,
- DeletedStagedFile = StagedFile | DeletedFile,
- RenamedStagedFile = StagedFile | RenamedFile,
- CopiedStagedFile = StagedFile | CopiedFile,
- UpdatedStagedFile = StagedFile | UpdatedFile,
-
- AllStates = UpdatedFile | CopiedFile | RenamedFile | DeletedFile | AddedFile | ModifiedFile | StagedFile,
- UnknownFileState
- };
-
// A pair of state string/file name ('modified', 'file.cpp').
- typedef QPair<FileState, QString> StateFilePair;
+ typedef QPair<FileStates, QString> StateFilePair;
void clear();
// Parse the files and the branch of panelInfo
@@ -99,9 +92,9 @@ public:
// Convenience to retrieve the file names from
// the specification list. Optionally filter for a certain state
- QStringList filterFiles(const FileState &state) const;
+ QStringList filterFiles(const FileStates &state) const;
- static QString stateDisplayName(const FileState &state);
+ static QString stateDisplayName(const FileStates &state);
QString amendSHA1;
QString commitEncoding;
@@ -117,4 +110,6 @@ private:
} // namespace Internal
} // namespace Git
+Q_DECLARE_OPERATORS_FOR_FLAGS(Git::Internal::FileStates)
+
#endif // COMMITDATA_H