From 5b9f6d9c33071ca5ca3b65468233264d89d4182b Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Fri, 1 Nov 2024 11:15:39 +0100 Subject: [PATCH] Git: Fix Instant Blame not working after first editor open For the very first opened editor, we were unable to get a workingDirectory with currentState().currentFileTopLevel() within the lambda setupBlameForEditor(). The workingDirectory was always empty and therefore Instant Blame only worked after a force or editor change. This and also some still failing ClearCase auto tests were broken by ce9826ae6e727e344c13762eb92e1882768f4a2d. Change-Id: I06239351274cf3aa01be66bc614ec8991274b4a6 Reviewed-by: Orgad Shaneh Reviewed-by: Eike Ziller --- src/plugins/vcsbase/vcsbaseplugin.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index 631eb0f248f..559583db006 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -309,10 +309,13 @@ void StateListener::slotStateChanged() state.clearPatchFile(); // Need a repository to patch qCDebug(stateLog).noquote() << "VC:" << (vc ? vc->displayName() : QString("None")) << state; - QTimer::singleShot(500, this, [this, state, vc] { + + auto updateState = [this, state, vc] { EditorManager::updateWindowTitles(); emit stateChanged(state, vc); - }); + }; + updateState(); + QTimer::singleShot(500, this, updateState); // QTCREATORBUG-31815 } } // namespace Internal