/* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef ARCHIVECONTROLLER_H #define ARCHIVECONTROLLER_H #include #include class ArchiveTree; class ArchiveProxy; class ArchiveFiles; class ArchiveFilesProxy; class ArchiveModel; class ArchiveFilesModel; class QItemSelectionModel; class QSortFilterProxyModel; class ArchiveController : public QObject { Q_OBJECT public: explicit ArchiveController(QObject *parent = 0); void setArchiveView(ArchiveTree *atree, ArchiveProxy *aproxy); void setArchiveFiles(ArchiveFiles *afiles, ArchiveFilesProxy *afilesproxy); void setModels(ArchiveModel *amodel, ArchiveFilesModel *afilesmodel); void init(); private slots: void treeSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); private: QModelIndexList mapToSource(const QSortFilterProxyModel *proxy, const QModelIndexList idxs) const; ArchiveTree *mArchiveTree; ArchiveProxy *mArchiveProxy; QItemSelectionModel *mArchiveSelection; ArchiveFiles *mArchiveFiles; ArchiveFilesProxy *mArchiveFilesProxy; ArchiveModel *mArchiveModel; ArchiveFilesModel *mArchiveFilesModel; }; #endif // ARCHIVECONTROLLER_H