clang-format

This commit is contained in:
Yann Salmon 2023-08-07 12:34:26 +02:00 committed by Martin Marmsoler
parent f53493a7e6
commit c985a5d1ce
3 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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);