gittag.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef GITTAG_H
  2. #define GITTAG_H
  3. #include <gitbaseoid.h>
  4. class GitTag : public GitBaseOid<git_tag>
  5. {
  6. Q_OBJECT
  7. Q_PROPERTY(QString name READ name NOTIFY tagChanged)
  8. Q_PROPERTY(QString message READ message NOTIFY tagChanged)
  9. Q_PROPERTY(QString owner READ owner NOTIFY tagChanged)
  10. Q_PROPERTY(QString sha1 READ sha1 NOTIFY tagChanged)
  11. Q_PROPERTY(GitOid targetId READ targetId WRITE setTargetId NOTIFY targetIdChanged)
  12. public:
  13. GitTag();
  14. GitTag(git_tag* raw, GitRepository* parent);
  15. QString name() const
  16. {
  17. return m_name;
  18. }
  19. QString message() const
  20. {
  21. return m_message;
  22. }
  23. QString owner() const
  24. {
  25. return m_owner;
  26. }
  27. QString sha1() const
  28. {
  29. return m_oid.toString();
  30. }
  31. GitOid targetId() const;
  32. public slots:
  33. void setTargetId(GitOid targetId)
  34. {
  35. if (m_targetId == targetId)
  36. return;
  37. m_targetId = targetId;
  38. emit targetIdChanged(targetId);
  39. }
  40. signals:
  41. void tagChanged();
  42. void targetIdChanged(GitOid targetId);
  43. private:
  44. QString m_name;
  45. QString m_message;
  46. QString m_owner;
  47. QString m_sha1;
  48. GitOid m_targetId;
  49. };
  50. #endif // GITTAG_H