diff options
| author | Kevin Smith <git@kismith.co.uk> | 2011-09-27 08:04:45 (GMT) | 
|---|---|---|
| committer | Kevin Smith <git@kismith.co.uk> | 2011-09-27 08:14:43 (GMT) | 
| commit | 24e53876500f0f5497a84b239d9350676e95751a (patch) | |
| tree | 2d43b81f6b1619e1f51ac0a591c14d7eafdfc396 /Swift/QtUI/ChatList/QtChatListWindow.cpp | |
| parent | 694cc7318b92aed079badb3cc22428ab108591cf (diff) | |
| download | swift-contrib-24e53876500f0f5497a84b239d9350676e95751a.zip swift-contrib-24e53876500f0f5497a84b239d9350676e95751a.tar.bz2  | |
Add support for clearing chat recents.
Resolves: #1001
Diffstat (limited to 'Swift/QtUI/ChatList/QtChatListWindow.cpp')
| -rw-r--r-- | Swift/QtUI/ChatList/QtChatListWindow.cpp | 15 | 
1 files changed, 12 insertions, 3 deletions
diff --git a/Swift/QtUI/ChatList/QtChatListWindow.cpp b/Swift/QtUI/ChatList/QtChatListWindow.cpp index 9beb9dc..e5c63f6 100644 --- a/Swift/QtUI/ChatList/QtChatListWindow.cpp +++ b/Swift/QtUI/ChatList/QtChatListWindow.cpp @@ -123,9 +123,6 @@ void QtChatListWindow::handleEditBookmark() {  void QtChatListWindow::contextMenuEvent(QContextMenuEvent* event) { -	if (!bookmarksEnabled_) { -		return; -	}  	QModelIndex index = indexAt(event->pos());  	ChatListItem* baseItem = index.isValid() ? static_cast<ChatListItem*>(index.internalPointer()) : NULL;  	contextMenuItem_ = baseItem; @@ -135,8 +132,20 @@ void QtChatListWindow::contextMenuEvent(QContextMenuEvent* event) {  	}  	ChatListMUCItem* mucItem = dynamic_cast<ChatListMUCItem*>(baseItem);  	if (mucItem) { +		if (!bookmarksEnabled_) { +			return; +		}  		mucMenu_->exec(QCursor::pos());  	} +	else { +		QMenu menu; +		QAction* clearRecents = menu.addAction(tr("Clear recents")); +		menu.addAction(clearRecents); +		QAction* result = menu.exec(event->globalPos()); +		if (result == clearRecents) { +			onClearRecentsRequested(); +		} +	}  }  }  | 
 Swift