diff --git a/src/conf/RecentRepositories.cpp b/src/conf/RecentRepositories.cpp index bdd6b3204..303e96a0d 100644 --- a/src/conf/RecentRepositories.cpp +++ b/src/conf/RecentRepositories.cpp @@ -51,7 +51,8 @@ void RecentRepositories::remove(int index) { } /*! - * gitpath: path to the git repository, does not neccesarly need to be the workdir + * gitpath: path to the git repository, does not neccesarly need to be the + * workdir */ void RecentRepositories::add(QString gitpath) { emit repositoryAboutToBeAdded(); diff --git a/src/conf/RecentRepository.cpp b/src/conf/RecentRepository.cpp index e0be57b18..635fea058 100644 --- a/src/conf/RecentRepository.cpp +++ b/src/conf/RecentRepository.cpp @@ -10,15 +10,17 @@ #include "RecentRepository.h" RecentRepository::RecentRepository(const QString &gitpath, QObject *parent) - : QObject(parent), mPath(gitpath) {} + : QObject(parent), mGitPath(gitpath) {} -QString RecentRepository::gitpath() const { return mPath; } +QString RecentRepository::gitpath() const { return mGitPath; } QString RecentRepository::name() const { - if (mPath.endsWith("/.git")) - return mPath.section('/', -mSections - 1, -2); + QString name; + if (mGitPath.endsWith("/.git")) + name = mGitPath.section('/', -mSections - 1, -2); else - return mPath.section('/', -mSections, -1); + name = mGitPath.section('/', -mSections, -1); + return name; } void RecentRepository::increment() { ++mSections; } diff --git a/src/conf/RecentRepository.h b/src/conf/RecentRepository.h index 35796765f..2b48264d0 100644 --- a/src/conf/RecentRepository.h +++ b/src/conf/RecentRepository.h @@ -24,7 +24,7 @@ class RecentRepository : public QObject { private: void increment(); - QString mPath; + QString mGitPath; int mSections = 1; friend class RecentRepositories;