#include <QColor> // FIXME Dependency on QtGui!
-#include "global.h"
+#include "clientproxy.h"
#include "buffertreemodel.h"
/*****************************************
}
}
-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);
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<TreeItem*>(networkItemIndex.internalPointer());
-
+ Q_ASSERT(networkItem);
int nextRow = networkItem->childCount();
beginInsertRows(networkItemIndex, nextRow, nextRow);
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")))
}
// 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);
QModelIndex index = getOrCreateBufferItemIndex(buffer);
emit selectionChanged(index);
}
+
+// EgS: check if this makes sense!
+void BufferTreeModel::clear() {
+ TreeModel::clear();
+ networkItem.clear();
+ bufferItem.clear();
+}
+