summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/ChatList/ChatListRecentItem.cpp')
-rw-r--r--Swift/QtUI/ChatList/ChatListRecentItem.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Swift/QtUI/ChatList/ChatListRecentItem.cpp b/Swift/QtUI/ChatList/ChatListRecentItem.cpp
index 6c9807f..e9ecec8 100644
--- a/Swift/QtUI/ChatList/ChatListRecentItem.cpp
+++ b/Swift/QtUI/ChatList/ChatListRecentItem.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Kevin Smith
+ * Copyright (c) 2011-2013 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
@@ -7,6 +7,7 @@
#include <Swift/QtUI/ChatList/ChatListRecentItem.h>
#include <Swift/QtUI/QtSwiftUtil.h>
+#include <Swiften/Base/Path.h>
namespace Swift {
ChatListRecentItem::ChatListRecentItem(const ChatListWindow::Chat& chat, ChatListGroupItem* parent) : ChatListItem(parent), chat_(chat) {
@@ -19,13 +20,13 @@ const ChatListWindow::Chat& ChatListRecentItem::getChat() const {
QVariant ChatListRecentItem::data(int role) const {
switch (role) {
- case Qt::DisplayRole: return P2QSTRING(chat_.chatName);
+ case Qt::DisplayRole: return chat_.impromptuJIDs.empty() ? P2QSTRING(chat_.chatName) : P2QSTRING(chat_.getImpromptuTitle());
case DetailTextRole: return P2QSTRING(chat_.activity);
/*case Qt::TextColorRole: return textColor_;
case Qt::BackgroundColorRole: return backgroundColor_;
case Qt::ToolTipRole: return isContact() ? toolTipString() : QVariant();
case StatusTextRole: return statusText_;*/
- case AvatarRole: return QVariant(QString(chat_.avatarPath.string().c_str()));
+ case AvatarRole: return QVariant(P2QSTRING(pathToString(chat_.avatarPath)));
case PresenceIconRole: return getPresenceIcon();
default: return QVariant();
}