comparison changesetitem.cpp @ 66:5616a814c58b

* Use more than one line of the commit log, if it fits
author Chris Cannam
date Wed, 17 Nov 2010 20:21:18 +0000
parents f583e44d9d31
children 10eb97683aa9
comparison
equal deleted inserted replaced
65:7b1b333acf93 66:5616a814c58b
108 fm = QFontMetrics(f); 108 fm = QFontMetrics(f);
109 fh = fm.height(); 109 fh = fm.height();
110 paint->setFont(f); 110 paint->setFont(f);
111 111
112 QString comment = m_changeset->comment().trimmed(); 112 QString comment = m_changeset->comment().trimmed();
113 comment = comment.replace("\\n", "\n"); 113 comment = comment.replace("\\n", " ");
114 comment = comment.replace(QRegExp("^\"\\s*\\**\\s*"), ""); 114 comment = comment.replace(QRegExp("^\"\\s*\\**\\s*"), "");
115 comment = comment.replace(QRegExp("\"$"), ""); 115 comment = comment.replace(QRegExp("\"$"), "");
116 comment = comment.replace("\\\"", "\""); 116 comment = comment.replace("\\\"", "\"");
117 comment = comment.split('\n')[0];
118 117
119 wid = width - 5; 118 wid = width - 5;
120 int nlines = (height / fh) - 1; 119 int nlines = (height / fh) - 1;
121 if (nlines < 1) nlines = 1; 120 if (nlines < 1) nlines = 1;
122 comment = TextAbbrev::abbreviate(comment, fm, wid, TextAbbrev::ElideEnd, 121 comment = TextAbbrev::abbreviate(comment, fm, wid, TextAbbrev::ElideEnd,