/***************************************************************************
- * Copyright (C) 2005-07 by The Quassel Team *
+ * Copyright (C) 2005-07 by the Quassel IRC Team *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
+ * (at your option) version 3. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
{
setSourceModel(model);
setSortCaseSensitivity(Qt::CaseInsensitive);
+
+ // FIXME
+ // ok the following basically sucks. therfore it's commented out. Justice served.
+ // a better solution would use dataChanged()
// I have this feeling that this resulted in a fuckup once... no clue though right now and invalidateFilter isn't a slot -.-
//connect(model, SIGNAL(invalidateFilter()), this, SLOT(invalidate()));
- connect(model, SIGNAL(invalidateFilter()), this, SLOT(invalidateFilter_()));
+ // connect(model, SIGNAL(invalidateFilter()), this, SLOT(invalidateFilter_()));
}
void BufferViewFilter::invalidateFilter_() {
for(int i = 0; i < bufferList.count(); i++) {
netId = bufferList[i].first;
bufferId = bufferList[i].second;
- networks << netId;
+ if(!networks.contains(netId)) {
+ networks << netId;
+ }
addBuffer(bufferId);
}
return true;
bool lastBuffer = (rowCount(index.parent()) == 1);
uint netId = index.data(BufferTreeModel::NetworkIdRole).toUInt();
uint bufferuid = index.data(BufferTreeModel::BufferUidRole).toUInt();
+
if(buffers.contains(bufferuid)) {
buffers.remove(bufferuid);
- if(lastBuffer)
+
+ if(lastBuffer) {
networks.remove(netId);
+ Q_ASSERT(!networks.contains(netId));
+ }
+
invalidateFilter();
}
// if((mode & NoInactive) && !isActive)
// return false;
-// if((mode & FullCustom)) {
-// uint bufferuid = source_bufferIndex.data(BufferTreeModel::BufferUidRole).toUInt();
-// if(!buffers.contains(bufferuid))
-// return false;
-// }
+ if((mode & FullCustom)) {
+ uint bufferuid = source_bufferIndex.data(BufferTreeModel::BufferUidRole).toUInt();
+ return buffers.contains(bufferuid);
+ }
return true;
}