X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=gui%2Fbufferviewwidget.cpp;h=a78754e76e47dc03bda8a8fc50e674c03a736270;hp=e21b98baece95cd87d8b46b65450a49470b8b695;hb=f0a6776fc5102ff6a7fe1469917fe231e4cd3a8a;hpb=62f292ad143923a3b774b9bd14f83f3b640c0cb8 diff --git a/gui/bufferviewwidget.cpp b/gui/bufferviewwidget.cpp index e21b98ba..a78754e7 100644 --- a/gui/bufferviewwidget.cpp +++ b/gui/bufferviewwidget.cpp @@ -154,8 +154,8 @@ BufferTreeModel::BufferTreeModel(QObject *parent) : QAbstractItemModel(parent) { QList rootData; rootData << "Buffer" << "Network"; rootItem = new TreeItem(rootData, 0); - - connect(this, SIGNAL(fakeUserInput(BufferId, QString)), guiProxy, SLOT(gsUserInput(BufferId, QString))); + + connect(this, SIGNAL(fakeUserInput(BufferId, QString)), ClientProxy::instance(), SLOT(gsUserInput(BufferId, QString))); } BufferTreeModel::~BufferTreeModel() { @@ -291,11 +291,11 @@ QModelIndex BufferTreeModel::getOrCreateBufferItemIndex(Buffer *buffer) { TreeItem *networkItem = static_cast(networkItemIndex.internalPointer()); int nextRow = networkItem->childCount(); - + beginInsertRows(networkItemIndex, nextRow, nextRow); networkItem->appendChild(new BufferTreeItem(buffer, networkItem)); endInsertRows(); - + bufferItem[buffer] = static_cast(networkItem->child(nextRow)); return index(nextRow, 0, networkItemIndex); } @@ -334,13 +334,14 @@ bool BufferTreeModel::dropMimeData(const QMimeData *data, Qt::DropAction action, if(sourceBuffer == targetBuffer) // we won't merge with ourself :) return false; - + /* if(QMessageBox::warning(static_cast(QObject::parent()), tr("Merge Buffers?"), tr("Do you really want to merge the following Buffers?
%1.%2
%3.%4").arg(sourceBuffer->networkName()).arg(sourceBuffer->bufferName()).arg(targetBuffer->networkName()).arg(targetBuffer->bufferName()), QMessageBox::Yes|QMessageBox::No) == QMessageBox::No) return false; - + + */ qDebug() << "merging" << sourceBuffer->bufferName() << "with" << targetBuffer->bufferName(); bufferItem.remove(getBufferByIndex(parent)); removeRow(parent.row(), BufferTreeModel::parent(parent)); @@ -360,6 +361,7 @@ void BufferTreeModel::changeCurrent(const QModelIndex ¤t, const QModelInde currentBuffer = getBufferByIndex(current); bufferActivity(Buffer::NoActivity, currentBuffer); emit bufferSelected(currentBuffer); + emit updateSelection(current, QItemSelectionModel::ClearAndSelect); } }