X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fbuffermodel.cpp;h=3dfdc6da9064f3d9591c1a41bbb8c75762ee566f;hb=600a5683c1a8e679b7b63a00d5b1211b5b9771c7;hp=52d6d54c5073b05f1d2fc196a3186c487f271622;hpb=cf7c5679c2475bb563cd64e15477c485d89368a3;p=quassel.git diff --git a/src/client/buffermodel.cpp b/src/client/buffermodel.cpp index 52d6d54c..3dfdc6da 100644 --- a/src/client/buffermodel.cpp +++ b/src/client/buffermodel.cpp @@ -27,14 +27,9 @@ BufferModel::BufferModel(NetworkModel *parent) : QSortFilterProxyModel(parent), - _selectionModelSynchronizer(this), - _standardSelectionModel(this) + _selectionModelSynchronizer(this) { setSourceModel(parent); - _selectionModelSynchronizer.addRegularSelectionModel(standardSelectionModel()); -} - -BufferModel::~BufferModel() { } bool BufferModel::filterAcceptsRow(int sourceRow, const QModelIndex &parent) const { @@ -65,6 +60,14 @@ QModelIndex BufferModel::currentIndex() { } void BufferModel::setCurrentIndex(const QModelIndex &newCurrent) { - _standardSelectionModel.setCurrentIndex(newCurrent, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); - _standardSelectionModel.select(newCurrent, QItemSelectionModel::ClearAndSelect); + _selectionModelSynchronizer.selectionModel()->setCurrentIndex(newCurrent, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); + _selectionModelSynchronizer.selectionModel()->select(newCurrent, QItemSelectionModel::Current); +} + +void BufferModel::debug_currentChanged(QModelIndex current, QModelIndex previous) { + qDebug() << "New current:" << current << "(previous:" << previous << ")"; +} + +void BufferModel::debug_selectionChanged(QItemSelection current , QItemSelection previous) { + qDebug() << "new selection:" << current << "(previoius:" << previous << ")"; }