X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fbufferview.cpp;h=e06ef720df0dbae563e6c59a1111761278d5bef4;hp=c60aa80f4d905f43b868bea0a2027f757e6a83be;hb=6250a7e25eb2c0a6794d4aa5679c70082d825031;hpb=748f25bbae0e0ca8df58ec69df8d19c84ae77252 diff --git a/src/qtui/bufferview.cpp b/src/qtui/bufferview.cpp index c60aa80f..e06ef720 100644 --- a/src/qtui/bufferview.cpp +++ b/src/qtui/bufferview.cpp @@ -44,43 +44,20 @@ void BufferView::init() { setSortingEnabled(true); sortByColumn(0, Qt::AscendingOrder); - - connect(selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), - model(), SLOT(changeCurrent(const QModelIndex &, const QModelIndex &))); - - connect(model(), SIGNAL(selectionChanged(const QModelIndex &)), - this, SLOT(select(const QModelIndex &))); - - connect(this, SIGNAL(selectionChanged(const QModelIndex &, QItemSelectionModel::SelectionFlags)), - selectionModel(), SLOT(select(const QModelIndex &, QItemSelectionModel::SelectionFlags))); - connect(this, SIGNAL(activated(QModelIndex)), this, SLOT(joinChannel(QModelIndex))); } -void BufferView::setFilteredModel(QAbstractItemModel *model, BufferViewFilter::Modes mode, QStringList nets) { +void BufferView::setFilteredModel(QAbstractItemModel *model, BufferViewFilter::Modes mode, QList nets) { BufferViewFilter *filter = new BufferViewFilter(model, mode, nets); setModel(filter); - connect(this, SIGNAL(eventDropped(QDropEvent *)), filter, SLOT(dropEvent(QDropEvent *))); connect(this, SIGNAL(removeBuffer(const QModelIndex &)), filter, SLOT(removeBuffer(const QModelIndex &))); } void BufferView::setModel(QAbstractItemModel *model) { + delete selectionModel(); QTreeView::setModel(model); init(); -} - -void BufferView::select(const QModelIndex ¤t) { - emit selectionChanged(current, QItemSelectionModel::ClearAndSelect); -} - -void BufferView::dropEvent(QDropEvent *event) { - if(event->source() != this) { - // another view(?) or widget is the source. maybe it's a drag 'n drop - // view customization -> we tell our friend the filter: - emit eventDropped(event); - } - // in the case that the filter did not accept the event or if it's a merge - QTreeView::dropEvent(event); + } void BufferView::joinChannel(const QModelIndex &index) {