summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-07-04 18:23:10 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-07-04 18:23:10 (GMT)
commite2fd68762f2bca98e415da2a287c523042ed36a8 (patch)
treead7b999a0f08dca631c07ee1cfe89b2cce90f151 /Swift/QtUI/ChatList
parentc78424678261c59bcbf924b53e1ebe12b6cc1201 (diff)
downloadswift-e2fd68762f2bca98e415da2a287c523042ed36a8.zip
swift-e2fd68762f2bca98e415da2a287c523042ed36a8.tar.bz2
Moving some ChatList logic to Controllers.
Diffstat (limited to 'Swift/QtUI/ChatList')
-rw-r--r--Swift/QtUI/ChatList/QtChatListWindow.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/Swift/QtUI/ChatList/QtChatListWindow.cpp b/Swift/QtUI/ChatList/QtChatListWindow.cpp
index d71563d..7ef6ae5 100644
--- a/Swift/QtUI/ChatList/QtChatListWindow.cpp
+++ b/Swift/QtUI/ChatList/QtChatListWindow.cpp
@@ -71,24 +71,15 @@ void QtChatListWindow::setupContextMenus() {
void QtChatListWindow::handleItemActivated(const QModelIndex& index) {
ChatListItem* item = model_->getItemForIndex(index);
- ChatListMUCItem* mucItem = dynamic_cast<ChatListMUCItem*>(item);
- if (bookmarksEnabled_ && mucItem) {
- boost::shared_ptr<UIEvent> event(new JoinMUCUIEvent(mucItem->getBookmark().getRoom(), mucItem->getBookmark().getNick()));
- eventStream_->send(event);
- }
- ChatListRecentItem* recentItem = dynamic_cast<ChatListRecentItem*>(item);
- if (recentItem) {
- boost::shared_ptr<UIEvent> event;
- if (recentItem->getChat().isMUC) {
- if (!bookmarksEnabled_) {
- return;
- }
- return;
+ if (ChatListMUCItem* mucItem = dynamic_cast<ChatListMUCItem*>(item)) {
+ if (bookmarksEnabled_) {
+ onMUCBookmarkActivated(mucItem->getBookmark());
}
- else {
- event = boost::shared_ptr<UIEvent>(new RequestChatUIEvent(recentItem->getChat().jid));
+ }
+ else if (ChatListRecentItem* recentItem = dynamic_cast<ChatListRecentItem*>(item)) {
+ if (!recentItem->getChat().isMUC || bookmarksEnabled_) {
+ onRecentActivated(recentItem->getChat());
}
- eventStream_->send(event);
}
}