X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fnetworkmodelactionprovider.cpp;h=31117f4eff54e8d4c86110c45ad4b54d206b9ffc;hp=555535ef2645181adcb67e5435870c4af95fc395;hb=6eebebc97f84a94f732b05a793ea8e4c000643ab;hpb=e11bf86d6ebf583b22528fe5fda689aa89ff4aa9 diff --git a/src/uisupport/networkmodelactionprovider.cpp b/src/uisupport/networkmodelactionprovider.cpp index 555535ef..31117f4e 100644 --- a/src/uisupport/networkmodelactionprovider.cpp +++ b/src/uisupport/networkmodelactionprovider.cpp @@ -207,13 +207,18 @@ void NetworkModelActionProvider::addActions(QMenu *menu, // ChatView actions if(_contextItem.isEmpty()) { // a) query buffer: handle like ircuser - // b) general chatview: only react if _contextItem is set (i.e. we right-clicked on something) + // b) general chatview: handle like channel iff it displays a single buffer // NOTE stuff breaks probably with merged buffers, need to rework a lot around here then - // for now, use the item type of a random buffer... assuming we never mix channel and query buffers - //if(!_messageFilter->containedBuffers.count()) - // return; - //BufferId randomBuf = _messageFilter->containedBuffers.values().at(0); + if(_messageFilter->containedBuffers().count() == 1) { + // we can handle this like a single bufferItem + QModelIndex index = Client::networkModel()->bufferIndex(_messageFilter->containedBuffers().values().at(0)); + _indexList = QList() << index; + addBufferItemActions(menu, index); + return; + } else { + // TODO: actions for merged buffers... _indexList contains the index of the message we clicked on + } } } } @@ -506,6 +511,8 @@ void NetworkModelActionProvider::handleHideAction(ActionType type, QAction *acti } void NetworkModelActionProvider::handleGeneralAction(ActionType type, QAction *action) { + Q_UNUSED(action) + if(!_indexList.count()) return; NetworkId networkId = _indexList.at(0).data(NetworkModel::NetworkIdRole).value();