comparison src/changeset.h @ 510:c623ce6b3104

Refactor: make closed a changeset property (not a changeset item one)
author Chris Cannam
date Tue, 18 Oct 2011 11:30:00 +0100
parents b9c153e00e84
children a17c06f773cd
comparison
equal deleted inserted replaced
509:6f371814509d 510:c623ce6b3104
63 * The children property is not obtained from Hg, but set in 63 * The children property is not obtained from Hg, but set in
64 * Grapher::layout() based on reported parents 64 * Grapher::layout() based on reported parents
65 */ 65 */
66 QStringList children() const { return m_children; } 66 QStringList children() const { return m_children; }
67 67
68 /**
69 * The closed property is not obtained from Hg, but set in
70 * Grapher::layout() based on traversing closed branch graphs
71 */
72 bool closed() const { return m_closed; }
73
68 int number() const { 74 int number() const {
69 return id().split(':')[0].toInt(); 75 return id().split(':')[0].toInt();
70 } 76 }
71 77
72 QString authorName() const { 78 QString authorName() const {
117 void datetimeChanged(QString datetime); 123 void datetimeChanged(QString datetime);
118 void timestampChanged(qulonglong timestamp); 124 void timestampChanged(qulonglong timestamp);
119 void ageChanged(QString age); 125 void ageChanged(QString age);
120 void parentsChanged(QStringList parents); 126 void parentsChanged(QStringList parents);
121 void childrenChanged(QStringList children); 127 void childrenChanged(QStringList children);
128 void closedChanged(bool closed);
122 void commentChanged(QString comment); 129 void commentChanged(QString comment);
123 130
124 public slots: 131 public slots:
125 void setId(QString id) { m_id = id; emit idChanged(id); } 132 void setId(QString id) { m_id = id; emit idChanged(id); }
126 void setAuthor(QString author) { m_author = author; emit authorChanged(author); } 133 void setAuthor(QString author) { m_author = author; emit authorChanged(author); }
131 void setTimestamp(qulonglong timestamp) { m_timestamp = timestamp; emit timestampChanged(timestamp); } 138 void setTimestamp(qulonglong timestamp) { m_timestamp = timestamp; emit timestampChanged(timestamp); }
132 void setAge(QString age) { m_age = age; emit ageChanged(age); } 139 void setAge(QString age) { m_age = age; emit ageChanged(age); }
133 void setParents(QStringList parents) { m_parents = parents; emit parentsChanged(parents); } 140 void setParents(QStringList parents) { m_parents = parents; emit parentsChanged(parents); }
134 void setChildren(QStringList children) { m_children = children; emit childrenChanged(m_children); } 141 void setChildren(QStringList children) { m_children = children; emit childrenChanged(m_children); }
135 void addChild(QString child) { m_children.push_back(child); emit childrenChanged(m_children); } 142 void addChild(QString child) { m_children.push_back(child); emit childrenChanged(m_children); }
143 void setClosed(bool closed) { m_closed = closed; emit closedChanged(closed); }
136 void setComment(QString comment) { m_comment = comment; emit commentChanged(comment); } 144 void setComment(QString comment) { m_comment = comment; emit commentChanged(comment); }
137 145
138 private: 146 private:
139 QString m_id; 147 QString m_id;
140 QString m_author; 148 QString m_author;
143 QString m_datetime; 151 QString m_datetime;
144 qulonglong m_timestamp; 152 qulonglong m_timestamp;
145 QString m_age; 153 QString m_age;
146 QStringList m_parents; 154 QStringList m_parents;
147 QStringList m_children; 155 QStringList m_children;
156 bool m_closed;
148 QString m_comment; 157 QString m_comment;
149 }; 158 };
150 159
151 160
152 #endif // CHANGESET_H 161 #endif // CHANGESET_H