X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffertreemodel.cpp;h=37fe63bf0c3b7ce669f1423cb3cafbe5cde17f8c;hp=3aac9f312a4dcf4d283c2f8a31c66e288d76439c;hb=4bdda41a706b963c0163d38764acb3ffea52f256;hpb=a5c0b0735d9a448be2556dfe5dc8e89bb4176cd7 diff --git a/src/client/buffertreemodel.cpp b/src/client/buffertreemodel.cpp index 3aac9f31..37fe63bf 100644 --- a/src/client/buffertreemodel.cpp +++ b/src/client/buffertreemodel.cpp @@ -20,7 +20,7 @@ #include // FIXME Dependency on QtGui! -#include "global.h" +#include "clientproxy.h" #include "buffertreemodel.h" /***************************************** @@ -46,7 +46,7 @@ QString BufferTreeItem::text(int column) const { } } -QColor BufferTreeItem::foreground(int column) const { +QColor BufferTreeItem::foreground(int /*column*/) const { // for the time beeing we ignore the column :) if(activity & Buffer::Highlight) { return QColor(Qt::red); @@ -145,13 +145,13 @@ QModelIndex BufferTreeModel::getOrCreateNetworkItemIndex(Buffer *buffer) { QModelIndex BufferTreeModel::getOrCreateBufferItemIndex(Buffer *buffer) { QModelIndex networkItemIndex = getOrCreateNetworkItemIndex(buffer); - + if(bufferItem.contains(buffer)) { return index(bufferItem[buffer]->row(), 0, networkItemIndex); } else { // first we determine the parent of the new Item TreeItem *networkItem = static_cast(networkItemIndex.internalPointer()); - + Q_ASSERT(networkItem); int nextRow = networkItem->childCount(); beginInsertRows(networkItemIndex, nextRow, nextRow); @@ -182,7 +182,7 @@ QMimeData *BufferTreeModel::mimeData(const QModelIndexList &indexes) const { return mimeData; } -bool BufferTreeModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) { +bool BufferTreeModel::dropMimeData(const QMimeData *data, Qt::DropAction /*action*/, int /*row*/, int /*column*/, const QModelIndex &parent) { if(!(data->hasFormat("application/Quassel/BufferItem/row") && data->hasFormat("application/Quassel/BufferItem/network") && data->hasFormat("application/Quassel/BufferItem/bufferId"))) @@ -227,7 +227,7 @@ void BufferTreeModel::bufferUpdated(Buffer *buffer) { } // This Slot indicates that the user has selected a different buffer in the gui -void BufferTreeModel::changeCurrent(const QModelIndex ¤t, const QModelIndex &previous) { +void BufferTreeModel::changeCurrent(const QModelIndex ¤t, const QModelIndex &/*previous*/) { if(isBufferIndex(current)) { currentBuffer = getBufferByIndex(current); bufferActivity(Buffer::NoActivity, currentBuffer); @@ -257,3 +257,11 @@ void BufferTreeModel::selectBuffer(Buffer *buffer) { QModelIndex index = getOrCreateBufferItemIndex(buffer); emit selectionChanged(index); } + +// EgS: check if this makes sense! +void BufferTreeModel::clear() { + TreeModel::clear(); + networkItem.clear(); + bufferItem.clear(); +} +