mirror of
https://github.com/Murmele/Gittyup.git
synced 2024-09-17 13:37:18 +03:00
clang-format
This commit is contained in:
parent
f53493a7e6
commit
c985a5d1ce
@ -57,7 +57,7 @@ void RecentRepositories::add(QString gitpath) {
|
||||
RecentRepository *repo = new RecentRepository(gitpath, this);
|
||||
auto it = std::remove_if(mRepos.begin(), end, [repo](RecentRepository *rhs) {
|
||||
#ifdef Q_OS_WIN
|
||||
return repo-gitpath().compare(rhs->gitpath(), Qt::CaseInsensitive) == 0;
|
||||
return repo - gitpath().compare(rhs->gitpath(), Qt::CaseInsensitive) == 0;
|
||||
#else
|
||||
return (repo->gitpath() == rhs->gitpath());
|
||||
#endif
|
||||
|
@ -16,7 +16,7 @@ QString RecentRepository::gitpath() const { return mPath; }
|
||||
|
||||
QString RecentRepository::name() const {
|
||||
if (mPath.endsWith("/.git"))
|
||||
return mPath.section('/', -mSections-1, -2);
|
||||
return mPath.section('/', -mSections - 1, -2);
|
||||
else
|
||||
return mPath.section('/', -mSections, -1);
|
||||
}
|
||||
|
@ -52,7 +52,10 @@ class TabName {
|
||||
public:
|
||||
TabName(const QString &path) : mPath(path) {}
|
||||
|
||||
QString name() const { return mPath.endsWith("/.git") ? mPath.section('/', -mSections-1,-2) : mPath.section('/', -mSections); }
|
||||
QString name() const {
|
||||
return mPath.endsWith("/.git") ? mPath.section('/', -mSections - 1, -2)
|
||||
: mPath.section('/', -mSections);
|
||||
}
|
||||
|
||||
void increment() { ++mSections; }
|
||||
int sections() const { return mSections; }
|
||||
@ -257,7 +260,8 @@ RepoView *MainWindow::addTab(const git::Repository &repo) {
|
||||
|
||||
emit tabs->tabAboutToBeInserted();
|
||||
|
||||
// NB : this seems to be useless, because overwritten by MainWindow::updateTabNames
|
||||
// NB : this seems to be useless, because overwritten by
|
||||
// MainWindow::updateTabNames
|
||||
QString tabTitle = dir.dirName();
|
||||
if (tabTitle == ".git")
|
||||
tabTitle = dir.path().section("/", -2, -2);
|
||||
|
Loading…
Reference in New Issue
Block a user