X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fnicklistwidget.cpp;h=714731a961c7336573285bfea11fd7f3993633fa;hp=4cfd5b68ec91af21ecb58a97ab0ce4e87df0d7fc;hb=1b2d3ea62867220d7bffc3b23dda1dc14d429007;hpb=08cf52eafbd690bbaa3c86e57cb02e7e82dc3159 diff --git a/src/qtui/nicklistwidget.cpp b/src/qtui/nicklistwidget.cpp index 4cfd5b68..714731a9 100644 --- a/src/qtui/nicklistwidget.cpp +++ b/src/qtui/nicklistwidget.cpp @@ -28,39 +28,11 @@ #include "nickviewfilter.h" NickListWidget::NickListWidget(QWidget *parent) - : QWidget(parent), - _bufferModel(0), - _selectionModel(0) + : AbstractItemView(parent) { ui.setupUi(this); } -void NickListWidget::setModel(BufferModel *bufferModel) { - if(_bufferModel) { - disconnect(_bufferModel, 0, this, 0); - } - - _bufferModel = bufferModel; - - if(bufferModel) { - connect(bufferModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), - this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); - } -} - -void NickListWidget::setSelectionModel(QItemSelectionModel *selectionModel) { - if(_selectionModel) { - disconnect(_selectionModel, 0, this, 0); - } - - _selectionModel = selectionModel; - - if(selectionModel) { - connect(selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), - this, SLOT(currentChanged(QModelIndex, QModelIndex))); - } -} - void NickListWidget::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { BufferInfo::Type bufferType = (BufferInfo::Type)current.data(NetworkModel::BufferTypeRole).toInt(); BufferId newBufferId = current.data(NetworkModel::BufferIdRole).value();