X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffermodel.h;h=37f8916c1cfd876a2104af5638cf152f740a0796;hp=2d6f4b478b08ce987472f95f29ff7d2ccd38da66;hb=af456476e906a564d9faf3381b8bc3111fdb2bbd;hpb=23eed68958b7585552be04fab4e5871a781b7f38 diff --git a/src/client/buffermodel.h b/src/client/buffermodel.h index 2d6f4b47..37f8916c 100644 --- a/src/client/buffermodel.h +++ b/src/client/buffermodel.h @@ -26,7 +26,6 @@ #include "types.h" #include "selectionmodelsynchronizer.h" -#include "modelpropertymapper.h" class NetworkModel; class MappedSelectionModel; @@ -37,23 +36,27 @@ class BufferModel : public QSortFilterProxyModel { public: BufferModel(NetworkModel *parent = 0); - virtual ~BufferModel(); bool filterAcceptsRow(int sourceRow, const QModelIndex &parent) const; inline const SelectionModelSynchronizer *selectionModelSynchronizer() const { return &_selectionModelSynchronizer; } - inline const ModelPropertyMapper *propertyMapper() const { return &_propertyMapper; } - inline QItemSelectionModel *standardSelectionModel() const { return _propertyMapper.selectionModel(); } - + inline QItemSelectionModel *standardSelectionModel() const { return _selectionModelSynchronizer.selectionModel(); } + void synchronizeSelectionModel(MappedSelectionModel *selectionModel); void synchronizeView(QAbstractItemView *view); - void mapProperty(int column, int role, QObject *target, const QByteArray &property); - QModelIndex currentIndex(); + inline QModelIndex currentIndex() { return standardSelectionModel()->currentIndex(); } + +public slots: + void setCurrentIndex(const QModelIndex &newCurrent); + void switchToBuffer(const BufferId &bufferId); + void switchToBufferIndex(const QModelIndex &bufferIdx); +private slots: + void debug_currentChanged(QModelIndex current, QModelIndex previous); + private: SelectionModelSynchronizer _selectionModelSynchronizer; - ModelPropertyMapper _propertyMapper; }; #endif // BUFFERMODEL_H