summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-04-15 21:16:37 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-04-15 21:19:29 (GMT)
commit1cf2023bc496a4abe5a98138401295b45a0b899a (patch)
tree8516e0132e9aaf197635ef9eb515b2e93256614c /Swift/QtUI/ChatList/ChatListModel.cpp
parentbd8af5feb9b61f42c15cab77b19a58dfd93afa06 (diff)
downloadswift-contrib-1cf2023bc496a4abe5a98138401295b45a0b899a.zip
swift-contrib-1cf2023bc496a4abe5a98138401295b45a0b899a.tar.bz2
Normalise muc joining, allow it from bookmark list.
Resolves: #320
Diffstat (limited to 'Swift/QtUI/ChatList/ChatListModel.cpp')
-rw-r--r--Swift/QtUI/ChatList/ChatListModel.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Swift/QtUI/ChatList/ChatListModel.cpp b/Swift/QtUI/ChatList/ChatListModel.cpp
index 1b01c64..40ed1b7 100644
--- a/Swift/QtUI/ChatList/ChatListModel.cpp
+++ b/Swift/QtUI/ChatList/ChatListModel.cpp
@@ -41,8 +41,13 @@ int ChatListModel::columnCount(const QModelIndex& /*parent*/) const {
return 1;
}
+ChatListItem* ChatListModel::getItemForIndex(const QModelIndex& index) const {
+ return index.isValid() ? static_cast<ChatListItem*>(index.internalPointer()) : NULL;
+}
+
QVariant ChatListModel::data(const QModelIndex& index, int role) const {
- return index.isValid() ? static_cast<ChatListItem*>(index.internalPointer())->data(role) : QVariant();
+ ChatListItem* item = getItemForIndex(index);
+ return item ? item->data(role) : QVariant();
}
QModelIndex ChatListModel::index(int row, int column, const QModelIndex & parent) const {