X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffermodel.cpp;h=3dfdc6da9064f3d9591c1a41bbb8c75762ee566f;hp=52d6d54c5073b05f1d2fc196a3186c487f271622;hb=e190d576540cf5dfb2e63d33a69662083f3db210;hpb=4ea3ce9e1ff6df8b1d2a257da7e5fbba9f6cbfbc 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 << ")"; }