Mercurial > hg > easyhg
diff filestates.h @ 336:4229b6a8e9c6
Merge
author | Chris Cannam |
---|---|
date | Mon, 14 Mar 2011 10:00:29 +0000 |
parents | 6e1fdda1dff2 |
children | a52970e7a6e0 |
line wrap: on
line diff
--- a/filestates.h Wed Mar 02 15:58:34 2011 +0000 +++ b/filestates.h Mon Mar 14 10:00:29 2011 +0000 @@ -47,10 +47,11 @@ void parseStates(QString text); - void clearBuckets(); + bool isInState(QString file, State s) const; + QStringList filesInState(State s) const; + State stateOf(QString file) const; - QStringList getFilesInState(State) const; - +/*!!! -- to remove: */ QStringList modified() const { return m_modified; } QStringList added() const { return m_added; } QStringList unknown() const { return m_unknown; } @@ -60,7 +61,39 @@ QStringList clean() const { return m_clean; } QStringList ignored() const { return m_ignored; } - State getStateOfFile(QString file) const; + enum Activity { + + // These are in the order in which they want to be listed in + // the context menu + + Diff, + Annotate, + + Commit, + Revert, + + Add, + Remove, + + RedoMerge, + MarkResolved, + + Ignore, + UnIgnore, + + FirstActivity = Diff, + LastActivity = UnIgnore + }; + + typedef QList<Activity> Activities; + + static bool supportsActivity(State s, Activity a); + static Activities activitiesSupportedBy(State s); + static int activityGroup(Activity a); + + bool supportsActivity(QString file, Activity a) const; + QStringList filesSupportingActivity(Activity) const; + Activities activitiesSupportedBy(QString file) const; private: QStringList m_modified; @@ -73,6 +106,8 @@ QStringList m_ignored; QMap<QString, State> m_stateMap; + void clearBuckets(); + State charToState(QChar, bool * = 0); QStringList *stateToBucket(State); };