From 2ad1efd876faebb1fe46b89d5b3aa15eef107440 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 6 Jul 2015 14:56:19 +0300 Subject: [PATCH] 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 Reviewed-by: Tobias Hunger --- src/plugins/diffeditor/diffeditorcontroller.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/diffeditor/diffeditorcontroller.cpp b/src/plugins/diffeditor/diffeditorcontroller.cpp index 18dd6017958..3ed6033315d 100644 --- a/src/plugins/diffeditor/diffeditorcontroller.cpp +++ b/src/plugins/diffeditor/diffeditorcontroller.cpp @@ -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(""); + else + branches += res.join(QLatin1String(", ")) + moreBranches; return branches; }