forked from qt-creator/qt-creator
Perforce: Some more direct FilePath use
Change-Id: I78e28714fef577a9129e39b03273f3651de8adcc Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -1199,9 +1199,10 @@ QString PerforcePluginPrivate::vcsMakeWritableText() const
|
|||||||
|
|
||||||
// Run messages
|
// 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)
|
static QString msgTimeout(int timeOutS)
|
||||||
@@ -1251,7 +1252,7 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki
|
|||||||
process.setStdOutCallback([](const QString &lines) { VcsOutputWindow::append(lines); });
|
process.setStdOutCallback([](const QString &lines) { VcsOutputWindow::append(lines); });
|
||||||
}
|
}
|
||||||
process.setTimeOutMessageBoxEnabled(true);
|
process.setTimeOutMessageBoxEnabled(true);
|
||||||
process.setCommand({m_settings.p4BinaryPath.filePath(), args});
|
process.setCommand({m_settings.p4BinaryPath(), args});
|
||||||
process.runBlocking(EventLoopMode::On);
|
process.runBlocking(EventLoopMode::On);
|
||||||
|
|
||||||
PerforceResponse response;
|
PerforceResponse response;
|
||||||
@@ -1271,7 +1272,7 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki
|
|||||||
response.message = msgCrash();
|
response.message = msgCrash();
|
||||||
break;
|
break;
|
||||||
case ProcessResult::StartFailed:
|
case ProcessResult::StartFailed:
|
||||||
response.message = msgNotStarted(m_settings.p4BinaryPath.value());
|
response.message = msgNotStarted(m_settings.p4BinaryPath());
|
||||||
break;
|
break;
|
||||||
case ProcessResult::Hang:
|
case ProcessResult::Hang:
|
||||||
response.message = msgCrash();
|
response.message = msgCrash();
|
||||||
@@ -1295,13 +1296,13 @@ PerforceResponse PerforcePluginPrivate::fullySynchronousProcess(const FilePath &
|
|||||||
process.setWorkingDirectory(workingDir);
|
process.setWorkingDirectory(workingDir);
|
||||||
|
|
||||||
PerforceResponse response;
|
PerforceResponse response;
|
||||||
process.setCommand({m_settings.p4BinaryPath.filePath(), args});
|
process.setCommand({m_settings.p4BinaryPath(), args});
|
||||||
process.setWriteData(stdInput);
|
process.setWriteData(stdInput);
|
||||||
process.start();
|
process.start();
|
||||||
|
|
||||||
if (!process.waitForStarted(3000)) {
|
if (!process.waitForStarted(3000)) {
|
||||||
response.error = true;
|
response.error = true;
|
||||||
response.message = msgNotStarted(m_settings.p4BinaryPath.value());
|
response.message = msgNotStarted(m_settings.p4BinaryPath());
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1364,7 +1365,7 @@ PerforceResponse PerforcePluginPrivate::runP4Cmd(const FilePath &workingDir,
|
|||||||
actualArgs.append(args);
|
actualArgs.append(args);
|
||||||
|
|
||||||
if (flags & CommandToWindow)
|
if (flags & CommandToWindow)
|
||||||
VcsOutputWindow::appendCommand(workingDir, {m_settings.p4BinaryPath.filePath(), actualArgs});
|
VcsOutputWindow::appendCommand(workingDir, {m_settings.p4BinaryPath(), actualArgs});
|
||||||
|
|
||||||
if (flags & ShowBusyCursor)
|
if (flags & ShowBusyCursor)
|
||||||
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
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, dd, &PerforcePluginPrivate::setTopLevel);
|
||||||
connect(checker, &PerforceChecker::succeeded,checker, &QObject::deleteLater);
|
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);
|
m_settings.commonP4Arguments(QString()), 30000);
|
||||||
|
|
||||||
if (isSync)
|
if (isSync)
|
||||||
|
Reference in New Issue
Block a user