diff options
Diffstat (limited to 'Swift/QtUI/ChatList/ChatListModel.cpp')
-rw-r--r-- | Swift/QtUI/ChatList/ChatListModel.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Swift/QtUI/ChatList/ChatListModel.cpp b/Swift/QtUI/ChatList/ChatListModel.cpp index b7ce239..2447aa1 100644 --- a/Swift/QtUI/ChatList/ChatListModel.cpp +++ b/Swift/QtUI/ChatList/ChatListModel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -131,6 +131,18 @@ QMimeData* ChatListModel::mimeData(const QModelIndexList& indexes) const { return data; } +const ChatListMUCItem* ChatListModel::getChatListMUCItem(const JID& roomJID) const { + const ChatListMUCItem* mucItem = NULL; + for (int i = 0; i < mucBookmarks_->rowCount(); i++) { + ChatListMUCItem* item = dynamic_cast<ChatListMUCItem*>(mucBookmarks_->item(i)); + if (item->getBookmark().getRoom() == roomJID) { + mucItem = item; + break; + } + } + return mucItem; +} + int ChatListModel::columnCount(const QModelIndex& /*parent*/) const { return 1; } |