-void BufferViewFilter::dropEvent(QDropEvent *event) {
- const QMimeData *data = event->mimeData();
- if(!(mode & FullCustom))
- return; // only custom buffers can be customized... obviously... :)
-
- if(!(data->hasFormat("application/Quassel/BufferItem/row")
- && data->hasFormat("application/Quassel/BufferItem/network")
- && data->hasFormat("application/Quassel/BufferItem/bufferInfo")))
- return; // whatever the drop is... it's not a buffer...
-
- event->accept();
- uint bufferuid = data->data("application/Quassel/BufferItem/bufferInfo").toUInt();
- QString networkname = QString::fromUtf8("application/Quassel/BufferItem/network");
-
- for(int rowid = 0; rowid < rowCount(); rowid++) {
- QModelIndex networkindex = index(rowid, 0);
- if(networkindex.data(Qt::DisplayRole) == networkname) {
- addBuffer(bufferuid);
- return;
- }
+Qt::ItemFlags BufferViewFilter::flags(const QModelIndex &index) const {
+ Qt::ItemFlags flags = mapToSource(index).flags();
+ if(mode & FullCustom) {
+ if(index == QModelIndex() || index.parent() == QModelIndex())
+ flags |= Qt::ItemIsDropEnabled;