X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffermodel.cpp;h=e6bafd7098d84828de0a4d337f609093c6e1e9d7;hp=9c8df06f3286120336a339ae4f82deed74d8b10a;hb=74b71a1dde2e2cab142a641db6e696595cf62493;hpb=c5c74323b6d8f3fc6775ca1d08cb84c602bac58d diff --git a/src/client/buffermodel.cpp b/src/client/buffermodel.cpp index 9c8df06f..e6bafd70 100644 --- a/src/client/buffermodel.cpp +++ b/src/client/buffermodel.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -20,19 +20,18 @@ #include "buffermodel.h" +#include + #include "client.h" -#include "global.h" -#include "mappedselectionmodel.h" #include "networkmodel.h" - -#include +#include "quassel.h" BufferModel::BufferModel(NetworkModel *parent) : QSortFilterProxyModel(parent), _selectionModelSynchronizer(this) { setSourceModel(parent); - if(Global::parser.isSet("debugbufferswitches")) { + if(Quassel::isOptionSet("debugbufferswitches")) { connect(_selectionModelSynchronizer.selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(debug_currentChanged(const QModelIndex &, const QModelIndex &))); } @@ -49,16 +48,8 @@ bool BufferModel::filterAcceptsRow(int sourceRow, const QModelIndex &parent) con return false; } -void BufferModel::synchronizeSelectionModel(MappedSelectionModel *selectionModel) { - _selectionModelSynchronizer.addSelectionModel(selectionModel); -} - void BufferModel::synchronizeView(QAbstractItemView *view) { - MappedSelectionModel *mappedSelectionModel = new MappedSelectionModel(view->model()); - _selectionModelSynchronizer.addSelectionModel(mappedSelectionModel); - Q_ASSERT(mappedSelectionModel); - delete view->selectionModel(); - view->setSelectionModel(mappedSelectionModel); + _selectionModelSynchronizer.synchronizeSelectionModel(view->selectionModel()); } void BufferModel::setCurrentIndex(const QModelIndex &newCurrent) {