X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffermodel.h;h=812bc84b8958aaf3b0017e4760c0ea32ea5e4aca;hp=4fb610db53743e727ffc72d4be65d70759a59e75;hb=73696998505c35c02bd019f78e9f502cbc36da5b;hpb=2f05c5d7e94d5e96d2b4bae59140fd3b60a7a62f diff --git a/src/client/buffermodel.h b/src/client/buffermodel.h index 4fb610db..812bc84b 100644 --- a/src/client/buffermodel.h +++ b/src/client/buffermodel.h @@ -23,45 +23,39 @@ #include #include -#include -class NetworkModel; -//class SelectionModelSynchronizer; +#include "types.h" #include "selectionmodelsynchronizer.h" -//class ModelPropertyMapper; -#include "modelpropertymapper.h" -class MappedSelectionModel; + +class NetworkModel; class QAbstractItemView; -class Buffer; class BufferModel : public QSortFilterProxyModel { Q_OBJECT public: BufferModel(NetworkModel *parent = 0); - virtual ~BufferModel(); bool filterAcceptsRow(int sourceRow, const QModelIndex &parent) const; - inline SelectionModelSynchronizer *selectionModelSynchronizer() { return _selectionModelSynchronizer; } - inline ModelPropertyMapper *propertyMapper() { return _propertyMapper; } - - void synchronizeSelectionModel(MappedSelectionModel *selectionModel); + inline const SelectionModelSynchronizer *selectionModelSynchronizer() const { return &_selectionModelSynchronizer; } + 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); -public slots: - void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command); - void selectBuffer(Buffer *buffer); + inline QModelIndex currentIndex() { return standardSelectionModel()->currentIndex(); } -signals: - void bufferSelected(Buffer *); - void selectionChanged(const QModelIndex &); +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: - QPointer _selectionModelSynchronizer; - QPointer _propertyMapper; - Buffer *currentBuffer; + SelectionModelSynchronizer _selectionModelSynchronizer; }; #endif // BUFFERMODEL_H