summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-01-12 09:11:12 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-01-12 09:11:12 (GMT)
commita23fb5087b321cddd5b2eb97d8381b3ed742a874 (patch)
tree2a695ebb12053808ef9932b631b9b0f34538b212 /Swift/QtUI/Roster/DelegateCommons.cpp
parent0f1163c722a39783b07ca6d4027010cb310e7b36 (diff)
downloadswift-contrib-a23fb5087b321cddd5b2eb97d8381b3ed742a874.zip
swift-contrib-a23fb5087b321cddd5b2eb97d8381b3ed742a874.tar.bz2
Don't crash with multiline status message and Qt-4.8.0
It looks as if 4.8 crashes if you ask it to elide text that has newlines in it. This change changes the rendering to show all lines as one. This slightly changes roster rendering for people with multiline messages. Resolves: #1056
Diffstat (limited to 'Swift/QtUI/Roster/DelegateCommons.cpp')
-rw-r--r--Swift/QtUI/Roster/DelegateCommons.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/QtUI/Roster/DelegateCommons.cpp b/Swift/QtUI/Roster/DelegateCommons.cpp
index 0dc8a52..a575cb0 100644
--- a/Swift/QtUI/Roster/DelegateCommons.cpp
+++ b/Swift/QtUI/Roster/DelegateCommons.cpp
@@ -14,7 +14,7 @@ namespace Swift {
void DelegateCommons::drawElidedText(QPainter* painter, const QRect& region, const QString& text, int flags) {
QString adjustedText(painter->fontMetrics().elidedText(text, Qt::ElideRight, region.width(), Qt::TextShowMnemonic));
- painter->drawText(region, flags, adjustedText);
+ painter->drawText(region, flags, adjustedText.simplified());
}
void DelegateCommons::paintContact(QPainter* painter, const QStyleOptionViewItem& option, const QColor& nameColor, const QString& avatarPath, const QIcon& presenceIcon, const QString& name, const QString& statusText, int unreadCount, bool compact) const {