X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffermodel.h;h=812bc84b8958aaf3b0017e4760c0ea32ea5e4aca;hp=80f1ec0ab33e701c5aff00bd2478540edf657cb8;hb=73696998505c35c02bd019f78e9f502cbc36da5b;hpb=770b7ef54b03f3ebd1e29a58b4757505e1809b2d diff --git a/src/client/buffermodel.h b/src/client/buffermodel.h index 80f1ec0a..812bc84b 100644 --- a/src/client/buffermodel.h +++ b/src/client/buffermodel.h @@ -26,10 +26,8 @@ #include "types.h" #include "selectionmodelsynchronizer.h" -#include "modelpropertymapper.h" class NetworkModel; -class MappedSelectionModel; class QAbstractItemView; class BufferModel : public QSortFilterProxyModel { @@ -37,26 +35,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(); } - - void synchronizeSelectionModel(MappedSelectionModel *selectionModel); + inline QItemSelectionModel *standardSelectionModel() const { return _selectionModelSynchronizer.selectionModel(); } + + inline void synchronizeSelectionModel(QItemSelectionModel *selectionModel) { _selectionModelSynchronizer.synchronizeSelectionModel(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 currentChanged(const QModelIndex ¤t, const QModelIndex &previous); - + void debug_currentChanged(QModelIndex current, QModelIndex previous); + private: SelectionModelSynchronizer _selectionModelSynchronizer; - ModelPropertyMapper _propertyMapper; }; #endif // BUFFERMODEL_H