From 569e73c5edfe07a471b8889bf7c106e5f1dfe2cc Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jun 2023 18:18:04 +0200 Subject: [PATCH] Perforce: Some more direct FilePath use Change-Id: I78e28714fef577a9129e39b03273f3651de8adcc Reviewed-by: Orgad Shaneh --- src/plugins/perforce/perforceplugin.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index ae61d12d342..82ee2f43d4d 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -1199,9 +1199,10 @@ QString PerforcePluginPrivate::vcsMakeWritableText() const // Run messages -static QString msgNotStarted(const QString &cmd) +static QString msgNotStarted(const FilePath &cmd) { - return Tr::tr("Could not start perforce \"%1\". Please check your settings in the preferences.").arg(cmd); + return Tr::tr("Could not start perforce \"%1\". Please check your settings in the preferences.") + .arg(cmd.toUserOutput()); } static QString msgTimeout(int timeOutS) @@ -1251,7 +1252,7 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki process.setStdOutCallback([](const QString &lines) { VcsOutputWindow::append(lines); }); } process.setTimeOutMessageBoxEnabled(true); - process.setCommand({m_settings.p4BinaryPath.filePath(), args}); + process.setCommand({m_settings.p4BinaryPath(), args}); process.runBlocking(EventLoopMode::On); PerforceResponse response; @@ -1271,7 +1272,7 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki response.message = msgCrash(); break; case ProcessResult::StartFailed: - response.message = msgNotStarted(m_settings.p4BinaryPath.value()); + response.message = msgNotStarted(m_settings.p4BinaryPath()); break; case ProcessResult::Hang: response.message = msgCrash(); @@ -1295,13 +1296,13 @@ PerforceResponse PerforcePluginPrivate::fullySynchronousProcess(const FilePath & process.setWorkingDirectory(workingDir); PerforceResponse response; - process.setCommand({m_settings.p4BinaryPath.filePath(), args}); + process.setCommand({m_settings.p4BinaryPath(), args}); process.setWriteData(stdInput); process.start(); if (!process.waitForStarted(3000)) { response.error = true; - response.message = msgNotStarted(m_settings.p4BinaryPath.value()); + response.message = msgNotStarted(m_settings.p4BinaryPath()); return response; } @@ -1364,7 +1365,7 @@ PerforceResponse PerforcePluginPrivate::runP4Cmd(const FilePath &workingDir, actualArgs.append(args); if (flags & CommandToWindow) - VcsOutputWindow::appendCommand(workingDir, {m_settings.p4BinaryPath.filePath(), actualArgs}); + VcsOutputWindow::appendCommand(workingDir, {m_settings.p4BinaryPath(), actualArgs}); if (flags & ShowBusyCursor) QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); @@ -1699,7 +1700,7 @@ void PerforcePluginPrivate::getTopLevel(const FilePath &workingDirectory, bool i connect(checker, &PerforceChecker::succeeded, dd, &PerforcePluginPrivate::setTopLevel); connect(checker, &PerforceChecker::succeeded,checker, &QObject::deleteLater); - checker->start(m_settings.p4BinaryPath.filePath(), workingDirectory, + checker->start(m_settings.p4BinaryPath(), workingDirectory, m_settings.commonP4Arguments(QString()), 30000); if (isSync)