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 ce9826ae6e.

Change-Id: I06239351274cf3aa01be66bc614ec8991274b4a6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Andre Hartmann
2024-11-01 11:15:39 +01:00
committed by André Hartmann
parent 0ad4bafa04
commit 5b9f6d9c33

View File

@@ -309,10 +309,13 @@ void StateListener::slotStateChanged()
state.clearPatchFile(); // Need a repository to patch state.clearPatchFile(); // Need a repository to patch
qCDebug(stateLog).noquote() << "VC:" << (vc ? vc->displayName() : QString("None")) << state; qCDebug(stateLog).noquote() << "VC:" << (vc ? vc->displayName() : QString("None")) << state;
QTimer::singleShot(500, this, [this, state, vc] {
auto updateState = [this, state, vc] {
EditorManager::updateWindowTitles(); EditorManager::updateWindowTitles();
emit stateChanged(state, vc); emit stateChanged(state, vc);
}); };
updateState();
QTimer::singleShot(500, this, updateState); // QTCREATORBUG-31815
} }
} // namespace Internal } // namespace Internal