X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferviewfilter.cpp;h=9f0d4a1a4c8080c9f0ad8887af5f10ec0ddbbf34;hp=4f9f767526d9bb3de1e3b66e804255c0ae45ab3a;hb=788fd0058595c815dc42597e9956c02aea45261f;hpb=c9ef00c67a47448e92398a5dce6ce5b74e77783a diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index 4f9f7675..9f0d4a1a 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -58,10 +58,10 @@ bool BufferViewFilter::dropMimeData(const QMimeData *data, Qt::DropAction action if(parent != QModelIndex()) return QSortFilterProxyModel::dropMimeData(data, action, row, column, parent); - if(!BufferTreeModel::mimeContainsBufferList(data)) + if(!NetworkModel::mimeContainsBufferList(data)) return false; - QList< QPair > bufferList = BufferTreeModel::mimeDataToBufferList(data); + QList< QPair > bufferList = NetworkModel::mimeDataToBufferList(data); uint netId, bufferId; for(int i = 0; i < bufferList.count(); i++) { @@ -90,8 +90,8 @@ void BufferViewFilter::removeBuffer(const QModelIndex &index) { return; // only child elements can be deleted bool lastBuffer = (rowCount(index.parent()) == 1); - uint netId = index.data(BufferTreeModel::NetworkIdRole).toUInt(); - uint bufferuid = index.data(BufferTreeModel::BufferUidRole).toUInt(); + uint netId = index.data(NetworkModel::NetworkIdRole).toUInt(); + uint bufferuid = index.data(NetworkModel::BufferUidRole).toUInt(); if(buffers.contains(bufferuid)) { buffers.remove(bufferuid); @@ -108,7 +108,7 @@ void BufferViewFilter::removeBuffer(const QModelIndex &index) { bool BufferViewFilter::filterAcceptBuffer(const QModelIndex &source_bufferIndex) const { - Buffer::Type bufferType = (Buffer::Type) source_bufferIndex.data(BufferTreeModel::BufferTypeRole).toInt(); + Buffer::Type bufferType = (Buffer::Type) source_bufferIndex.data(NetworkModel::BufferTypeRole).toInt(); if((mode & NoChannels) && bufferType == Buffer::ChannelType) return false; @@ -117,14 +117,14 @@ bool BufferViewFilter::filterAcceptBuffer(const QModelIndex &source_bufferIndex) if((mode & NoServers) && bufferType == Buffer::StatusType) return false; -// bool isActive = source_bufferIndex.data(BufferTreeModel::BufferActiveRole).toBool(); +// bool isActive = source_bufferIndex.data(NetworkModel::BufferActiveRole).toBool(); // if((mode & NoActive) && isActive) // return false; // if((mode & NoInactive) && !isActive) // return false; if((mode & FullCustom)) { - uint bufferuid = source_bufferIndex.data(BufferTreeModel::BufferUidRole).toUInt(); + uint bufferuid = source_bufferIndex.data(NetworkModel::BufferUidRole).toUInt(); return buffers.contains(bufferuid); } @@ -132,7 +132,7 @@ bool BufferViewFilter::filterAcceptBuffer(const QModelIndex &source_bufferIndex) } bool BufferViewFilter::filterAcceptNetwork(const QModelIndex &source_index) const { - uint net = source_index.data(BufferTreeModel::NetworkIdRole).toUInt(); + uint net = source_index.data(NetworkModel::NetworkIdRole).toUInt(); return !((mode & (SomeNets | FullCustom)) && !networks.contains(net)); } @@ -151,8 +151,8 @@ bool BufferViewFilter::filterAcceptsRow(int source_row, const QModelIndex &sourc } bool BufferViewFilter::lessThan(const QModelIndex &left, const QModelIndex &right) const { - int lefttype = left.data(BufferTreeModel::BufferTypeRole).toInt(); - int righttype = right.data(BufferTreeModel::BufferTypeRole).toInt(); + int lefttype = left.data(NetworkModel::BufferTypeRole).toInt(); + int righttype = right.data(NetworkModel::BufferTypeRole).toInt(); if(lefttype != righttype) return lefttype < righttype;