DiffEditor: Do not leave a blank line when there are no branches

After expanding branches, notify the user in case there are none.

Change-Id: Id8a8d18933394208f8823c55124189ab37be4153
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-07-06 14:56:19 +03:00
committed by Orgad Shaneh
parent 58aa93249c
commit 2ad1efd876

View File

@@ -147,8 +147,11 @@ QString DiffEditorController::prepareBranchesForCommit(const QString &output)
moreBranches = QLatin1Char(' ') + tr("and %n more", 0, branchCount - leave);
res.erase(res.begin() + leave, res.end());
}
if (!res.isEmpty())
branches = (QLatin1String("Branches: ") + res.join(QLatin1String(", ")) + moreBranches);
branches = QLatin1String("Branches: ");
if (res.isEmpty())
branches += tr("<None>");
else
branches += res.join(QLatin1String(", ")) + moreBranches;
return branches;
}