commitgraph.h 654 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef COMMITGRAPH_H
  2. #define COMMITGRAPH_H
  3. #include <QObject>
  4. #include <gitoid.h>
  5. #include <QString>
  6. #include <QHash>
  7. #include <QObjectList>
  8. class GitCommit;
  9. class GraphPoint;
  10. class CommitGraph : public QObject
  11. {
  12. Q_OBJECT
  13. Q_PROPERTY(QList<QObject*> points READ points CONSTANT)
  14. public:
  15. CommitGraph();
  16. void addHead(const GitOid& oid);
  17. QList<QObject*> points() const {
  18. return m_sortedPoints;
  19. }
  20. private:
  21. void findParents(GitCommit *commit);
  22. void addCommits(QList<GitOid> &reversList);
  23. QString m_color;
  24. QHash<GitOid, GraphPoint*> m_points;
  25. QObjectList m_sortedPoints;
  26. };
  27. #endif // COMMITGRAPH_H