From 4ae6c2a89bf9ba5c589a3e1b4d61e99a8acba4fc Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 23 Sep 2019 18:12:24 +0300 Subject: [PATCH] Git: Fix log for repo/project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Broke by ad6968f45f5c04d0f0cb3b7bae74f985b55bd353. Change-Id: I06ff8384a088f6d9137b9711f855efa8d6bf4a74 Reviewed-by: André Hartmann Reviewed-by: Eike Ziller --- src/plugins/git/gitclient.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 74124a65f00..a6bf59df630 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -612,7 +612,7 @@ class GitLogArgumentsWidget : public BaseGitDiffArgumentsWidget Q_OBJECT public: - GitLogArgumentsWidget(VcsBaseClientSettings &settings, QToolBar *toolBar = nullptr) : + GitLogArgumentsWidget(VcsBaseClientSettings &settings, bool fileRelated, QToolBar *toolBar) : BaseGitDiffArgumentsWidget(settings, toolBar) { QAction *diffButton = addToggleButton("--patch", tr("Show Diff"), @@ -635,9 +635,12 @@ public: tr("Show textual graph log.")); mapSetting(graphButton, settings.boolPointer(GitSettings::graphLogKey)); - QAction *followButton = addToggleButton("--follow", tr("Follow"), - tr("Show log also for previous names of the file.")); - mapSetting(followButton, settings.boolPointer(GitSettings::followRenamesKey)); + if (fileRelated) { + QAction *followButton = addToggleButton( + "--follow", tr("Follow"), + tr("Show log also for previous names of the file.")); + mapSetting(followButton, settings.boolPointer(GitSettings::followRenamesKey)); + } addButton(tr("Reload"), Utils::Icons::RELOAD.icon()); } @@ -1019,7 +1022,7 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName, codecFor(CodecLogOutput), "logTitle", msgArg); VcsBaseEditorConfig *argWidget = editor->editorConfig(); if (!argWidget) { - argWidget = new GitLogArgumentsWidget(settings(), editor->toolBar()); + argWidget = new GitLogArgumentsWidget(settings(), !fileName.isEmpty(), editor->toolBar()); argWidget->setBaseArguments(args); connect(argWidget, &VcsBaseEditorConfig::commandExecutionRequested, this, [=]() { this->log(workingDir, fileName, enableAnnotationContextMenu, args); });