File indexing completed on 2024-04-28 04:37:04
0001 /* 0002 SPDX-FileCopyrightText: 2010 Aleix Pol Gonzalez <aleixpol@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KDEVPLATFORM_PROJECTCHANGESMODEL_H 0008 #define KDEVPLATFORM_PROJECTCHANGESMODEL_H 0009 0010 #include <vcs/models/vcsfilechangesmodel.h> 0011 #include <vcs/interfaces/ibasicversioncontrol.h> 0012 0013 #include "projectexport.h" 0014 0015 class KJob; 0016 namespace KDevelop { 0017 class IProject; 0018 class IDocument; 0019 0020 class KDEVPLATFORMPROJECT_EXPORT ProjectChangesModel : public VcsFileChangesModel 0021 { 0022 Q_OBJECT 0023 public: 0024 enum Role { ProjectNameRole = LastItemRole+1 }; 0025 explicit ProjectChangesModel(QObject* parent); 0026 ~ProjectChangesModel() override; 0027 0028 void updateState(KDevelop::IProject* p, const KDevelop::VcsStatusInfo& status); 0029 0030 void changes(KDevelop::IProject* project, const QList<QUrl>& urls, KDevelop::IBasicVersionControl::RecursionMode mode); 0031 0032 public Q_SLOTS: 0033 void reloadAll(); 0034 void reload(const QList<KDevelop::IProject*>& p); 0035 void reload(const QList<QUrl>& p); 0036 0037 void addProject(KDevelop::IProject* p); 0038 void removeProject(KDevelop::IProject* p); 0039 0040 void statusReady(KJob* job); 0041 void documentSaved(KDevelop::IDocument*); 0042 void itemsAdded(const QModelIndex& idx, int start, int end); 0043 void jobUnregistered(KJob*); 0044 void repositoryBranchChanged(const QUrl& url); 0045 void branchNameReady(KDevelop::VcsJob* job); 0046 0047 private: 0048 QStandardItem* projectItem(KDevelop::IProject* p) const; 0049 }; 0050 0051 } 0052 0053 #endif // KDEVPLATFORM_PROJECTCHANGESMODEL_H