#ifndef REPOSITORYMODEL_H #define REPOSITORYMODEL_H #include #include #include #include class RepositoryModel : public UniversalListModel { Q_OBJECT Q_PROPERTY(int activeRepositoryIndex READ activeRepositoryIndex NOTIFY activeRepositoryIndexChanged) public: RepositoryModel(QObject *parent = 0); ~RepositoryModel(); void addRepository(GitRepository* repository); void removeRepository(GitRepository* repository); int activeRepositoryIndex() const { return m_activeRepositoryIndex; } public slots: void setActiveRepositoryIndex(int activeRepositoryIndex) { if (m_activeRepositoryIndex == activeRepositoryIndex) return; m_activeRepositoryIndex = activeRepositoryIndex; emit activeRepositoryIndexChanged(activeRepositoryIndex); } signals: void activeRepositoryIndexChanged(int activeRepositoryIndex); private: QList m_repolist; int m_activeRepositoryIndex; }; #endif // REPOSITORYMODEL_H