mirror of
https://github.com/Murmele/Gittyup.git
synced 2024-09-17 13:37:18 +03:00
use also as variable name mGitPath
This commit is contained in:
parent
9edf99fbed
commit
8374baad73
@ -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();
|
||||
|
@ -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; }
|
||||
|
@ -24,7 +24,7 @@ public:
|
||||
private:
|
||||
void increment();
|
||||
|
||||
QString mPath;
|
||||
QString mGitPath;
|
||||
int mSections = 1;
|
||||
|
||||
friend class RecentRepositories;
|
||||
|
Loading…
Reference in New Issue
Block a user