diff src/changesetitem.cpp @ 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 c43880dfdb78
children 306a62fe851e
line wrap: on
line diff
--- a/src/changesetitem.cpp	Tue Oct 18 11:21:20 2011 +0100
+++ b/src/changesetitem.cpp	Tue Oct 18 11:30:00 2011 +0100
@@ -38,7 +38,7 @@
 ChangesetItem::ChangesetItem(Changeset *cs) :
     m_changeset(cs), m_detail(0),
     m_showBranch(false), m_column(0), m_row(0), m_wide(false),
-    m_current(false), m_closed(false), m_closing(false), m_new(false)
+    m_current(false), m_closing(false), m_new(false)
 {
     m_font = QFont();
     m_font.setPixelSize(11);
@@ -257,13 +257,19 @@
     return (m_changeset && m_changeset->parents().size() > 1);
 }
 
+bool
+ChangesetItem::isClosed() const
+{
+    return (m_changeset && m_changeset->closed());
+}
+
 void
 ChangesetItem::paintNormal(QPainter *paint)
 {
     paint->save();
     
     int alpha = 255;
-    if (m_closed) alpha = 90;
+    if (isClosed()) alpha = 90;
 
     ColourSet *colourSet = ColourSet::instance();
     QColor branchColour = colourSet->getColourFor(m_changeset->branch());
@@ -438,7 +444,7 @@
     paint->save();
 
     int alpha = 255;
-    if (m_closed) alpha = 90;
+    if (isClosed()) alpha = 90;
     
     ColourSet *colourSet = ColourSet::instance();
     QColor branchColour = colourSet->getColourFor(m_changeset->branch());