Git: Cleanup gitExecutable()

Using expected removes a bunch of handling code.

Change-Id: Id524912d82aa693fbb39c7e7fa34abd77153f92e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Marcus Tillmanns
2024-02-08 11:21:32 +01:00
parent 31ca46ef2f
commit 70e013fd25
4 changed files with 9 additions and 24 deletions

View File

@@ -409,11 +409,9 @@ void GitPluginPrivate::onApplySettings()
{
emit configurationChanged();
updateRepositoryBrowserAction();
bool gitFoundOk;
QString errorMessage;
settings().gitExecutable(&gitFoundOk, &errorMessage);
if (!gitFoundOk) {
QTimer::singleShot(0, this, [errorMessage] {
const expected_str<FilePath> result = settings().gitExecutable();
if (!result) {
QTimer::singleShot(0, this, [errorMessage = result.error()] {
AsynchronousMessageBox::warning(Tr::tr("Git Settings"), errorMessage);
});
}