diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index 12e4592b..f1befd7e 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -139,6 +139,7 @@ SOURCES += \ widgets/coloredit.cpp \ widgets/consolewidget.cpp \ widgets/customdisablediconengine.cpp \ + widgets/customfilesystemmodel.cpp \ widgets/custommakefileinfodialog.cpp \ widgets/darkfusionstyle.cpp \ widgets/editorstabwidget.cpp \ @@ -270,6 +271,7 @@ HEADERS += \ widgets/coloredit.h \ widgets/consolewidget.h \ widgets/customdisablediconengine.h \ + widgets/customfilesystemmodel.h \ widgets/custommakefileinfodialog.h \ widgets/darkfusionstyle.h \ widgets/editorstabwidget.h \ diff --git a/RedPandaIDE/customfileiconprovider.cpp b/RedPandaIDE/customfileiconprovider.cpp index c28af730..3a11b57a 100644 --- a/RedPandaIDE/customfileiconprovider.cpp +++ b/RedPandaIDE/customfileiconprovider.cpp @@ -1,9 +1,15 @@ #include "customfileiconprovider.h" #include "iconsmanager.h" +#include "vcs/gitmanager.h" CustomFileIconProvider::CustomFileIconProvider() { + mVCSManager = new GitManager(); +} +CustomFileIconProvider::~CustomFileIconProvider() +{ + delete mVCSManager; } QIcon CustomFileIconProvider::icon(IconType type) const @@ -20,14 +26,56 @@ QIcon CustomFileIconProvider::icon(IconType type) const QIcon CustomFileIconProvider::icon(const QFileInfo &info) const { QIcon icon; - if (isHFile(info.fileName())) - icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_HFILE); - else if (isCppFile(info.fileName())) { - icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CPPFILE); + if (info.isDir()) { + if (mVCSManager && mVCSManager->isFileInRepository(info)) { + if (mVCSManager->isFileInStaged(info)) + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FOLDER_VCS_STAGED); + else if (mVCSManager->isFileChanged(info)) + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FOLDER_VCS_CHANGED); + else + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FOLDER_VCS_NOCHANGE); + } else + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FOLDER); + } if (isHFile(info.fileName())) { + if (mVCSManager && mVCSManager->isFileInRepository(info)) { + if (mVCSManager->isFileInStaged(info)) + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_HFILE_VCS_STAGED); + else if (mVCSManager->isFileChanged(info)) + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_HFILE_VCS_CHANGED); + else + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_HFILE_VCS_NOCHANGE); + } else + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_HFILE); + } else if (isCppFile(info.fileName())) { + if (mVCSManager && mVCSManager->isFileInRepository(info)) { + if (mVCSManager->isFileInStaged(info)) + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CPPFILE_VCS_STAGED); + else if (mVCSManager->isFileChanged(info)) + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CPPFILE_VCS_CHANGED); + else + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CPPFILE_VCS_NOCHANGE); + } else + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CPPFILE); } else if (isCFile(info.fileName())) { - icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CFILE); + if (mVCSManager && mVCSManager->isFileInRepository(info)) { + if (mVCSManager->isFileInStaged(info)) + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CFILE_VCS_STAGED); + else if (mVCSManager->isFileChanged(info)) + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CFILE_VCS_CHANGED); + else + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CFILE_VCS_NOCHANGE); + } else + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CFILE); } else if (info.suffix()=="dev") { - icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_PROJECTFILE); + if (mVCSManager && mVCSManager->isFileInRepository(info)) { + if (mVCSManager->isFileInStaged(info)) + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_PROJECTFILE_VCS_STAGED); + else if (mVCSManager->isFileChanged(info)) + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_PROJECTFILE_VCS_CHANGED); + else + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_PROJECTFILE_VCS_NOCHANGE); + } else + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_PROJECTFILE); } if (!icon.isNull()) return icon; diff --git a/RedPandaIDE/customfileiconprovider.h b/RedPandaIDE/customfileiconprovider.h index 890ca9f9..c5e339f2 100644 --- a/RedPandaIDE/customfileiconprovider.h +++ b/RedPandaIDE/customfileiconprovider.h @@ -3,11 +3,14 @@ #include +class GitManager; class CustomFileIconProvider : public QFileIconProvider { public: CustomFileIconProvider(); - + ~CustomFileIconProvider(); +private: + GitManager* mVCSManager; // QFileIconProvider interface public: QIcon icon(IconType type) const override; diff --git a/RedPandaIDE/iconsmanager.cpp b/RedPandaIDE/iconsmanager.cpp index 12e2be12..b4159153 100644 --- a/RedPandaIDE/iconsmanager.cpp +++ b/RedPandaIDE/iconsmanager.cpp @@ -181,11 +181,29 @@ void IconsManager::updateFileSystemIcons(const QString &iconSet, int size) updateMakeDisabledIconDarker(iconSet); mIconPixmaps.insert(FILESYSTEM_GIT, createSVGIcon(iconFolder+"git.svg",size,size)); mIconPixmaps.insert(FILESYSTEM_FOLDER, createSVGIcon(iconFolder+"folder.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_FOLDER_VCS_CHANGED, createSVGIcon(iconFolder+"folder-vcs-changed.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_FOLDER_VCS_NOCHANGE, createSVGIcon(iconFolder+"folder-vcs-nochange.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_FOLDER_VCS_STAGED, createSVGIcon(iconFolder+"folder-vcs-staged.svg",size,size)); mIconPixmaps.insert(FILESYSTEM_FILE, createSVGIcon(iconFolder+"file.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_FILE_VCS_CHANGED, createSVGIcon(iconFolder+"file-vcs-changed.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_FILE_VCS_NOCHANGE, createSVGIcon(iconFolder+"file-vcs-nochange.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_FILE_VCS_STAGED, createSVGIcon(iconFolder+"file-vcs-staged.svg",size,size)); mIconPixmaps.insert(FILESYSTEM_CFILE, createSVGIcon(iconFolder+"cfile.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_CFILE_VCS_CHANGED, createSVGIcon(iconFolder+"cfile-vcs-changed.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_CFILE_VCS_NOCHANGE, createSVGIcon(iconFolder+"cfile-vcs-nochange.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_CFILE_VCS_STAGED, createSVGIcon(iconFolder+"cfile-vcs-staged.svg",size,size)); mIconPixmaps.insert(FILESYSTEM_HFILE, createSVGIcon(iconFolder+"hfile.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_HFILE_VCS_CHANGED, createSVGIcon(iconFolder+"hfile-vcs-changed.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_HFILE_VCS_NOCHANGE, createSVGIcon(iconFolder+"hfile-vcs-nochange.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_HFILE_VCS_STAGED, createSVGIcon(iconFolder+"hfile-vcs-staged.svg",size,size)); mIconPixmaps.insert(FILESYSTEM_CPPFILE, createSVGIcon(iconFolder+"cppfile.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_CPPFILE_VCS_CHANGED, createSVGIcon(iconFolder+"cppfile-vcs-changed.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_CPPFILE_VCS_NOCHANGE, createSVGIcon(iconFolder+"cppfile-vcs-nochange.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_CPPFILE_VCS_STAGED, createSVGIcon(iconFolder+"cppfile-vcs-staged.svg",size,size)); mIconPixmaps.insert(FILESYSTEM_PROJECTFILE, createSVGIcon(iconFolder+"projectfile.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_PROJECTFILE_VCS_CHANGED, createSVGIcon(iconFolder+"projectfile-vcs-changed.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_PROJECTFILE_VCS_NOCHANGE, createSVGIcon(iconFolder+"projectfile-vcs-nochange.svg",size,size)); + mIconPixmaps.insert(FILESYSTEM_PROJECTFILE_VCS_STAGED, createSVGIcon(iconFolder+"projectfile-vcs-staged.svg",size,size)); mIconPixmaps.insert(FILESYSTEM_HEADERS_FOLDER, createSVGIcon(iconFolder+"headerfolder.svg",size,size)); mIconPixmaps.insert(FILESYSTEM_SOURCES_FOLDER, createSVGIcon(iconFolder+"sourcefolder.svg",size,size)); } diff --git a/RedPandaIDE/iconsmanager.h b/RedPandaIDE/iconsmanager.h index 13138c6f..703230bd 100644 --- a/RedPandaIDE/iconsmanager.h +++ b/RedPandaIDE/iconsmanager.h @@ -72,6 +72,24 @@ public: FILESYSTEM_HFILE, FILESYSTEM_PROJECTFILE, FILESYSTEM_CPPFILE, + FILESYSTEM_FOLDER_VCS_CHANGED, + FILESYSTEM_FILE_VCS_CHANGED, + FILESYSTEM_CFILE_VCS_CHANGED, + FILESYSTEM_HFILE_VCS_CHANGED, + FILESYSTEM_PROJECTFILE_VCS_CHANGED, + FILESYSTEM_CPPFILE_VCS_CHANGED, + FILESYSTEM_FOLDER_VCS_NOCHANGE, + FILESYSTEM_FILE_VCS_NOCHANGE, + FILESYSTEM_CFILE_VCS_NOCHANGE, + FILESYSTEM_HFILE_VCS_NOCHANGE, + FILESYSTEM_PROJECTFILE_VCS_NOCHANGE, + FILESYSTEM_CPPFILE_VCS_NOCHANGE, + FILESYSTEM_FOLDER_VCS_STAGED, + FILESYSTEM_FILE_VCS_STAGED, + FILESYSTEM_CFILE_VCS_STAGED, + FILESYSTEM_HFILE_VCS_STAGED, + FILESYSTEM_PROJECTFILE_VCS_STAGED, + FILESYSTEM_CPPFILE_VCS_STAGED, FILESYSTEM_HEADERS_FOLDER, FILESYSTEM_SOURCES_FOLDER, diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui index 16578ae6..7f07ab76 100644 --- a/RedPandaIDE/mainwindow.ui +++ b/RedPandaIDE/mainwindow.ui @@ -291,6 +291,9 @@ QAbstractItemView::ExtendedSelection + + false + @@ -573,6 +576,7 @@ + 50 false @@ -1418,7 +1422,7 @@ 0 0 1114 - 25 + 26 diff --git a/RedPandaIDE/project.cpp b/RedPandaIDE/project.cpp index 6db736ff..2ff7d963 100644 --- a/RedPandaIDE/project.cpp +++ b/RedPandaIDE/project.cpp @@ -36,6 +36,7 @@ #include "customfileiconprovider.h" #include #include "settings.h" +#include "vcs/gitmanager.h" Project::Project(const QString &filename, const QString &name, QObject *parent) : QObject(parent), @@ -1909,6 +1910,12 @@ ProjectModel::ProjectModel(Project *project, QObject *parent): mProject(project) { mUpdateCount = 0; + mVCSManager = new GitManager(); +} + +ProjectModel::~ProjectModel() +{ + delete mVCSManager; } void ProjectModel::beginUpdate() @@ -1980,7 +1987,14 @@ QVariant ProjectModel::data(const QModelIndex &index, int role) const ProjectModelNode* p = static_cast(index.internalPointer()); if (!p) return QVariant(); - if (role == Qt::DisplayRole || role==Qt::EditRole) { + if (role == Qt::DisplayRole) { + if (p == mProject->rootNode().get()) { + QString branch; + if (mVCSManager->hasRepository(mProject->folder(),branch)) + return QString("%1 [%2]").arg(p->text,branch); + } + return p->text; + } else if (role==Qt::EditRole) { return p->text; } else if (role == Qt::DecorationRole) { CustomFileIconProvider provider; @@ -1988,15 +2002,21 @@ QVariant ProjectModel::data(const QModelIndex &index, int role) const if (p->unitIndex>=0) { icon = provider.icon(mProject->units()[p->unitIndex]->fileName()); } else { - switch(p->folderNodeType) { - case ProjectSpecialFolderNode::HEADERS: - icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_HEADERS_FOLDER); - break; - case ProjectSpecialFolderNode::SOURCES: - icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_SOURCES_FOLDER); - break; - default: - icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FOLDER); + if (p == mProject->rootNode().get()) { + QString branch; + if (mVCSManager->hasRepository(mProject->folder(),branch)) + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_GIT); + } else { + switch(p->folderNodeType) { + case ProjectSpecialFolderNode::HEADERS: + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_HEADERS_FOLDER); + break; + case ProjectSpecialFolderNode::SOURCES: + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_SOURCES_FOLDER); + break; + default: + icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FOLDER); + } } if (icon.isNull()) icon = provider.icon(QFileIconProvider::Folder); diff --git a/RedPandaIDE/project.h b/RedPandaIDE/project.h index 73927200..d55477b7 100644 --- a/RedPandaIDE/project.h +++ b/RedPandaIDE/project.h @@ -101,16 +101,20 @@ private: using PProjectUnit = std::shared_ptr; +class GitManager; class ProjectModel : public QAbstractItemModel { Q_OBJECT public: explicit ProjectModel(Project* project, QObject* parent=nullptr); + ~ProjectModel(); void beginUpdate(); void endUpdate(); private: Project* mProject; + GitManager *mVCSManager; int mUpdateCount; + // QAbstractItemModel interface public: QModelIndex index(int row, int column, const QModelIndex &parent) const override; @@ -143,7 +147,6 @@ protected: bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; }; - class ProjectTemplate; class Project : public QObject { diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/cfile-vcs-staged.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/cfile-vcs-staged.svg new file mode 100644 index 00000000..3828e08e --- /dev/null +++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/cfile-vcs-staged.svg @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/cppfile-vcs-staged.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/cppfile-vcs-staged.svg new file mode 100644 index 00000000..d157b152 --- /dev/null +++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/cppfile-vcs-staged.svg @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/file-vcs-staged.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/file-vcs-staged.svg new file mode 100644 index 00000000..8109db78 --- /dev/null +++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/file-vcs-staged.svg @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/folder-vcs-staged.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/folder-vcs-staged.svg new file mode 100644 index 00000000..4f4f113e --- /dev/null +++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/folder-vcs-staged.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/vcs.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/git.svg similarity index 100% rename from RedPandaIDE/resources/iconsets/newlook/filesystem/vcs.svg rename to RedPandaIDE/resources/iconsets/newlook/filesystem/git.svg diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/hfile-vcs-staged.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/hfile-vcs-staged.svg new file mode 100644 index 00000000..2852d6d2 --- /dev/null +++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/hfile-vcs-staged.svg @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/projectfile-vcs-staged.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/projectfile-vcs-staged.svg new file mode 100644 index 00000000..d099b25d --- /dev/null +++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/projectfile-vcs-staged.svg @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/settingsdialog/toolsgitwidget.cpp b/RedPandaIDE/settingsdialog/toolsgitwidget.cpp index 0f24384f..780ff259 100644 --- a/RedPandaIDE/settingsdialog/toolsgitwidget.cpp +++ b/RedPandaIDE/settingsdialog/toolsgitwidget.cpp @@ -28,6 +28,7 @@ void ToolsGitWidget::doLoad() void ToolsGitWidget::doSave() { pSettings->vcs().setGitPath(ui->txtGitPath->text()); + pSettings->vcs().save(); } void ToolsGitWidget::updateIcons(const QSize &size) diff --git a/RedPandaIDE/vcs/gitmanager.cpp b/RedPandaIDE/vcs/gitmanager.cpp index 02ea4f29..9454887e 100644 --- a/RedPandaIDE/vcs/gitmanager.cpp +++ b/RedPandaIDE/vcs/gitmanager.cpp @@ -1,34 +1,74 @@ #include "gitmanager.h" #include "../utils.h" +#include "../settings.h" #include -GitManager::GitManager(QObject *parent) : QObject(parent), - mGitPathValid(false) +GitManager::GitManager(QObject *parent) : QObject(parent) { } -bool GitManager::gitPathValid() const -{ - return mGitPathValid; -} - void GitManager::createRepository(const QString &folder) { - if (hasRepository(folder)) + QString currentBranch; + if (hasRepository(folder,currentBranch)) throw GitError(tr("Folder \"%1\" already has a repository!")); QStringList args; args.append("init"); runGit(folder,args); } -bool GitManager::hasRepository(const QString &folder) +bool GitManager::hasRepository(const QString &folder, QString& currentBranch) { QStringList args; args.append("status"); + args.append("-b"); + args.append("-u"); + args.append("no"); + args.append("--ignored=no"); QString output = runGit(folder,args); - return !output.startsWith("fatal:"); + bool result = output.startsWith("On branch"); + if (result) { + int pos = QString("On branch").length(); + while (posvcs().gitPath()); if (!fileInfo.exists()) - throw GitError("fatal: git doesn't exist"); + return "fatal: git doesn't exist"; emit gitCmdRunning(QString("Running in \"%1\": \n \"%2\" \"%3\"") .arg(workingFolder, - mGitPath, + pSettings->vcs().gitPath(), args.join("\" \""))); QString output = runAndGetOutput( fileInfo.absoluteFilePath(), workingFolder, args); emit gitCmdFinished(output); - if (output.startsWith("fatal:")) - throw GitError(output); +// if (output.startsWith("fatal:")) +// throw GitError(output); return output; } diff --git a/RedPandaIDE/vcs/gitmanager.h b/RedPandaIDE/vcs/gitmanager.h index 7a4ebf28..05373d9f 100644 --- a/RedPandaIDE/vcs/gitmanager.h +++ b/RedPandaIDE/vcs/gitmanager.h @@ -2,6 +2,7 @@ #define GITMANAGER_H #include +#include #include "utils.h" #include "gitrepository.h" @@ -17,9 +18,12 @@ public: explicit GitManager(QObject *parent = nullptr); - bool gitPathValid() const; void createRepository(const QString& folder); - bool hasRepository(const QString& folder); + bool hasRepository(const QString& folder, QString& currentBranch); + + bool isFileInRepository(const QFileInfo& fileInfo); + bool isFileInStaged(const QFileInfo& fileInfo); + bool isFileChanged(const QFileInfo& fileInfo); void add(const QString& folder, const QString& path); void remove(const QString& folder, const QString& path); @@ -36,11 +40,8 @@ signals: void gitCmdRunning(const QString& gitCmd); void gitCmdFinished(const QString& message); private: - void validate(); QString runGit(const QString& workingFolder, const QStringList& args); private: - QString mGitPath; - bool mGitPathValid; }; #endif // GITMANAGER_H diff --git a/RedPandaIDE/vcs/gitrepository.cpp b/RedPandaIDE/vcs/gitrepository.cpp index 40c86e4d..3134c764 100644 --- a/RedPandaIDE/vcs/gitrepository.cpp +++ b/RedPandaIDE/vcs/gitrepository.cpp @@ -19,9 +19,9 @@ void GitRepository::createRepository() mManager->createRepository(mFolder); } -bool GitRepository::hasRepository() +bool GitRepository::hasRepository(QString& currentBranch) { - return mManager->hasRepository(mFolder); + return mManager->hasRepository(mFolder, currentBranch); } void GitRepository::add(const QString &path) @@ -82,3 +82,8 @@ void GitRepository::setManager(GitManager *newManager) Q_ASSERT(newManager!=nullptr); mManager = newManager; } + +void GitRepository::setFolder(const QString &newFolder) +{ + mFolder = newFolder; +} diff --git a/RedPandaIDE/vcs/gitrepository.h b/RedPandaIDE/vcs/gitrepository.h index 4710e337..96cf84ab 100644 --- a/RedPandaIDE/vcs/gitrepository.h +++ b/RedPandaIDE/vcs/gitrepository.h @@ -22,7 +22,7 @@ public: const QString &folder() const; void createRepository(); - bool hasRepository(); + bool hasRepository(QString& currentBranch); void add(const QString& path); void remove(const QString& path); @@ -38,6 +38,8 @@ public: GitManager *manager() const; void setManager(GitManager *newManager); + void setFolder(const QString &newFolder); + signals: private: QString mFolder;