comparison changesetitem.cpp @ 74:10eb97683aa9

* Show branch names even for changes with children, if those children are on a different branch * Pick up remote repo path from local repo via hg paths * Some work towards breaking down files into various groups based on status * Add /usr/local/bin to path for hg (temporary hack I hope)
author Chris Cannam
date Fri, 19 Nov 2010 14:54:19 +0000
parents 5616a814c58b
children d5db15bf250c
comparison
equal deleted inserted replaced
73:a773c6e7b301 74:10eb97683aa9
21 #include "colourset.h" 21 #include "colourset.h"
22 22
23 #include <QPainter> 23 #include <QPainter>
24 24
25 ChangesetItem::ChangesetItem(Changeset *cs) : 25 ChangesetItem::ChangesetItem(Changeset *cs) :
26 m_changeset(cs), m_column(0), m_row(0), m_wide(false) 26 m_changeset(cs), m_showBranch(false), m_column(0), m_row(0), m_wide(false)
27 { 27 {
28 m_font = QFont(); 28 m_font = QFont();
29 m_font.setPixelSize(11); 29 m_font.setPixelSize(11);
30 m_font.setBold(false); 30 m_font.setBold(false);
31 m_font.setItalic(false); 31 m_font.setItalic(false);
91 QString person = TextAbbrev::abbreviate(m_changeset->authorName(), fm, wid); 91 QString person = TextAbbrev::abbreviate(m_changeset->authorName(), fm, wid);
92 paint->drawText(x0 + 3, fm.ascent(), person); 92 paint->drawText(x0 + 3, fm.ascent(), person);
93 93
94 paint->setPen(QPen(Qt::black)); 94 paint->setPen(QPen(Qt::black));
95 95
96 if (m_changeset->children().empty()) { 96 if (m_showBranch) {
97 // write branch name 97 // write branch name
98 f.setBold(true); 98 f.setBold(true);
99 paint->setFont(f); 99 paint->setFont(f);
100 QString branch = m_changeset->branch(); 100 QString branch = m_changeset->branch();
101 if (branch == "") branch = "default";
101 int wid = width - 3; 102 int wid = width - 3;
102 branch = TextAbbrev::abbreviate(branch, QFontMetrics(f), wid); 103 branch = TextAbbrev::abbreviate(branch, QFontMetrics(f), wid);
103 paint->drawText(x0, -fh + fm.ascent() - 4, branch); 104 paint->drawText(x0, -fh + fm.ascent() - 4, branch);
104 f.setBold(false); 105 f.setBold(false);
105 } 106 }