X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferview.cpp;h=c06e7d2093b84c3585916746bb66c79a5beb26c1;hp=a1435a6d325ee0f8d81c2b0b7bd525b04c9c1b1b;hb=0abe45a62eb5d9c8e1d8c0e783d77e07e705235b;hpb=75d7f7d582826603236394a37f43feb4cd725bb0 diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index a1435a6d..c06e7d20 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -36,7 +36,6 @@ #include "buffersyncer.h" #include "client.h" #include "iconloader.h" -#include "mappedselectionmodel.h" #include "network.h" #include "networkmodel.h" #include "networkmodelactionprovider.h" @@ -347,13 +346,12 @@ void BufferView::on_configChanged() { collapse(networkIdx); } - // update selection to current one - MappedSelectionModel *mappedSelectionModel = qobject_cast(selectionModel()); - if(!config() || !mappedSelectionModel) - return; + if(config()) { + // update selection to current one + Client::bufferModel()->synchronizeView(this); + } - mappedSelectionModel->mappedSetCurrentIndex(Client::bufferModel()->standardSelectionModel()->currentIndex(), QItemSelectionModel::Current); - mappedSelectionModel->mappedSelect(Client::bufferModel()->standardSelectionModel()->selection(), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); + return; } void BufferView::on_collapse(const QModelIndex &index) { @@ -413,7 +411,12 @@ void BufferView::contextMenuEvent(QContextMenuEvent *event) { } void BufferView::addActionsToMenu(QMenu *contextMenu, const QModelIndex &index) { - Client::mainUi()->actionProvider()->addActions(contextMenu, index, this, "menuActionTriggered", (bool)config()); + QModelIndexList indexList = selectedIndexes(); + // make sure the item we clicked on is first + indexList.removeAll(index); + indexList.prepend(index); + + Client::mainUi()->actionProvider()->addActions(contextMenu, indexList, this, "menuActionTriggered", (bool)config()); } void BufferView::addFilterActions(QMenu *contextMenu, const QModelIndex &index) {