Git: Hide obsolete branches by default in branches dialog

Task-number: QTCREATORBUG-15544
Change-Id: I411c7eacd2c154cad08234c0bd22e16dfecb961c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2016-03-09 23:21:57 +02:00
committed by Orgad Shaneh
parent de127b1f5c
commit 5834769cbf
6 changed files with 80 additions and 49 deletions

View File

@@ -29,6 +29,7 @@
#include "../gitplugin.h"
#include "../gitclient.h"
#include "../gitconstants.h"
#include <QDateTime>
#include <QDir>
@@ -235,7 +236,7 @@ void GerritPushDialog::setRemoteBranches(bool includeOld)
foreach (const BranchDate &bd, m_remoteBranches.values(remoteName)) {
const bool isSuggested = bd.first == m_suggestedRemoteBranch;
if (includeOld || isSuggested || !bd.second.isValid()
|| bd.second.daysTo(QDate::currentDate()) <= 60) {
|| bd.second.daysTo(QDate::currentDate()) <= Git::Constants::OBSOLETE_COMMIT_AGE_IN_DAYS) {
m_ui->targetBranchComboBox->addItem(bd.first);
if (isSuggested)
m_ui->targetBranchComboBox->setCurrentIndex(i);