gitdiff.h 715 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef GITDIFF_H
  2. #define GITDIFF_H
  3. #include <QObject>
  4. #include <QMap>
  5. #include <QString>
  6. #include <gitbase.h>
  7. struct git_commit;
  8. class GitRepository;
  9. class GitCommit;
  10. class DiffModel;
  11. struct git_diff;
  12. class GitDiff : public GitBase<git_diff>
  13. {
  14. Q_OBJECT
  15. Q_PROPERTY(QStringList files READ files CONSTANT)
  16. public:
  17. static GitDiff* diff(GitCommit* a, GitCommit* b);
  18. static GitDiff* diff(GitCommit* a);
  19. ~GitDiff();
  20. void reset();
  21. Q_INVOKABLE DiffModel* model(const QString& file);
  22. QStringList files();
  23. private:
  24. GitDiff(git_diff* raw, GitRepository* repository);
  25. void readBody(git_diff* diff);
  26. QMap<QString, QPointer<DiffModel> > m_diffList;
  27. };
  28. #endif // GITDIFF_H