X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferviewfilter.cpp;h=3e0a59f00e8ab326d79fa00f799dc282e0fa34ff;hp=4ef0ec8c6ba284f23f9fc95ab336dce3915c6135;hb=0c77beae43efbe3d12e0d46aec935dfa8c7532b9;hpb=650461a80f87424a6fb90b3e5cd5b610ec1f3335 diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index 4ef0ec8c..3e0a59f0 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -169,14 +169,21 @@ Qt::ItemFlags BufferViewFilter::flags(const QModelIndex &index) const { QModelIndex source_index = mapToSource(index); Qt::ItemFlags flags = sourceModel()->flags(source_index); if(config()) { - if(source_index == QModelIndex() || sourceModel()->data(source_index, NetworkModel::ItemTypeRole) == NetworkModel::NetworkItemType) { + NetworkModel::ItemType itemType = (NetworkModel::ItemType)sourceModel()->data(source_index, NetworkModel::ItemTypeRole).toInt(); + BufferInfo::Type bufferType = (BufferInfo::Type)sourceModel()->data(source_index, NetworkModel::BufferTypeRole).toInt(); + if(source_index == QModelIndex() || itemType == NetworkModel::NetworkItemType) { flags |= Qt::ItemIsDropEnabled; } else if(_editMode) { flags |= Qt::ItemIsUserCheckable | Qt::ItemIsTristate; } - ClientBufferViewConfig *clientConf = qobject_cast(config()); - if(clientConf && clientConf->isLocked()) { - flags &= ~(Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled); + + // prohibit dragging of most items. and most drop places + // only query to query is allowed for merging + if(bufferType != BufferInfo::QueryBuffer) { + ClientBufferViewConfig *clientConf = qobject_cast(config()); + if(clientConf && clientConf->isLocked()) { + flags &= ~(Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled); + } } } return flags;