forked from qt-creator/qt-creator
QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h. Move ExitCodeInterpreter into processenums.h. Remove superfluous Utils:: prefix. Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -422,7 +422,7 @@ QString PluginManager::systemInformation()
|
||||
QtcProcess qtDiagProc;
|
||||
qtDiagProc.setCommand(qtDiag);
|
||||
qtDiagProc.runBlocking();
|
||||
if (qtDiagProc.result() == QtcProcess::FinishedWithSuccess)
|
||||
if (qtDiagProc.result() == ProcessResult::FinishedWithSuccess)
|
||||
result += qtDiagProc.allOutput() + "\n";
|
||||
result += "Plugin information:\n\n";
|
||||
auto longestSpec = std::max_element(d->pluginSpecs.cbegin(), d->pluginSpecs.cend(),
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QHash>
|
||||
|
||||
@@ -36,7 +34,10 @@ QT_BEGIN_NAMESPACE
|
||||
class QDir;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils { class FileSystemWatcher; }
|
||||
namespace Utils {
|
||||
class FileSystemWatcher;
|
||||
class QtcProcess;
|
||||
}
|
||||
|
||||
namespace QmlJS {
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ Archive *Archive::unarchive(const FilePath &src, const FilePath &dest)
|
||||
[archive] {
|
||||
if (!archive->m_process)
|
||||
return;
|
||||
emit archive->finished(archive->m_process->result() == QtcProcess::FinishedWithSuccess);
|
||||
emit archive->finished(archive->m_process->result() == ProcessResult::FinishedWithSuccess);
|
||||
archive->m_process->deleteLater();
|
||||
archive->m_process = nullptr;
|
||||
archive->deleteLater();
|
||||
|
||||
@@ -48,7 +48,7 @@ FilePath BuildableHelperLibrary::qtChooserToQmakePath(const FilePath &qtChooser)
|
||||
proc.setTimeoutS(1);
|
||||
proc.setCommand({qtChooser, {"-print-env"}});
|
||||
proc.runBlocking();
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return {};
|
||||
const QString output = proc.stdOut();
|
||||
int pos = output.indexOf(toolDir);
|
||||
@@ -132,7 +132,7 @@ QString BuildableHelperLibrary::qtVersionForQMake(const FilePath &qmakePath)
|
||||
qmake.setTimeoutS(5);
|
||||
qmake.setCommand({qmakePath, {"--version"}});
|
||||
qmake.runBlocking();
|
||||
if (qmake.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (qmake.result() != ProcessResult::FinishedWithSuccess) {
|
||||
qWarning() << qmake.exitMessage();
|
||||
return QString();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "environment.h"
|
||||
#include "filepath.h"
|
||||
#include "launcherpackets.h"
|
||||
#include "qtcprocess.h"
|
||||
#include "processinterface.h"
|
||||
|
||||
#include <QDeadlineTimer>
|
||||
#include <QHash>
|
||||
|
||||
@@ -153,7 +153,7 @@ QString BinaryVersionToolTipEventFilter::toolVersion(const CommandLine &cmd)
|
||||
proc.setTimeoutS(1);
|
||||
proc.setCommand(cmd);
|
||||
proc.runBlocking();
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return QString();
|
||||
return proc.allOutput();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QMetaType>
|
||||
#include <functional>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
@@ -50,6 +51,32 @@ enum class TerminalMode {
|
||||
On = Run // Default mode for terminal set to on
|
||||
};
|
||||
|
||||
// Miscellaneous, not process core
|
||||
|
||||
enum class EventLoopMode {
|
||||
Off,
|
||||
On // Avoid
|
||||
};
|
||||
|
||||
enum class ProcessResult {
|
||||
// Finished successfully. Unless an ExitCodeInterpreter is set
|
||||
// this corresponds to a return code 0.
|
||||
FinishedWithSuccess,
|
||||
Finished = FinishedWithSuccess, // FIXME: Kept to ease downstream transition
|
||||
// Finished unsuccessfully. Unless an ExitCodeInterpreter is set
|
||||
// this corresponds to a return code different from 0.
|
||||
FinishedWithError,
|
||||
FinishedError = FinishedWithError, // FIXME: Kept to ease downstream transition
|
||||
// Process terminated abnormally (kill)
|
||||
TerminatedAbnormally,
|
||||
// Executable could not be started
|
||||
StartFailed,
|
||||
// Hang, no output after time out
|
||||
Hang
|
||||
};
|
||||
|
||||
using ExitCodeInterpreter = std::function<ProcessResult(int /*exitCode*/)>;
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
Q_DECLARE_METATYPE(Utils::ProcessMode);
|
||||
|
||||
@@ -293,7 +293,7 @@ static QString blockingMessage(const QVariant &variant)
|
||||
{
|
||||
if (!variant.isValid())
|
||||
return "non blocking";
|
||||
if (variant.toInt() == int(QtcProcess::WithEventLoop))
|
||||
if (variant.toInt() == int(EventLoopMode::On))
|
||||
return "blocking with event loop";
|
||||
return "blocking without event loop";
|
||||
}
|
||||
@@ -646,11 +646,11 @@ public:
|
||||
void handleError(QProcess::ProcessError error);
|
||||
void clearForRun();
|
||||
|
||||
QtcProcess::Result interpretExitCode(int exitCode);
|
||||
ProcessResult interpretExitCode(int exitCode);
|
||||
|
||||
QTextCodec *m_codec = QTextCodec::codecForLocale();
|
||||
QEventLoop *m_eventLoop = nullptr;
|
||||
QtcProcess::Result m_result = QtcProcess::StartFailed;
|
||||
ProcessResult m_result = ProcessResult::StartFailed;
|
||||
ChannelBuffer m_stdOut;
|
||||
ChannelBuffer m_stdErr;
|
||||
ExitCodeInterpreter m_exitCodeInterpreter;
|
||||
@@ -669,17 +669,17 @@ void QtcProcessPrivate::clearForRun()
|
||||
m_stdOut.codec = m_codec;
|
||||
m_stdErr.clearForRun();
|
||||
m_stdErr.codec = m_codec;
|
||||
m_result = QtcProcess::StartFailed;
|
||||
m_result = ProcessResult::StartFailed;
|
||||
m_startFailure = NoFailure;
|
||||
}
|
||||
|
||||
QtcProcess::Result QtcProcessPrivate::interpretExitCode(int exitCode)
|
||||
ProcessResult QtcProcessPrivate::interpretExitCode(int exitCode)
|
||||
{
|
||||
if (m_exitCodeInterpreter)
|
||||
return m_exitCodeInterpreter(exitCode);
|
||||
|
||||
// default:
|
||||
return exitCode ? QtcProcess::FinishedWithError : QtcProcess::FinishedWithSuccess;
|
||||
return exitCode ? ProcessResult::FinishedWithError : ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
} // Internal
|
||||
@@ -732,7 +732,7 @@ QtcProcess::QtcProcess(QObject *parent)
|
||||
|
||||
const int number = n.toInt();
|
||||
qCDebug(processLog).nospace() << "Process " << number << " finished: "
|
||||
<< "result=" << result()
|
||||
<< "result=" << int(result())
|
||||
<< ", ex=" << exitCode()
|
||||
<< ", " << stdOut().size() << " bytes stdout"
|
||||
<< ", " << stdErr().size() << " bytes stderr"
|
||||
@@ -1119,12 +1119,12 @@ QString QtcProcess::normalizeNewlines(const QString &text)
|
||||
return res;
|
||||
}
|
||||
|
||||
QtcProcess::Result QtcProcess::result() const
|
||||
ProcessResult QtcProcess::result() const
|
||||
{
|
||||
return d->m_result;
|
||||
}
|
||||
|
||||
void QtcProcess::setResult(Result result)
|
||||
void QtcProcess::setResult(const ProcessResult &result)
|
||||
{
|
||||
d->m_result = result;
|
||||
}
|
||||
@@ -1411,16 +1411,16 @@ QString QtcProcess::exitMessage()
|
||||
{
|
||||
const QString fullCmd = commandLine().toUserOutput();
|
||||
switch (result()) {
|
||||
case FinishedWithSuccess:
|
||||
case ProcessResult::FinishedWithSuccess:
|
||||
return QtcProcess::tr("The command \"%1\" finished successfully.").arg(fullCmd);
|
||||
case FinishedWithError:
|
||||
case ProcessResult::FinishedWithError:
|
||||
return QtcProcess::tr("The command \"%1\" terminated with exit code %2.")
|
||||
.arg(fullCmd).arg(exitCode());
|
||||
case TerminatedAbnormally:
|
||||
case ProcessResult::TerminatedAbnormally:
|
||||
return QtcProcess::tr("The command \"%1\" terminated abnormally.").arg(fullCmd);
|
||||
case StartFailed:
|
||||
case ProcessResult::StartFailed:
|
||||
return QtcProcess::tr("The command \"%1\" could not be started.").arg(fullCmd);
|
||||
case Hang:
|
||||
case ProcessResult::Hang:
|
||||
return QtcProcess::tr("The command \"%1\" did not respond within the timeout limit (%2 s).")
|
||||
.arg(fullCmd).arg(d->m_maxHangTimerCount);
|
||||
}
|
||||
@@ -1484,7 +1484,7 @@ QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const QtcProcess &r)
|
||||
{
|
||||
QDebug nsp = str.nospace();
|
||||
nsp << "QtcProcess: result="
|
||||
<< r.d->m_result << " ex=" << r.exitCode() << '\n'
|
||||
<< int(r.d->m_result) << " ex=" << r.exitCode() << '\n'
|
||||
<< r.d->m_stdOut.rawData.size() << " bytes stdout, stderr=" << r.d->m_stdErr.rawData << '\n';
|
||||
return str;
|
||||
}
|
||||
@@ -1595,7 +1595,7 @@ static bool isGuiThread()
|
||||
}
|
||||
#endif
|
||||
|
||||
void QtcProcess::runBlocking(QtcProcess::EventLoopMode eventLoopMode)
|
||||
void QtcProcess::runBlocking(EventLoopMode eventLoopMode)
|
||||
{
|
||||
// FIXME: Implement properly
|
||||
|
||||
@@ -1615,7 +1615,7 @@ void QtcProcess::runBlocking(QtcProcess::EventLoopMode eventLoopMode)
|
||||
// Remove the dynamic property so that it's not reused in subseqent start()
|
||||
setProperty(QTC_PROCESS_BLOCKING_TYPE, QVariant());
|
||||
}
|
||||
if (eventLoopMode == QtcProcess::WithEventLoop) {
|
||||
if (eventLoopMode == EventLoopMode::On) {
|
||||
// On Windows, start failure is triggered immediately if the
|
||||
// executable cannot be found in the path. Do not start the
|
||||
// event loop in that case.
|
||||
@@ -1644,11 +1644,11 @@ void QtcProcess::runBlocking(QtcProcess::EventLoopMode eventLoopMode)
|
||||
}
|
||||
} else {
|
||||
if (!waitForStarted(d->m_maxHangTimerCount * 1000)) {
|
||||
d->m_result = QtcProcess::StartFailed;
|
||||
d->m_result = ProcessResult::StartFailed;
|
||||
return;
|
||||
}
|
||||
if (!waitForFinished(d->m_maxHangTimerCount * 1000)) {
|
||||
d->m_result = QtcProcess::Hang;
|
||||
d->m_result = ProcessResult::Hang;
|
||||
terminate();
|
||||
if (!waitForFinished(1000)) {
|
||||
kill();
|
||||
@@ -1701,7 +1701,7 @@ void QtcProcessPrivate::slotTimeout()
|
||||
m_waitingForUser = false;
|
||||
if (terminate) {
|
||||
q->stopProcess();
|
||||
m_result = QtcProcess::Hang;
|
||||
m_result = ProcessResult::Hang;
|
||||
} else {
|
||||
m_hangTimerCount = 0;
|
||||
}
|
||||
@@ -1725,8 +1725,8 @@ void QtcProcessPrivate::slotFinished()
|
||||
break;
|
||||
case QProcess::CrashExit:
|
||||
// Was hang detected before and killed?
|
||||
if (m_result != QtcProcess::Hang)
|
||||
m_result = QtcProcess::TerminatedAbnormally;
|
||||
if (m_result != ProcessResult::Hang)
|
||||
m_result = ProcessResult::TerminatedAbnormally;
|
||||
break;
|
||||
}
|
||||
if (m_eventLoop)
|
||||
@@ -1744,8 +1744,8 @@ void QtcProcessPrivate::handleError(QProcess::ProcessError error)
|
||||
if (debug)
|
||||
qDebug() << Q_FUNC_INFO << error;
|
||||
// Was hang detected before and killed?
|
||||
if (m_result != QtcProcess::Hang)
|
||||
m_result = QtcProcess::StartFailed;
|
||||
if (m_result != ProcessResult::Hang)
|
||||
m_result = ProcessResult::StartFailed;
|
||||
m_startFailure = (error == QProcess::FailedToStart) ? WrongCommandFailure : OtherFailure;
|
||||
if (m_eventLoop)
|
||||
m_eventLoop->quit();
|
||||
|
||||
@@ -35,8 +35,6 @@
|
||||
|
||||
#include <QProcess>
|
||||
|
||||
#include <functional>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QDebug)
|
||||
QT_FORWARD_DECLARE_CLASS(QTextCodec)
|
||||
|
||||
@@ -153,31 +151,9 @@ public:
|
||||
static bool startDetached(const CommandLine &cmd, const FilePath &workingDirectory = {},
|
||||
qint64 *pid = nullptr);
|
||||
|
||||
enum EventLoopMode {
|
||||
NoEventLoop,
|
||||
WithEventLoop // Avoid
|
||||
};
|
||||
|
||||
enum Result {
|
||||
// Finished successfully. Unless an ExitCodeInterpreter is set
|
||||
// this corresponds to a return code 0.
|
||||
FinishedWithSuccess,
|
||||
Finished = FinishedWithSuccess, // FIXME: Kept to ease downstream transition
|
||||
// Finished unsuccessfully. Unless an ExitCodeInterpreter is set
|
||||
// this corresponds to a return code different from 0.
|
||||
FinishedWithError,
|
||||
FinishedError = FinishedWithError, // FIXME: Kept to ease downstream transition
|
||||
// Process terminated abnormally (kill)
|
||||
TerminatedAbnormally,
|
||||
// Executable could not be started
|
||||
StartFailed,
|
||||
// Hang, no output after time out
|
||||
Hang
|
||||
};
|
||||
|
||||
// Starts the command and waits for finish.
|
||||
// User input processing is enabled when WithEventLoop was passed.
|
||||
void runBlocking(EventLoopMode eventLoopMode = NoEventLoop);
|
||||
void runBlocking(EventLoopMode eventLoopMode = EventLoopMode::Off);
|
||||
|
||||
/* Timeout for hanging processes (triggers after no more output
|
||||
* occurs on stderr/stdout). */
|
||||
@@ -186,7 +162,7 @@ public:
|
||||
// TODO: We should specify the purpose of the codec, e.g. setCodecForStandardChannel()
|
||||
void setCodec(QTextCodec *c);
|
||||
void setTimeOutMessageBoxEnabled(bool);
|
||||
void setExitCodeInterpreter(const std::function<QtcProcess::Result(int)> &interpreter);
|
||||
void setExitCodeInterpreter(const ExitCodeInterpreter &interpreter);
|
||||
|
||||
void setStdOutCallback(const std::function<void(const QString &)> &callback);
|
||||
void setStdOutLineCallback(const std::function<void(const QString &)> &callback);
|
||||
@@ -197,8 +173,8 @@ public:
|
||||
bool readDataFromProcess(int timeoutS, QByteArray *stdOut, QByteArray *stdErr,
|
||||
bool showTimeOutMessageBox);
|
||||
|
||||
Result result() const;
|
||||
void setResult(Result result);
|
||||
ProcessResult result() const;
|
||||
void setResult(const ProcessResult &result);
|
||||
|
||||
QByteArray allRawOutput() const;
|
||||
QString allOutput() const;
|
||||
@@ -241,6 +217,4 @@ public:
|
||||
std::function<Environment(const FilePath &)> systemEnvironmentForBinary;
|
||||
};
|
||||
|
||||
using ExitCodeInterpreter = std::function<QtcProcess::Result(int /*exitCode*/)>;
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
#include "environment.h"
|
||||
#include "fileutils.h"
|
||||
#include "qtcassert.h"
|
||||
#include "qtcprocess.h"
|
||||
#include "runextensions.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QFuture>
|
||||
#include <QFutureWatcher>
|
||||
#include <QMutex>
|
||||
#include <QProcess>
|
||||
#include <QProcessEnvironment>
|
||||
#include <QScopedPointer>
|
||||
#include <QSharedPointer>
|
||||
@@ -280,7 +280,7 @@ void ShellCommand::run(QFutureInterface<void> &future)
|
||||
stdOut += proc.stdOut();
|
||||
stdErr += proc.stdErr();
|
||||
d->m_lastExecExitCode = proc.exitCode();
|
||||
d->m_lastExecSuccess = proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
d->m_lastExecSuccess = proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
if (!d->m_lastExecSuccess)
|
||||
break;
|
||||
}
|
||||
@@ -314,7 +314,7 @@ void ShellCommand::runCommand(QtcProcess &proc,
|
||||
const FilePath dir = workDirectory(workingDirectory);
|
||||
|
||||
if (command.executable().isEmpty()) {
|
||||
proc.setResult(QtcProcess::StartFailed);
|
||||
proc.setResult(ProcessResult::StartFailed);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ void ShellCommand::runCommand(QtcProcess &proc,
|
||||
|
||||
if (!d->m_aborted) {
|
||||
// Success/Fail message in appropriate window?
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
if (d->m_flags & ShowSuccessMessage)
|
||||
emit appendMessage(proc.exitMessage());
|
||||
} else if (!(d->m_flags & SuppressFailMessage)) {
|
||||
@@ -416,7 +416,7 @@ void ShellCommand::runSynchronous(QtcProcess &process, const FilePath &workingDi
|
||||
if (d->m_codec)
|
||||
process.setCodec(d->m_codec);
|
||||
|
||||
process.runBlocking(QtcProcess::WithEventLoop);
|
||||
process.runBlocking(EventLoopMode::On);
|
||||
}
|
||||
|
||||
const QVariant &ShellCommand::cookie() const
|
||||
|
||||
@@ -27,7 +27,10 @@
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include "qtcprocess.h"
|
||||
#include "filepath.h"
|
||||
#include "processenums.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QMutex;
|
||||
@@ -36,10 +39,15 @@ template <typename T>
|
||||
class QFutureInterface;
|
||||
template <typename T>
|
||||
class QFuture;
|
||||
class QTextCodec;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class CommandLine;
|
||||
class Environment;
|
||||
class QtcProcess;
|
||||
|
||||
namespace Internal { class ShellCommandPrivate; }
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT ProgressParser
|
||||
|
||||
@@ -66,13 +66,13 @@ const int avdCreateTimeoutMs = 30000;
|
||||
bool AndroidAvdManager::avdManagerCommand(const AndroidConfig &config, const QStringList &args, QString *output)
|
||||
{
|
||||
CommandLine cmd(config.avdManagerToolPath(), args);
|
||||
Utils::QtcProcess proc;
|
||||
QtcProcess proc;
|
||||
Environment env = AndroidConfigurations::toolsEnvironment(config);
|
||||
proc.setEnvironment(env);
|
||||
qCDebug(avdManagerLog) << "Running AVD Manager command:" << cmd.toUserOutput();
|
||||
proc.setCommand(cmd);
|
||||
proc.runBlocking();
|
||||
if (proc.result() == Utils::QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
if (output)
|
||||
*output = proc.allOutput();
|
||||
return true;
|
||||
@@ -196,7 +196,7 @@ AndroidAvdManager::~AndroidAvdManager() = default;
|
||||
|
||||
QFuture<CreateAvdInfo> AndroidAvdManager::createAvd(CreateAvdInfo info) const
|
||||
{
|
||||
return Utils::runAsync(&createAvdCommand, m_config, info);
|
||||
return runAsync(&createAvdCommand, m_config, info);
|
||||
}
|
||||
|
||||
bool AndroidAvdManager::removeAvd(const QString &name) const
|
||||
@@ -208,12 +208,12 @@ bool AndroidAvdManager::removeAvd(const QString &name) const
|
||||
proc.setEnvironment(AndroidConfigurations::toolsEnvironment(m_config));
|
||||
proc.setCommand(command);
|
||||
proc.runBlocking();
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
static void avdConfigEditManufacturerTag(const QString &avdPathStr, bool recoverMode = false)
|
||||
{
|
||||
const Utils::FilePath avdPath = Utils::FilePath::fromString(avdPathStr);
|
||||
const FilePath avdPath = FilePath::fromString(avdPathStr);
|
||||
if (avdPath.exists()) {
|
||||
const QString configFilePath = avdPath.pathAppended("config.ini").toString();
|
||||
QFile configFile(configFilePath);
|
||||
@@ -273,7 +273,7 @@ static AndroidDeviceInfoList listVirtualDevices(const AndroidConfig &config)
|
||||
|
||||
QFuture<AndroidDeviceInfoList> AndroidAvdManager::avdList() const
|
||||
{
|
||||
return Utils::runAsync(listVirtualDevices, m_config);
|
||||
return runAsync(listVirtualDevices, m_config);
|
||||
}
|
||||
|
||||
QString AndroidAvdManager::startAvd(const QString &name) const
|
||||
@@ -356,7 +356,7 @@ bool AndroidAvdManager::isAvdBooted(const QString &device) const
|
||||
adbProc.setTimeoutS(10);
|
||||
adbProc.setCommand(command);
|
||||
adbProc.runBlocking();
|
||||
if (adbProc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (adbProc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return false;
|
||||
QString value = adbProc.allOutput().trimmed();
|
||||
return value == "stopped";
|
||||
|
||||
@@ -1061,8 +1061,8 @@ QAbstractItemModel *AndroidBuildApkStep::keystoreCertificates()
|
||||
QtcProcess keytoolProc;
|
||||
keytoolProc.setTimeoutS(30);
|
||||
keytoolProc.setCommand({AndroidConfigurations::currentConfig().keytoolPath(), params});
|
||||
keytoolProc.runBlocking(QtcProcess::WithEventLoop);
|
||||
if (keytoolProc.result() > QtcProcess::FinishedWithError)
|
||||
keytoolProc.runBlocking(EventLoopMode::On);
|
||||
if (keytoolProc.result() > ProcessResult::FinishedWithError)
|
||||
QMessageBox::critical(nullptr, tr("Error"), tr("Failed to run keytool."));
|
||||
else
|
||||
model = new CertificatesModel(keytoolProc.stdOut(), this);
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace {
|
||||
proc.setTimeoutS(30);
|
||||
proc.setCommand({executable, {shell}});
|
||||
proc.runBlocking();
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return true;
|
||||
return !proc.allOutput().contains("x86-64");
|
||||
}
|
||||
@@ -635,7 +635,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::connectedDevices(QString *error) const
|
||||
CommandLine cmd{adbToolPath(), {"devices"}};
|
||||
adbProc.setCommand(cmd);
|
||||
adbProc.runBlocking();
|
||||
if (adbProc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (adbProc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
if (error)
|
||||
*error = QApplication::translate("AndroidConfiguration", "Could not run: %1")
|
||||
.arg(cmd.toUserOutput());
|
||||
@@ -706,7 +706,7 @@ QString AndroidConfig::getDeviceProperty(const QString &device, const QString &p
|
||||
adbProc.setTimeoutS(10);
|
||||
adbProc.setCommand(cmd);
|
||||
adbProc.runBlocking();
|
||||
if (adbProc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (adbProc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return QString();
|
||||
|
||||
return adbProc.allOutput();
|
||||
@@ -805,7 +805,7 @@ QStringList AndroidConfig::getAbis(const QString &device)
|
||||
adbProc.setTimeoutS(10);
|
||||
adbProc.setCommand({adbTool, arguments});
|
||||
adbProc.runBlocking();
|
||||
if (adbProc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (adbProc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return result;
|
||||
|
||||
QString output = adbProc.allOutput().trimmed();
|
||||
@@ -828,7 +828,7 @@ QStringList AndroidConfig::getAbis(const QString &device)
|
||||
abiProc.setTimeoutS(10);
|
||||
abiProc.setCommand({adbTool, arguments});
|
||||
abiProc.runBlocking();
|
||||
if (abiProc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (abiProc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return result;
|
||||
|
||||
QString abi = abiProc.allOutput().trimmed();
|
||||
|
||||
@@ -208,9 +208,9 @@ void AndroidCreateKeystoreCertificate::buttonBoxAccepted()
|
||||
QtcProcess genKeyCertProc;
|
||||
genKeyCertProc.setTimeoutS(15);
|
||||
genKeyCertProc.setCommand(command);
|
||||
genKeyCertProc.runBlocking(QtcProcess::WithEventLoop);
|
||||
genKeyCertProc.runBlocking(EventLoopMode::On);
|
||||
|
||||
if (genKeyCertProc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (genKeyCertProc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
genKeyCertProc.exitMessage() + '\n' + genKeyCertProc.allOutput());
|
||||
return;
|
||||
|
||||
@@ -527,8 +527,8 @@ void AndroidDeployQtStep::runCommand(const CommandLine &command)
|
||||
OutputFormat::NormalMessage);
|
||||
|
||||
buildProc.setCommand(command);
|
||||
buildProc.runBlocking(QtcProcess::WithEventLoop);
|
||||
if (buildProc.result() != QtcProcess::FinishedWithSuccess)
|
||||
buildProc.runBlocking(EventLoopMode::On);
|
||||
if (buildProc.result() != ProcessResult::FinishedWithSuccess)
|
||||
reportWarningOrError(buildProc.exitMessage(), Task::Error);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,10 @@
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
|
||||
#include <utils/commandline.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
#include <projectexplorer/devicesupport/idevice.h>
|
||||
#include <projectexplorer/devicesupport/idevicefactory.h>
|
||||
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QFutureWatcher>
|
||||
#include <QFileSystemWatcher>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
|
||||
@@ -593,8 +593,8 @@ bool AndroidManager::checkKeystorePassword(const QString &keystorePath, const QS
|
||||
QtcProcess proc;
|
||||
proc.setTimeoutS(10);
|
||||
proc.setCommand(cmd);
|
||||
proc.runBlocking(QtcProcess::WithEventLoop);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
proc.runBlocking(EventLoopMode::On);
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool AndroidManager::checkCertificatePassword(const QString &keystorePath, const QString &keystorePasswd, const QString &alias, const QString &certificatePasswd)
|
||||
@@ -610,8 +610,8 @@ bool AndroidManager::checkCertificatePassword(const QString &keystorePath, const
|
||||
QtcProcess proc;
|
||||
proc.setTimeoutS(10);
|
||||
proc.setCommand({AndroidConfigurations::currentConfig().keytoolPath(), arguments});
|
||||
proc.runBlocking(QtcProcess::WithEventLoop);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
proc.runBlocking(EventLoopMode::On);
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool AndroidManager::checkCertificateExists(const QString &keystorePath,
|
||||
@@ -624,8 +624,8 @@ bool AndroidManager::checkCertificateExists(const QString &keystorePath,
|
||||
QtcProcess proc;
|
||||
proc.setTimeoutS(10);
|
||||
proc.setCommand({AndroidConfigurations::currentConfig().keytoolPath(), arguments});
|
||||
proc.runBlocking(QtcProcess::WithEventLoop);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
proc.runBlocking(EventLoopMode::On);
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
using GradleProperties = QMap<QByteArray, QByteArray>;
|
||||
@@ -779,10 +779,10 @@ SdkToolResult AndroidManager::runCommand(const CommandLine &command,
|
||||
cmdProc.setWriteData(writeData);
|
||||
qCDebug(androidManagerLog) << "Running command (sync):" << command.toUserOutput();
|
||||
cmdProc.setCommand(command);
|
||||
cmdProc.runBlocking(QtcProcess::WithEventLoop);
|
||||
cmdProc.runBlocking(EventLoopMode::On);
|
||||
cmdResult.m_stdOut = cmdProc.stdOut().trimmed();
|
||||
cmdResult.m_stdErr = cmdProc.stdErr().trimmed();
|
||||
cmdResult.m_success = cmdProc.result() == QtcProcess::FinishedWithSuccess;
|
||||
cmdResult.m_success = cmdProc.result() == ProcessResult::FinishedWithSuccess;
|
||||
qCDebug(androidManagerLog) << "Command finshed (sync):" << command.toUserOutput()
|
||||
<< "Success:" << cmdResult.m_success
|
||||
<< "Output:" << cmdProc.allRawOutput();
|
||||
|
||||
@@ -138,10 +138,10 @@ static bool sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
|
||||
proc.setTimeoutS(timeout);
|
||||
proc.setTimeOutMessageBoxEnabled(true);
|
||||
proc.setCommand({config.sdkManagerToolPath(), newArgs});
|
||||
proc.runBlocking(QtcProcess::WithEventLoop);
|
||||
proc.runBlocking(EventLoopMode::On);
|
||||
if (output)
|
||||
*output = proc.allOutput();
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -179,7 +179,7 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
|
||||
&proc, &QtcProcess::stopProcess);
|
||||
}
|
||||
proc.setCommand({config.sdkManagerToolPath(), newArgs});
|
||||
proc.runBlocking(QtcProcess::WithEventLoop);
|
||||
proc.runBlocking(EventLoopMode::On);
|
||||
if (assertionFound) {
|
||||
output.success = false;
|
||||
output.stdOutput = proc.stdOut();
|
||||
@@ -187,7 +187,7 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
|
||||
"The operation requires user interaction. "
|
||||
"Use the \"sdkmanager\" command-line tool.");
|
||||
} else {
|
||||
output.success = proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
output.success = proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -636,7 +636,7 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
|
||||
m_ui.openSslPathChooser->triggerChanged(); // After cloning, the path exists
|
||||
|
||||
if (!openSslProgressDialog->wasCanceled()
|
||||
|| gitCloner->result() == QtcProcess::FinishedWithError) {
|
||||
|| gitCloner->result() == ProcessResult::FinishedWithError) {
|
||||
failDialog();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -113,7 +113,7 @@ static Macros dumpPredefinedMacros(const FilePath &compiler, const QStringList &
|
||||
|
||||
cpp.setCommand(cmd);
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (cpp.result() != ProcessResult::FinishedWithSuccess) {
|
||||
qWarning() << cpp.exitMessage();
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ static Macros dumpArmPredefinedMacros(const FilePath &compiler, const QStringLis
|
||||
cpp.setCommand({compiler, args});
|
||||
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (cpp.result() != ProcessResult::FinishedWithSuccess) {
|
||||
qWarning() << cpp.exitMessage();
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ static Macros dumpPredefinedMacros(const FilePath &compiler, const Environment &
|
||||
cpp.setCommand({compiler, {compilerTargetFlag(abi), "-dM", "-E", fakeIn.fileName()}});
|
||||
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (cpp.result() != ProcessResult::FinishedWithSuccess) {
|
||||
qWarning() << cpp.exitMessage();
|
||||
return {};
|
||||
}
|
||||
@@ -114,7 +114,7 @@ static HeaderPaths dumpHeaderPaths(const FilePath &compiler, const Environment &
|
||||
cpp.setCommand({compiler, {compilerTargetFlag(abi), "--print-search-dirs"}});
|
||||
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (cpp.result() != ProcessResult::FinishedWithSuccess) {
|
||||
qWarning() << cpp.exitMessage();
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <vcsbase/vcsbaseeditorconfig.h>
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
@@ -153,7 +154,7 @@ bool BazaarClient::synchronousUncommit(const FilePath &workingDir,
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
VcsOutputWindow::append(proc.stdOut());
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
void BazaarClient::commit(const FilePath &repositoryRoot, const QStringList &files,
|
||||
@@ -191,7 +192,7 @@ bool BazaarClient::managesFile(const FilePath &workingDirectory, const QString &
|
||||
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return false;
|
||||
return proc.rawStdOut().startsWith("unknown");
|
||||
}
|
||||
@@ -231,8 +232,8 @@ ExitCodeInterpreter BazaarClient::exitCodeInterpreter(VcsCommandTag cmd) const
|
||||
{
|
||||
if (cmd == DiffCommand) {
|
||||
return [](int code) {
|
||||
return (code < 0 || code > 2) ? QtcProcess::FinishedWithError
|
||||
: QtcProcess::FinishedWithSuccess;
|
||||
return (code < 0 || code > 2) ? ProcessResult::FinishedWithError
|
||||
: ProcessResult::FinishedWithSuccess;
|
||||
};
|
||||
}
|
||||
return {};
|
||||
|
||||
@@ -50,6 +50,8 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/locator/commandlocator.h>
|
||||
|
||||
#include <utils/commandline.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/parameteraction.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/stringutils.h>
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
#include <QRegularExpression>
|
||||
#include <QXmlStreamWriter>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace Beautifier {
|
||||
namespace Internal {
|
||||
|
||||
@@ -81,12 +83,12 @@ static int parseVersion(const QString &text)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int updateVersionHelper(const Utils::FilePath &command)
|
||||
static int updateVersionHelper(const FilePath &command)
|
||||
{
|
||||
Utils::QtcProcess process;
|
||||
QtcProcess process;
|
||||
process.setCommand({command, {"--version"}});
|
||||
process.runBlocking();
|
||||
if (process.result() != Utils::QtcProcess::FinishedWithSuccess)
|
||||
if (process.result() != ProcessResult::FinishedWithSuccess)
|
||||
return 0;
|
||||
|
||||
// Astyle prints the version on stdout or stderr, depending on platform
|
||||
@@ -101,7 +103,7 @@ void ArtisticStyleSettings::updateVersion()
|
||||
if (m_versionFuture.isRunning())
|
||||
m_versionFuture.cancel();
|
||||
|
||||
m_versionFuture = Utils::runAsync(updateVersionHelper, command());
|
||||
m_versionFuture = runAsync(updateVersionHelper, command());
|
||||
m_versionWatcher.setFuture(m_versionFuture);
|
||||
}
|
||||
|
||||
@@ -184,7 +186,7 @@ void ArtisticStyleSettings::createDocumentationFile() const
|
||||
process.setTimeoutS(2);
|
||||
process.setCommand({command(), {"-h"}});
|
||||
process.runBlocking();
|
||||
if (process.result() != Utils::QtcProcess::FinishedWithSuccess)
|
||||
if (process.result() != ProcessResult::FinishedWithSuccess)
|
||||
return;
|
||||
|
||||
QFile file(documentationFilePath());
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
#include <QRegularExpression>
|
||||
#include <QXmlStreamWriter>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace Beautifier {
|
||||
namespace Internal {
|
||||
|
||||
@@ -54,7 +56,7 @@ const char SETTINGS_NAME[] = "uncrustify";
|
||||
UncrustifySettings::UncrustifySettings() :
|
||||
AbstractSettings(SETTINGS_NAME, ".cfg")
|
||||
{
|
||||
connect(&m_versionProcess, &Utils::QtcProcess::finished,
|
||||
connect(&m_versionProcess, &QtcProcess::finished,
|
||||
this, &UncrustifySettings::parseVersionProcessResult);
|
||||
|
||||
setCommand("uncrustify");
|
||||
@@ -88,12 +90,12 @@ void UncrustifySettings::setUseHomeFile(bool useHomeFile)
|
||||
m_settings.insert(USE_HOME_FILE, QVariant(useHomeFile));
|
||||
}
|
||||
|
||||
Utils::FilePath UncrustifySettings::specificConfigFile() const
|
||||
FilePath UncrustifySettings::specificConfigFile() const
|
||||
{
|
||||
return Utils::FilePath::fromString(m_settings.value(SPECIFIC_CONFIG_FILE_PATH).toString());
|
||||
return FilePath::fromString(m_settings.value(SPECIFIC_CONFIG_FILE_PATH).toString());
|
||||
}
|
||||
|
||||
void UncrustifySettings::setSpecificConfigFile(const Utils::FilePath &filePath)
|
||||
void UncrustifySettings::setSpecificConfigFile(const FilePath &filePath)
|
||||
{
|
||||
m_settings.insert(SPECIFIC_CONFIG_FILE_PATH, QVariant(filePath.toString()));
|
||||
}
|
||||
@@ -148,11 +150,11 @@ QString UncrustifySettings::documentationFilePath() const
|
||||
|
||||
void UncrustifySettings::createDocumentationFile() const
|
||||
{
|
||||
Utils::QtcProcess process;
|
||||
QtcProcess process;
|
||||
process.setTimeoutS(2);
|
||||
process.setCommand({command(), {"--show-config"}});
|
||||
process.runBlocking();
|
||||
if (process.result() != Utils::QtcProcess::FinishedWithSuccess)
|
||||
if (process.result() != ProcessResult::FinishedWithSuccess)
|
||||
return;
|
||||
|
||||
QFile file(documentationFilePath());
|
||||
|
||||
@@ -60,14 +60,14 @@ static QString finishedWithBadExitCode(const QString &name, int exitCode)
|
||||
}
|
||||
|
||||
ClangToolRunner::ClangToolRunner(QObject *parent)
|
||||
: QObject(parent), m_process(new Utils::QtcProcess)
|
||||
: QObject(parent), m_process(new QtcProcess)
|
||||
{}
|
||||
|
||||
ClangToolRunner::~ClangToolRunner()
|
||||
{
|
||||
if (m_process->state() != QProcess::NotRunning) {
|
||||
// asking politly to terminate costs ~300 ms on windows so skip the courtasy and direct kill the process
|
||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
m_process->kill();
|
||||
m_process->waitForFinished(100);
|
||||
} else {
|
||||
@@ -147,10 +147,10 @@ bool ClangToolRunner::run(const QString &fileToAnalyze, const QStringList &compi
|
||||
|
||||
void ClangToolRunner::onProcessFinished()
|
||||
{
|
||||
if (m_process->result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (m_process->result() == ProcessResult::FinishedWithSuccess) {
|
||||
qCDebug(LOG).noquote() << "Output:\n" << m_process->stdOut();
|
||||
emit finishedWithSuccess(m_fileToAnalyze);
|
||||
} else if (m_process->result() == QtcProcess::FinishedWithError) {
|
||||
} else if (m_process->result() == ProcessResult::FinishedWithError) {
|
||||
emit finishedWithFailure(finishedWithBadExitCode(m_name, m_process->exitCode()),
|
||||
commandlineAndOutput());
|
||||
} else { // == QProcess::CrashExit
|
||||
|
||||
@@ -27,10 +27,14 @@
|
||||
|
||||
#include "clangtoolslogfilereader.h"
|
||||
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/commandline.h>
|
||||
|
||||
#include <QProcess>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
|
||||
@@ -55,9 +55,9 @@ static QString runExecutable(const Utils::CommandLine &commandLine, QueryFailMod
|
||||
cpp.setCommand(commandLine);
|
||||
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess
|
||||
if (cpp.result() != ProcessResult::FinishedWithSuccess
|
||||
&& (queryFailMode == QueryFailMode::Noisy
|
||||
|| cpp.result() != QtcProcess::FinishedWithError)) {
|
||||
|| cpp.result() != ProcessResult::FinishedWithError)) {
|
||||
Core::MessageManager::writeFlashing(cpp.exitMessage());
|
||||
Core::MessageManager::writeFlashing(QString::fromUtf8(cpp.allRawOutput()));
|
||||
return {};
|
||||
|
||||
@@ -1673,7 +1673,7 @@ ClearCasePluginPrivate::runCleartool(const FilePath &workingDir,
|
||||
command.setCodec(outputCodec);
|
||||
command.runCommand(proc, {FilePath::fromString(executable), arguments});
|
||||
|
||||
response.error = proc.result() != QtcProcess::FinishedWithSuccess;
|
||||
response.error = proc.result() != ProcessResult::FinishedWithSuccess;
|
||||
if (response.error)
|
||||
response.message = proc.exitMessage();
|
||||
response.stdErr = proc.stdErr();
|
||||
@@ -2354,8 +2354,8 @@ QString ClearCasePluginPrivate::runExtDiff(const FilePath &workingDir, const QSt
|
||||
process.setWorkingDirectory(workingDir);
|
||||
process.setCodec(outputCodec ? outputCodec : QTextCodec::codecForName("UTF-8"));
|
||||
process.setCommand(diff);
|
||||
process.runBlocking(QtcProcess::WithEventLoop);
|
||||
if (process.result() != QtcProcess::FinishedWithSuccess)
|
||||
process.runBlocking(EventLoopMode::On);
|
||||
if (process.result() != ProcessResult::FinishedWithSuccess)
|
||||
return QString();
|
||||
return process.allOutput();
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/categorysortfiltermodel.h>
|
||||
#include <utils/checkablemessagebox.h>
|
||||
#include <utils/commandline.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/headerviewstretcher.h>
|
||||
#include <utils/infolabel.h>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/taskhub.h>
|
||||
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/stringutils.h>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
@@ -28,16 +28,18 @@
|
||||
#include "builddirparameters.h"
|
||||
|
||||
#include <utils/outputformatter.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <QFutureInterface>
|
||||
#include <QObject>
|
||||
#include <QProcess>
|
||||
#include <QStringList>
|
||||
#include <QTimer>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/stringutils.h>
|
||||
|
||||
#include <QDir>
|
||||
|
||||
@@ -275,19 +275,19 @@ TextEditor::Keywords CMakeTool::keywords()
|
||||
if (m_introspection->m_functions.isEmpty() && m_introspection->m_didRun) {
|
||||
QtcProcess proc;
|
||||
runCMake(proc, {"--help-command-list"}, 5);
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess)
|
||||
m_introspection->m_functions = proc.stdOut().split('\n');
|
||||
|
||||
runCMake(proc, {"--help-commands"}, 5);
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess)
|
||||
parseFunctionDetailsOutput(proc.stdOut());
|
||||
|
||||
runCMake(proc, {"--help-property-list"}, 5);
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess)
|
||||
m_introspection->m_variables = parseVariableOutput(proc.stdOut());
|
||||
|
||||
runCMake(proc, {"--help-variable-list"}, 5);
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
m_introspection->m_variables.append(parseVariableOutput(proc.stdOut()));
|
||||
m_introspection->m_variables = Utils::filteredUnique(m_introspection->m_variables);
|
||||
Utils::sort(m_introspection->m_variables);
|
||||
@@ -517,7 +517,7 @@ void CMakeTool::fetchFromCapabilities() const
|
||||
QtcProcess cmake;
|
||||
runCMake(cmake, {"-E", "capabilities"});
|
||||
|
||||
if (cmake.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (cmake.result() == ProcessResult::FinishedWithSuccess) {
|
||||
m_introspection->m_didRun = true;
|
||||
parseFromCapabilities(cmake.stdOut());
|
||||
} else {
|
||||
|
||||
@@ -670,7 +670,7 @@ void ExternalToolRunner::run()
|
||||
|
||||
void ExternalToolRunner::finished()
|
||||
{
|
||||
if (m_process->result() == QtcProcess::FinishedWithSuccess
|
||||
if (m_process->result() == ProcessResult::FinishedWithSuccess
|
||||
&& (m_tool->outputHandling() == ExternalTool::ReplaceSelection
|
||||
|| m_tool->errorHandling() == ExternalTool::ReplaceSelection)) {
|
||||
ExternalToolManager::emitReplaceSelectionRequested(m_processOutput);
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
@@ -128,7 +129,7 @@ void ExecuteFilter::finished()
|
||||
QTC_ASSERT(m_process, return);
|
||||
const QString commandName = headCommand();
|
||||
QString message;
|
||||
if (m_process->result() == QtcProcess::FinishedWithSuccess)
|
||||
if (m_process->result() == ProcessResult::FinishedWithSuccess)
|
||||
message = tr("Command \"%1\" finished.").arg(commandName);
|
||||
else
|
||||
message = tr("Command \"%1\" failed.").arg(commandName);
|
||||
|
||||
@@ -27,12 +27,14 @@
|
||||
|
||||
#include "ilocatorfilter.h"
|
||||
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/commandline.h>
|
||||
|
||||
#include <QQueue>
|
||||
#include <QStringList>
|
||||
#include <QTextCodec>
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
|
||||
namespace Core {
|
||||
namespace Internal {
|
||||
|
||||
|
||||
@@ -204,8 +204,8 @@ public:
|
||||
{
|
||||
if (cmd == DiffCommand) {
|
||||
return [](int code) {
|
||||
return (code < 0 || code > 2) ? QtcProcess::FinishedWithError
|
||||
: QtcProcess::FinishedWithSuccess;
|
||||
return (code < 0 || code > 2) ? ProcessResult::FinishedWithError
|
||||
: ProcessResult::FinishedWithSuccess;
|
||||
};
|
||||
}
|
||||
return {};
|
||||
@@ -1452,15 +1452,15 @@ CvsResponse CvsPluginPrivate::runCvs(const FilePath &workingDirectory,
|
||||
response.stdErr = proc.stdErr();
|
||||
response.stdOut = proc.stdOut();
|
||||
switch (proc.result()) {
|
||||
case QtcProcess::FinishedWithSuccess:
|
||||
case ProcessResult::FinishedWithSuccess:
|
||||
response.result = CvsResponse::Ok;
|
||||
break;
|
||||
case QtcProcess::FinishedWithError:
|
||||
case ProcessResult::FinishedWithError:
|
||||
response.result = CvsResponse::NonNullExitCode;
|
||||
break;
|
||||
case QtcProcess::TerminatedAbnormally:
|
||||
case QtcProcess::StartFailed:
|
||||
case QtcProcess::Hang:
|
||||
case ProcessResult::TerminatedAbnormally:
|
||||
case ProcessResult::StartFailed:
|
||||
case ProcessResult::Hang:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ void DebuggerItem::reinitializeFromFile(const Environment &sysEnv, QString *erro
|
||||
proc.setCommand({m_command, {version}});
|
||||
proc.runBlocking();
|
||||
const QString output = proc.allOutput().trimmed();
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
if (error)
|
||||
*error = output;
|
||||
m_engineType = NoEngineType;
|
||||
|
||||
@@ -763,7 +763,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePaths &s
|
||||
proc.setCommand({"xcrun", {"--find", "lldb"}});
|
||||
proc.runBlocking();
|
||||
// FIXME:
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
QString lPath = proc.allOutput().trimmed();
|
||||
if (!lPath.isEmpty()) {
|
||||
const QFileInfo fi(lPath);
|
||||
|
||||
@@ -5013,7 +5013,7 @@ CoreInfo CoreInfo::readExecutableNameFromCore(const Runnable &debugger, const Fi
|
||||
proc.setCommand({debugger.command.executable(), args});
|
||||
proc.runBlocking();
|
||||
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
QString output = proc.stdOut();
|
||||
// Core was generated by `/data/dev/creator-2.6/bin/qtcreator'.
|
||||
// Program terminated with signal 11, Segmentation fault.
|
||||
|
||||
@@ -836,7 +836,7 @@ void DockerDevicePrivate::startContainer()
|
||||
createProcess.setCommand(dockerCreate);
|
||||
createProcess.runBlocking();
|
||||
|
||||
if (createProcess.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (createProcess.result() != ProcessResult::FinishedWithSuccess)
|
||||
return;
|
||||
|
||||
m_container = createProcess.stdOut().trimmed();
|
||||
@@ -852,7 +852,7 @@ void DockerDevicePrivate::startContainer()
|
||||
LOG("\nSHELL FINISHED\n");
|
||||
QTC_ASSERT(shell, return);
|
||||
const int exitCode = shell->exitCode();
|
||||
LOG("RES: " << shell->result()
|
||||
LOG("RES: " << int(shell->result())
|
||||
<< " EXIT CODE: " << exitCode
|
||||
<< " STDOUT: " << shell->readAllStandardOutput()
|
||||
<< " STDERR: " << shell->readAllStandardError());
|
||||
@@ -1350,7 +1350,7 @@ void DockerDevice::runProcess(QtcProcess &process) const
|
||||
if (d->m_container.isEmpty()) {
|
||||
LOG("No container set to run " << process.commandLine().toUserOutput());
|
||||
QTC_CHECK(false);
|
||||
process.setResult(QtcProcess::StartFailed);
|
||||
process.setResult(ProcessResult::StartFailed);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,19 +31,20 @@
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
#include <vcsbase/vcscommand.h>
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QCompleter>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QCompleter>
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QPushButton>
|
||||
#include <QStringListModel>
|
||||
#include <QTimer>
|
||||
|
||||
@@ -161,7 +162,7 @@ void ChangeSelectionDialog::setDetails()
|
||||
Theme *theme = creatorTheme();
|
||||
|
||||
QPalette palette;
|
||||
if (m_process->result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (m_process->result() == ProcessResult::FinishedWithSuccess) {
|
||||
m_ui->detailsText->setPlainText(m_process->stdOut());
|
||||
palette.setColor(QPalette::Text, theme->color(Theme::TextColorNormal));
|
||||
m_ui->changeNumberEdit->setPalette(palette);
|
||||
|
||||
@@ -247,7 +247,7 @@ int GerritServer::testConnection()
|
||||
QtcProcess proc;
|
||||
client->vcsFullySynchronousExec(proc, {}, {curlBinary, arguments},
|
||||
Core::ShellCommand::NoOutput);
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
QString output = proc.stdOut();
|
||||
// Gerrit returns an empty response for /p/qt-creator/a/accounts/self
|
||||
// so consider this as 404.
|
||||
@@ -357,7 +357,7 @@ void GerritServer::resolveVersion(const GerritParameters &p, bool forceReload)
|
||||
Core::ShellCommand::NoOutput);
|
||||
// REST endpoint for version is only available from 2.8 and up. Do not consider invalid
|
||||
// if it fails.
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
QString output = proc.stdOut();
|
||||
if (output.isEmpty())
|
||||
return;
|
||||
|
||||
@@ -678,7 +678,7 @@ public:
|
||||
{
|
||||
ConflictHandler handler(workingDirectory, abortCommand);
|
||||
// No conflicts => do nothing
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess)
|
||||
return;
|
||||
handler.readStdOut(proc.stdOut());
|
||||
handler.readStdErr(proc.stdErr());
|
||||
@@ -844,7 +844,7 @@ bool GitClient::managesFile(const FilePath &workingDirectory, const QString &fil
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"ls-files", "--error-unmatch", fileName},
|
||||
Core::ShellCommand::NoOutput);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
FilePaths GitClient::unmanagedFiles(const FilePaths &filePaths) const
|
||||
@@ -860,7 +860,7 @@ FilePaths GitClient::unmanagedFiles(const FilePaths &filePaths) const
|
||||
args << transform(it.value(), [&wd](const QString &fp) { return wd.relativeFilePath(fp); });
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, it.key(), args, Core::ShellCommand::NoOutput);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return filePaths;
|
||||
const QStringList managedFilePaths
|
||||
= transform(proc.stdOut().split('\0', Qt::SkipEmptyParts),
|
||||
@@ -1433,7 +1433,7 @@ void GitClient::recoverDeletedFiles(const FilePath &workingDirectory)
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"ls-files", "--deleted"},
|
||||
VcsCommand::SuppressCommandLogging);
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
const QString stdOut = proc.stdOut().trimmed();
|
||||
if (stdOut.isEmpty()) {
|
||||
VcsOutputWindow::appendError(tr("Nothing to recover"));
|
||||
@@ -1460,7 +1460,7 @@ bool GitClient::synchronousLog(const FilePath &workingDirectory, const QStringLi
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, allArguments, flags, vcsTimeoutS(),
|
||||
encoding(workingDirectory, "i18n.logOutputEncoding"));
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
*output = proc.stdOut();
|
||||
return true;
|
||||
} else {
|
||||
@@ -1478,7 +1478,7 @@ bool GitClient::synchronousAdd(const FilePath &workingDirectory,
|
||||
args += extraOptions + files;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool GitClient::synchronousDelete(const FilePath &workingDirectory,
|
||||
@@ -1491,7 +1491,7 @@ bool GitClient::synchronousDelete(const FilePath &workingDirectory,
|
||||
arguments.append(files);
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool GitClient::synchronousMove(const FilePath &workingDirectory,
|
||||
@@ -1500,7 +1500,7 @@ bool GitClient::synchronousMove(const FilePath &workingDirectory,
|
||||
{
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"mv", from, to});
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool GitClient::synchronousReset(const FilePath &workingDirectory,
|
||||
@@ -1520,7 +1520,7 @@ bool GitClient::synchronousReset(const FilePath &workingDirectory,
|
||||
// Note that git exits with 1 even if the operation is successful
|
||||
// Assume real failure if the output does not contain "foo.cpp modified"
|
||||
// or "Unstaged changes after reset" (git 1.7.0).
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess
|
||||
&& (!stdOut.contains("modified") && !stdOut.contains("Unstaged changes after reset"))) {
|
||||
if (files.isEmpty()) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
@@ -1541,7 +1541,7 @@ bool GitClient::synchronousInit(const FilePath &workingDirectory)
|
||||
vcsFullySynchronousExec(proc, workingDirectory, QStringList{"init"});
|
||||
// '[Re]Initialized...'
|
||||
VcsOutputWindow::append(proc.stdOut());
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
resetCachedVcsInfo(workingDirectory);
|
||||
return true;
|
||||
} else {
|
||||
@@ -1567,7 +1567,7 @@ bool GitClient::synchronousCheckoutFiles(const FilePath &workingDirectory, QStri
|
||||
arguments << "--" << files;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, VcsCommand::ExpectRepoChanges);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
const QString fileArg = files.join(", ");
|
||||
//: Meaning of the arguments: %1: revision, %2: files, %3: repository,
|
||||
//: %4: Error message
|
||||
@@ -1619,7 +1619,7 @@ bool GitClient::synchronousRevListCmd(const FilePath &workingDirectory, const QS
|
||||
const QStringList arguments = QStringList({"rev-list", noColorOption}) + extraArguments;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -1683,7 +1683,7 @@ QString GitClient::synchronousCurrentLocalBranch(const FilePath &workingDirector
|
||||
QString branch;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"symbolic-ref", HEAD}, silentFlags);
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
branch = proc.stdOut().trimmed();
|
||||
} else {
|
||||
const QString gitDir = findGitDirForRepository(workingDirectory);
|
||||
@@ -1708,7 +1708,7 @@ bool GitClient::synchronousHeadRefs(const FilePath &workingDirectory, QStringLis
|
||||
const QStringList arguments = {"show-ref", "--head", "--abbrev=10", "--dereference"};
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -1757,7 +1757,7 @@ QString GitClient::synchronousTopic(const FilePath &workingDirectory) const
|
||||
// No tag or remote branch - try git describe
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, QStringList{"describe"}, VcsCommand::NoOutput);
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
const QString stdOut = proc.stdOut().trimmed();
|
||||
if (!stdOut.isEmpty())
|
||||
return stdOut;
|
||||
@@ -1772,7 +1772,7 @@ bool GitClient::synchronousRevParseCmd(const FilePath &workingDirectory, const Q
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
*output = proc.stdOut().trimmed();
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -1786,7 +1786,7 @@ QString GitClient::synchronousTopRevision(const FilePath &workingDirectory, QDat
|
||||
const QStringList arguments = {"show", "-s", "--pretty=format:%H:%ct", HEAD};
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return QString();
|
||||
const QStringList output = proc.stdOut().trimmed().split(':');
|
||||
if (dateTime && output.size() > 1) {
|
||||
@@ -1848,7 +1848,7 @@ QString GitClient::synchronousShortDescription(const FilePath &workingDirectory,
|
||||
"--max-count=1", revision};
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
VcsOutputWindow::appendSilently(tr("Cannot describe revision \"%1\" in \"%2\": %3")
|
||||
.arg(revision, workingDirectory.toUserOutput(), proc.stdErr()));
|
||||
return revision;
|
||||
@@ -1929,7 +1929,7 @@ bool GitClient::executeSynchronousStash(const FilePath &workingDirectory,
|
||||
| VcsCommand::ShowSuccessMessage;
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, workingDirectory, arguments, flags);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -1970,7 +1970,7 @@ bool GitClient::synchronousBranchCmd(const FilePath &workingDirectory, QStringLi
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, branchArgs);
|
||||
*output = proc.stdOut();
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(branchArgs, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -1984,7 +1984,7 @@ bool GitClient::synchronousTagCmd(const FilePath &workingDirectory, QStringList
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, tagArgs);
|
||||
*output = proc.stdOut();
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(tagArgs, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -1998,7 +1998,7 @@ bool GitClient::synchronousForEachRefCmd(const FilePath &workingDirectory, QStri
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args, silentFlags);
|
||||
*output = proc.stdOut();
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(args, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -2022,7 +2022,7 @@ bool GitClient::synchronousRemoteCmd(const FilePath &workingDirectory, QStringLi
|
||||
*errorMessage = stdErr;
|
||||
*output = proc.stdOut();
|
||||
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(remoteArgs, workingDirectory, stdErr, errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -2062,7 +2062,7 @@ QStringList GitClient::synchronousSubmoduleStatus(const FilePath &workingDirecto
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"submodule", "status"}, silentFlags);
|
||||
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(tr("Cannot retrieve submodule status of \"%1\": %2")
|
||||
.arg(workingDirectory.toUserOutput(), proc.stdErr()), errorMessage);
|
||||
return QStringList();
|
||||
@@ -2142,7 +2142,7 @@ QByteArray GitClient::synchronousShow(const FilePath &workingDirectory, const QS
|
||||
const QStringList arguments = {"show", decorateOption, noColorOption, "--no-patch", id};
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, flags);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), nullptr);
|
||||
return {};
|
||||
}
|
||||
@@ -2158,7 +2158,7 @@ bool GitClient::cleanList(const FilePath &workingDirectory, const QString &modul
|
||||
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, directory, arguments, VcsCommand::ForceCLocale);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, directory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -2206,7 +2206,7 @@ bool GitClient::synchronousApplyPatch(const FilePath &workingDirectory,
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments);
|
||||
const QString stdErr = proc.stdErr();
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
if (!stdErr.isEmpty())
|
||||
*errorMessage = tr("There were warnings while applying \"%1\" to \"%2\":\n%3")
|
||||
.arg(file, workingDirectory.toUserOutput(), stdErr);
|
||||
@@ -2347,7 +2347,7 @@ GitClient::StatusResult GitClient::gitStatus(const FilePath &workingDirectory, S
|
||||
if (output)
|
||||
*output = stdOut;
|
||||
|
||||
const bool statusRc = proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
const bool statusRc = proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
const bool branchKnown = !stdOut.startsWith("## HEAD (no branch)\n");
|
||||
// Is it something really fatal?
|
||||
if (!statusRc && !branchKnown) {
|
||||
@@ -2718,7 +2718,7 @@ bool GitClient::readDataFromCommit(const FilePath &repoDirectory, const QString
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, repoDirectory, arguments, silentFlags);
|
||||
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
if (errorMessage) {
|
||||
*errorMessage = tr("Cannot retrieve last commit data of repository \"%1\".")
|
||||
.arg(repoDirectory.toUserOutput());
|
||||
@@ -2974,7 +2974,7 @@ bool GitClient::addAndCommit(const FilePath &repositoryDirectory,
|
||||
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, repositoryDirectory, arguments, VcsCommand::NoFullySync);
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
VcsOutputWindow::appendMessage(msgCommitted(amendSHA1, commitCount));
|
||||
GitPlugin::updateCurrentBranch();
|
||||
return true;
|
||||
@@ -3116,7 +3116,7 @@ bool GitClient::executeAndHandleConflicts(const FilePath &workingDirectory,
|
||||
vcsSynchronousExec(proc, workingDirectory, arguments, flags);
|
||||
// Notify about changed files or abort the rebase.
|
||||
ConflictHandler::handleResponse(proc, workingDirectory, abortCommand);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
void GitClient::pull(const FilePath &workingDirectory, bool rebase)
|
||||
@@ -3175,7 +3175,7 @@ bool GitClient::synchronousSetTrackingBranch(const FilePath &workingDirectory,
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc,
|
||||
workingDirectory, {"branch", "--set-upstream-to=" + tracking, branch});
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
VcsBase::VcsCommand *GitClient::asyncUpstreamStatus(const FilePath &workingDirectory,
|
||||
@@ -3498,7 +3498,7 @@ bool GitClient::synchronousStashRemove(const FilePath &workingDirectory, const Q
|
||||
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments);
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
const QString output = proc.stdOut();
|
||||
if (!output.isEmpty())
|
||||
VcsOutputWindow::append(output);
|
||||
@@ -3517,7 +3517,7 @@ bool GitClient::synchronousStashList(const FilePath &workingDirectory, QList<Sta
|
||||
const QStringList arguments = {"stash", "list", noColorOption};
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, VcsCommand::ForceCLocale);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -3557,7 +3557,7 @@ QString GitClient::readOneLine(const FilePath &workingDirectory, const QStringLi
|
||||
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags, vcsTimeoutS(), codec);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return QString();
|
||||
return proc.stdOut().trimmed();
|
||||
}
|
||||
@@ -3584,7 +3584,7 @@ unsigned GitClient::synchronousGitVersion(QString *errorMessage) const
|
||||
// run git --version
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, {}, {"--version"}, silentFlags);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(tr("Cannot determine Git version: %1").arg(proc.stdErr()), errorMessage);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -204,13 +204,13 @@ public:
|
||||
proc.setTimeoutS(0);
|
||||
m_command->runCommand(proc, {m_vcsBinary, arguments});
|
||||
switch (proc.result()) {
|
||||
case QtcProcess::TerminatedAbnormally:
|
||||
case QtcProcess::StartFailed:
|
||||
case QtcProcess::Hang:
|
||||
case ProcessResult::TerminatedAbnormally:
|
||||
case ProcessResult::StartFailed:
|
||||
case ProcessResult::Hang:
|
||||
fi.reportCanceled();
|
||||
break;
|
||||
case QtcProcess::FinishedWithSuccess:
|
||||
case QtcProcess::FinishedWithError:
|
||||
case ProcessResult::FinishedWithSuccess:
|
||||
case ProcessResult::FinishedWithError:
|
||||
// When no results are found, git-grep exits with non-zero status.
|
||||
// Do not consider this as an error.
|
||||
break;
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#include <texteditor/texteditor.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/commandline.h>
|
||||
#include <utils/infobar.h>
|
||||
#include <utils/parameteraction.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
@@ -100,7 +100,7 @@ const char profileTeamIdTag[] = "TeamIdentifier";
|
||||
static const QString xcodePlistPath = QDir::homePath() + "/Library/Preferences/com.apple.dt.Xcode.plist";
|
||||
static const QString provisioningProfileDirPath = QDir::homePath() + "/Library/MobileDevice/Provisioning Profiles";
|
||||
|
||||
static Utils::Id deviceId(const QString &sdkName)
|
||||
static Id deviceId(const QString &sdkName)
|
||||
{
|
||||
if (sdkName.startsWith("iphoneos", Qt::CaseInsensitive))
|
||||
return Constants::IOS_DEVICE_TYPE;
|
||||
@@ -109,7 +109,7 @@ static Utils::Id deviceId(const QString &sdkName)
|
||||
return {};
|
||||
}
|
||||
|
||||
static bool isSimulatorDeviceId(const Utils::Id &id)
|
||||
static bool isSimulatorDeviceId(const Id &id)
|
||||
{
|
||||
return id == Constants::IOS_SIMULATOR_TYPE;
|
||||
}
|
||||
@@ -126,7 +126,7 @@ static QList<ClangToolChain *> clangToolChains(const Toolchains &toolChains)
|
||||
static QList<ClangToolChain *> autoDetectedIosToolChains()
|
||||
{
|
||||
const QList<ClangToolChain *> toolChains = clangToolChains(ToolChainManager::toolchains());
|
||||
return Utils::filtered(toolChains, [](ClangToolChain *toolChain) {
|
||||
return filtered(toolChains, [](ClangToolChain *toolChain) {
|
||||
return toolChain->isAutoDetected()
|
||||
&& (toolChain->displayName().startsWith("iphone")
|
||||
|| toolChain->displayName().startsWith("Apple Clang")); // TODO tool chains should be marked directly
|
||||
@@ -138,15 +138,15 @@ static ToolChainPair findToolChainForPlatform(const XcodePlatform &platform,
|
||||
const QList<ClangToolChain *> &toolChains)
|
||||
{
|
||||
ToolChainPair platformToolChains;
|
||||
auto toolchainMatch = [](ClangToolChain *toolChain, const Utils::FilePath &compilerPath, const QStringList &flags) {
|
||||
auto toolchainMatch = [](ClangToolChain *toolChain, const FilePath &compilerPath, const QStringList &flags) {
|
||||
return compilerPath == toolChain->compilerCommand()
|
||||
&& flags == toolChain->platformCodeGenFlags()
|
||||
&& flags == toolChain->platformLinkerFlags();
|
||||
};
|
||||
platformToolChains.first = Utils::findOrDefault(toolChains, std::bind(toolchainMatch, std::placeholders::_1,
|
||||
platformToolChains.first = findOrDefault(toolChains, std::bind(toolchainMatch, std::placeholders::_1,
|
||||
platform.cCompilerPath,
|
||||
target.backendFlags));
|
||||
platformToolChains.second = Utils::findOrDefault(toolChains, std::bind(toolchainMatch, std::placeholders::_1,
|
||||
platformToolChains.second = findOrDefault(toolChains, std::bind(toolchainMatch, std::placeholders::_1,
|
||||
platform.cxxCompilerPath,
|
||||
target.backendFlags));
|
||||
return platformToolChains;
|
||||
@@ -169,8 +169,8 @@ static QHash<XcodePlatform::ToolchainTarget, ToolChainPair> findToolChains(const
|
||||
|
||||
static QSet<Kit *> existingAutoDetectedIosKits()
|
||||
{
|
||||
return Utils::toSet(Utils::filtered(KitManager::kits(), [](Kit *kit) -> bool {
|
||||
Utils::Id deviceKind = DeviceTypeKitAspect::deviceTypeId(kit);
|
||||
return toSet(filtered(KitManager::kits(), [](Kit *kit) -> bool {
|
||||
Id deviceKind = DeviceTypeKitAspect::deviceTypeId(kit);
|
||||
return kit->isAutoDetected() && (deviceKind == Constants::IOS_DEVICE_TYPE
|
||||
|| deviceKind == Constants::IOS_SIMULATOR_TYPE);
|
||||
}));
|
||||
@@ -182,8 +182,8 @@ static void printKits(const QSet<Kit *> &kits)
|
||||
qCDebug(kitSetupLog) << " -" << kit->displayName();
|
||||
}
|
||||
|
||||
static void setupKit(Kit *kit, Utils::Id pDeviceType, const ToolChainPair& toolChains,
|
||||
const QVariant &debuggerId, const Utils::FilePath &sdkPath, QtVersion *qtVersion)
|
||||
static void setupKit(Kit *kit, Id pDeviceType, const ToolChainPair& toolChains,
|
||||
const QVariant &debuggerId, const FilePath &sdkPath, QtVersion *qtVersion)
|
||||
{
|
||||
DeviceTypeKitAspect::setDeviceTypeId(kit, pDeviceType);
|
||||
if (toolChains.first)
|
||||
@@ -214,7 +214,7 @@ static void setupKit(Kit *kit, Utils::Id pDeviceType, const ToolChainPair& toolC
|
||||
SysRootKitAspect::setSysRoot(kit, sdkPath);
|
||||
}
|
||||
|
||||
static QVersionNumber findXcodeVersion(const Utils::FilePath &developerPath)
|
||||
static QVersionNumber findXcodeVersion(const FilePath &developerPath)
|
||||
{
|
||||
const FilePath xcodeInfo = developerPath.parentDir().pathAppended("Info.plist");
|
||||
if (xcodeInfo.exists()) {
|
||||
@@ -231,12 +231,12 @@ static QByteArray decodeProvisioningProfile(const QString &path)
|
||||
{
|
||||
QTC_ASSERT(!path.isEmpty(), return QByteArray());
|
||||
|
||||
Utils::QtcProcess p;
|
||||
QtcProcess p;
|
||||
p.setTimeoutS(3);
|
||||
// path is assumed to be valid file path to .mobileprovision
|
||||
p.setCommand({"openssl", {"smime", "-inform", "der", "-verify", "-in", path}});
|
||||
p.runBlocking();
|
||||
if (p.result() != Utils::QtcProcess::FinishedWithSuccess)
|
||||
if (p.result() != ProcessResult::FinishedWithSuccess)
|
||||
qCDebug(iosCommonLog) << "Reading signed provisioning file failed" << path;
|
||||
return p.stdOut().toLatin1();
|
||||
}
|
||||
@@ -251,7 +251,7 @@ void IosConfigurations::updateAutomaticKitList()
|
||||
// target -> tool chain
|
||||
const auto targetToolChainHash = findToolChains(platforms);
|
||||
|
||||
const auto qtVersions = Utils::toSet(QtVersionManager::versions([](const QtVersion *v) {
|
||||
const auto qtVersions = toSet(QtVersionManager::versions([](const QtVersion *v) {
|
||||
return v->isValid() && v->type() == Constants::IOSQT;
|
||||
}));
|
||||
|
||||
@@ -264,8 +264,8 @@ void IosConfigurations::updateAutomaticKitList()
|
||||
QSet<Kit *> resultingKits;
|
||||
for (const XcodePlatform &platform : platforms) {
|
||||
for (const auto &sdk : platform.sdks) {
|
||||
const auto targets = Utils::filtered(platform.targets,
|
||||
[&sdk](const XcodePlatform::ToolchainTarget &target) {
|
||||
const auto targets = filtered(platform.targets,
|
||||
[&sdk](const XcodePlatform::ToolchainTarget &target) {
|
||||
return sdk.architectures.first() == target.architecture;
|
||||
});
|
||||
if (targets.empty())
|
||||
@@ -278,7 +278,7 @@ void IosConfigurations::updateAutomaticKitList()
|
||||
qCDebug(kitSetupLog) << " - No tool chain found";
|
||||
continue;
|
||||
}
|
||||
Utils::Id pDeviceType = deviceId(sdk.directoryName);
|
||||
Id pDeviceType = deviceId(sdk.directoryName);
|
||||
if (!pDeviceType.isValid()) {
|
||||
qCDebug(kitSetupLog) << "Unsupported/Invalid device type" << sdk.directoryName;
|
||||
continue;
|
||||
@@ -286,7 +286,7 @@ void IosConfigurations::updateAutomaticKitList()
|
||||
|
||||
for (QtVersion *qtVersion : qtVersions) {
|
||||
qCDebug(kitSetupLog) << " - Qt version:" << qtVersion->displayName();
|
||||
Kit *kit = Utils::findOrDefault(existingKits, [&pDeviceType, &platformToolchains, &qtVersion](const Kit *kit) {
|
||||
Kit *kit = findOrDefault(existingKits, [&pDeviceType, &platformToolchains, &qtVersion](const Kit *kit) {
|
||||
// we do not compare the sdk (thus automatically upgrading it in place if a
|
||||
// new Xcode is used). Change?
|
||||
return DeviceTypeKitAspect::deviceTypeId(kit) == pDeviceType
|
||||
@@ -418,7 +418,7 @@ void IosConfigurations::updateSimulators()
|
||||
{
|
||||
// currently we have just one simulator
|
||||
DeviceManager *devManager = DeviceManager::instance();
|
||||
Utils::Id devId = Constants::IOS_SIMULATOR_DEVICE_ID;
|
||||
Id devId = Constants::IOS_SIMULATOR_DEVICE_ID;
|
||||
IDevice::ConstPtr dev = devManager->find(devId);
|
||||
if (dev.isNull()) {
|
||||
dev = IDevice::ConstPtr(new IosSimulator(devId));
|
||||
@@ -492,7 +492,7 @@ void IosConfigurations::loadProvisioningData(bool notify)
|
||||
}
|
||||
|
||||
// Sort team id's to move the free provisioning teams at last of the list.
|
||||
Utils::sort(teams, [](const QVariantMap &teamInfo1, const QVariantMap &teamInfo2) {
|
||||
sort(teams, [](const QVariantMap &teamInfo1, const QVariantMap &teamInfo2) {
|
||||
return teamInfo1.value(freeTeamTag).toInt() < teamInfo2.value(freeTeamTag).toInt();
|
||||
});
|
||||
|
||||
@@ -564,7 +564,7 @@ DevelopmentTeamPtr IosConfigurations::developmentTeam(const QString &teamID)
|
||||
QTC_CHECK(m_instance);
|
||||
m_instance->initializeProvisioningData();
|
||||
return findOrDefault(m_instance->m_developerTeams,
|
||||
Utils::equal(&DevelopmentTeam::identifier, teamID));
|
||||
equal(&DevelopmentTeam::identifier, teamID));
|
||||
}
|
||||
|
||||
const ProvisioningProfiles &IosConfigurations::provisioningProfiles()
|
||||
@@ -578,8 +578,8 @@ ProvisioningProfilePtr IosConfigurations::provisioningProfile(const QString &pro
|
||||
{
|
||||
QTC_CHECK(m_instance);
|
||||
m_instance->initializeProvisioningData();
|
||||
return Utils::findOrDefault(m_instance->m_provisioningProfiles,
|
||||
Utils::equal(&ProvisioningProfile::identifier, profileID));
|
||||
return findOrDefault(m_instance->m_provisioningProfiles,
|
||||
equal(&ProvisioningProfile::identifier, profileID));
|
||||
}
|
||||
|
||||
IosToolChainFactory::IosToolChainFactory()
|
||||
@@ -598,7 +598,7 @@ Toolchains IosToolChainFactory::autoDetect(const ToolchainDetector &detector) co
|
||||
for (const XcodePlatform::ToolchainTarget &target : platform.targets) {
|
||||
ToolChainPair platformToolchains = findToolChainForPlatform(platform, target,
|
||||
existingClangToolChains);
|
||||
auto createOrAdd = [&](ClangToolChain *toolChain, Utils::Id l) {
|
||||
auto createOrAdd = [&](ClangToolChain *toolChain, Id l) {
|
||||
if (!toolChain) {
|
||||
toolChain = new ClangToolChain;
|
||||
toolChain->setDetection(ToolChain::AutoDetection);
|
||||
|
||||
@@ -68,7 +68,7 @@ void XcodeProbe::detectDeveloperPaths()
|
||||
selectedXcode.setTimeoutS(5);
|
||||
selectedXcode.setCommand({"/usr/bin/xcode-select", {"--print-path"}});
|
||||
selectedXcode.runBlocking();
|
||||
if (selectedXcode.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (selectedXcode.result() != ProcessResult::FinishedWithSuccess)
|
||||
qCWarning(probeLog)
|
||||
<< QString::fromLatin1("Could not detect selected Xcode using xcode-select");
|
||||
else
|
||||
|
||||
@@ -88,7 +88,7 @@ static bool runCommand(const CommandLine &command, QString *stdOutput, QString *
|
||||
*stdOutput = p.stdOut();
|
||||
if (allOutput)
|
||||
*allOutput = p.allOutput();
|
||||
return p.result() == QtcProcess::FinishedWithSuccess;
|
||||
return p.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
static bool runSimCtlCommand(QStringList args, QString *output, QString *allOutput = nullptr)
|
||||
|
||||
@@ -128,7 +128,7 @@ bool MercurialClient::synchronousClone(const FilePath &workingDirectory,
|
||||
QStringList arguments(QLatin1String("init"));
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return false;
|
||||
|
||||
// Then pull remote repository
|
||||
@@ -136,7 +136,7 @@ bool MercurialClient::synchronousClone(const FilePath &workingDirectory,
|
||||
arguments << QLatin1String("pull") << dstLocation;
|
||||
QtcProcess proc1;
|
||||
vcsSynchronousExec(proc1, workingDirectory, arguments, flags);
|
||||
if (proc1.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc1.result() != ProcessResult::FinishedWithSuccess)
|
||||
return false;
|
||||
|
||||
// By now, there is no hgrc file -> create it
|
||||
@@ -153,13 +153,13 @@ bool MercurialClient::synchronousClone(const FilePath &workingDirectory,
|
||||
arguments << QLatin1String("update");
|
||||
QtcProcess proc2;
|
||||
vcsSynchronousExec(proc2, workingDirectory, arguments, flags);
|
||||
return proc2.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc2.result() == ProcessResult::FinishedWithSuccess;
|
||||
} else {
|
||||
QStringList arguments(QLatin1String("clone"));
|
||||
arguments << dstLocation << workingDirectory.parentDir().toString();
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, workingDirectory.parentDir(), arguments, flags);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ bool MercurialClient::synchronousPull(const FilePath &workingDir, const QString
|
||||
command.addFlags(flags);
|
||||
command.runCommand(proc, {vcsBinary(), args});
|
||||
|
||||
const bool ok = proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
const bool ok = proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
|
||||
parsePullOutput(proc.stdOut().trimmed());
|
||||
return ok;
|
||||
@@ -224,7 +224,7 @@ QStringList MercurialClient::parentRevisionsSync(const FilePath &workingDirector
|
||||
args << file;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return QStringList();
|
||||
/* Looks like: \code
|
||||
changeset: 0:031a48610fba
|
||||
@@ -267,7 +267,7 @@ QString MercurialClient::shortDescriptionSync(const FilePath &workingDirectory,
|
||||
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return revision;
|
||||
return stripLastNewline(proc.stdOut());
|
||||
}
|
||||
|
||||
@@ -36,32 +36,32 @@
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
|
||||
#include <coreplugin/locator/commandlocator.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
|
||||
#include <utils/commandline.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/parameteraction.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <vcsbase/basevcseditorfactory.h>
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcscommand.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QDebug>
|
||||
#include <QtGlobal>
|
||||
#include <QDir>
|
||||
#include <QDialog>
|
||||
#include <QFileDialog>
|
||||
#include <QMenu>
|
||||
#include <QtGlobal>
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
#include <QTest>
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
#include <projectexplorer/buildstep.h>
|
||||
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
namespace MesonProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
|
||||
@@ -1270,7 +1270,7 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki
|
||||
}
|
||||
process.setTimeOutMessageBoxEnabled(true);
|
||||
process.setCommand({m_settings.p4BinaryPath.filePath(), args});
|
||||
process.runBlocking(QtcProcess::WithEventLoop);
|
||||
process.runBlocking(EventLoopMode::On);
|
||||
|
||||
PerforceResponse response;
|
||||
response.error = true;
|
||||
@@ -1278,20 +1278,20 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki
|
||||
response.stdErr = process.stdErr();
|
||||
response.stdOut = process.stdOut();
|
||||
switch (process.result()) {
|
||||
case QtcProcess::FinishedWithSuccess:
|
||||
case ProcessResult::FinishedWithSuccess:
|
||||
response.error = false;
|
||||
break;
|
||||
case QtcProcess::FinishedWithError:
|
||||
case ProcessResult::FinishedWithError:
|
||||
response.message = msgExitCode(process.exitCode());
|
||||
response.error = !(flags & IgnoreExitCode);
|
||||
break;
|
||||
case QtcProcess::TerminatedAbnormally:
|
||||
case ProcessResult::TerminatedAbnormally:
|
||||
response.message = msgCrash();
|
||||
break;
|
||||
case QtcProcess::StartFailed:
|
||||
case ProcessResult::StartFailed:
|
||||
response.message = msgNotStarted(m_settings.p4BinaryPath.value());
|
||||
break;
|
||||
case QtcProcess::Hang:
|
||||
case ProcessResult::Hang:
|
||||
response.message = msgCrash();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -115,8 +115,8 @@ static bool
|
||||
qDebug("In %s, running:\n%s\n", qPrintable(workingDirectory.toUserOutput()),
|
||||
qPrintable(cmd.toUserOutput()));
|
||||
process.setCommand(cmd);
|
||||
process.runBlocking(QtcProcess::WithEventLoop);
|
||||
if (process.result() != Utils::QtcProcess::FinishedWithSuccess) {
|
||||
process.runBlocking(EventLoopMode::On);
|
||||
if (process.result() != Utils::ProcessResult::FinishedWithSuccess) {
|
||||
*errorMessage = QString("Generator script failed: %1").arg(process.exitMessage());
|
||||
const QString stdErr = process.stdErr();
|
||||
if (!stdErr.isEmpty()) {
|
||||
|
||||
@@ -146,7 +146,7 @@ static QByteArray runGcc(const FilePath &gcc, const QStringList &arguments, cons
|
||||
cpp.setTimeoutS(10);
|
||||
cpp.setCommand({gcc, arguments});
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess || cpp.exitCode() != 0) {
|
||||
if (cpp.result() != ProcessResult::FinishedWithSuccess || cpp.exitCode() != 0) {
|
||||
Core::MessageManager::writeFlashing({"Compiler feature detection failure!",
|
||||
cpp.exitMessage(),
|
||||
QString::fromUtf8(cpp.allRawOutput())});
|
||||
|
||||
@@ -265,21 +265,21 @@ static QVector<VisualStudioInstallation> detectVisualStudioFromVsWhere(const QSt
|
||||
{"-products", "*", "-prerelease", "-legacy", "-format", "json", "-utf8"}});
|
||||
vsWhereProcess.runBlocking();
|
||||
switch (vsWhereProcess.result()) {
|
||||
case QtcProcess::FinishedWithSuccess:
|
||||
case ProcessResult::FinishedWithSuccess:
|
||||
break;
|
||||
case QtcProcess::StartFailed:
|
||||
case ProcessResult::StartFailed:
|
||||
qWarning().noquote() << QDir::toNativeSeparators(vswhere) << "could not be started.";
|
||||
return installations;
|
||||
case QtcProcess::FinishedWithError:
|
||||
case ProcessResult::FinishedWithError:
|
||||
qWarning().noquote().nospace() << QDir::toNativeSeparators(vswhere)
|
||||
<< " finished with exit code "
|
||||
<< vsWhereProcess.exitCode() << ".";
|
||||
return installations;
|
||||
case QtcProcess::TerminatedAbnormally:
|
||||
case ProcessResult::TerminatedAbnormally:
|
||||
qWarning().noquote().nospace()
|
||||
<< QDir::toNativeSeparators(vswhere) << " crashed. Exit code: " << vsWhereProcess.exitCode();
|
||||
return installations;
|
||||
case QtcProcess::Hang:
|
||||
case ProcessResult::Hang:
|
||||
qWarning().noquote() << QDir::toNativeSeparators(vswhere) << "did not finish in" << timeoutS
|
||||
<< "seconds.";
|
||||
return installations;
|
||||
@@ -652,7 +652,7 @@ Macros MsvcToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
|
||||
arguments << toProcess << QLatin1String("/EP") << saver.filePath().toUserOutput();
|
||||
cpp.setCommand({binary, arguments});
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (cpp.result() != ProcessResult::FinishedWithSuccess)
|
||||
return predefinedMacros;
|
||||
|
||||
const QStringList output = Utils::filtered(cpp.stdOut().split('\n'),
|
||||
@@ -1555,7 +1555,7 @@ static QVersionNumber clangClVersion(const FilePath &clangClPath)
|
||||
QtcProcess clangClProcess;
|
||||
clangClProcess.setCommand({clangClPath, {"--version"}});
|
||||
clangClProcess.runBlocking();
|
||||
if (clangClProcess.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (clangClProcess.result() != ProcessResult::FinishedWithSuccess)
|
||||
return {};
|
||||
const QRegularExpressionMatch match = QRegularExpression(
|
||||
QStringLiteral("clang version (\\d+(\\.\\d+)+)"))
|
||||
@@ -1780,7 +1780,7 @@ Macros ClangClToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
|
||||
arguments.append("-");
|
||||
cpp.setCommand({compilerCommand(), arguments});
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != Utils::QtcProcess::FinishedWithSuccess) {
|
||||
if (cpp.result() != ProcessResult::FinishedWithSuccess) {
|
||||
// Show the warning but still parse the output.
|
||||
QTC_CHECK(false && "clang-cl exited with non-zero code.");
|
||||
}
|
||||
@@ -2128,7 +2128,7 @@ Utils::optional<QString> MsvcToolChain::generateEnvironmentSettings(const Utils:
|
||||
run.setCommand(cmd);
|
||||
run.runBlocking();
|
||||
|
||||
if (run.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (run.result() != ProcessResult::FinishedWithSuccess) {
|
||||
const QString message = !run.stdErr().isEmpty() ? run.stdErr() : run.exitMessage();
|
||||
qWarning().noquote() << message;
|
||||
QString command = QDir::toNativeSeparators(batchFile);
|
||||
|
||||
@@ -88,7 +88,7 @@ static QString pythonName(const FilePath &pythonPath)
|
||||
pythonProcess.setTimeoutS(2);
|
||||
pythonProcess.setCommand({pythonPath, {"--version"}});
|
||||
pythonProcess.runBlocking();
|
||||
if (pythonProcess.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (pythonProcess.result() != ProcessResult::FinishedWithSuccess)
|
||||
return {};
|
||||
name = pythonProcess.allOutput().trimmed();
|
||||
nameForPython[pythonPath] = name;
|
||||
@@ -601,7 +601,7 @@ private:
|
||||
void installFinished()
|
||||
{
|
||||
m_future.reportFinished();
|
||||
if (m_process.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (m_process.result() == ProcessResult::FinishedWithSuccess) {
|
||||
if (Client *client = registerLanguageServer(m_python))
|
||||
LanguageClientManager::openDocumentWithClient(m_document, client);
|
||||
} else {
|
||||
|
||||
@@ -283,7 +283,7 @@ Interpreter::Interpreter(const FilePath &python, const QString &defaultName, boo
|
||||
pythonProcess.setTimeoutS(1);
|
||||
pythonProcess.setCommand({python, {"--version"}});
|
||||
pythonProcess.runBlocking();
|
||||
if (pythonProcess.result() == QtcProcess::FinishedWithSuccess)
|
||||
if (pythonProcess.result() == ProcessResult::FinishedWithSuccess)
|
||||
name = pythonProcess.stdOut().trimmed();
|
||||
if (name.isEmpty())
|
||||
name = defaultName;
|
||||
|
||||
@@ -123,7 +123,7 @@ EnvironmentItems QnxUtils::qnxEnvironmentFromEnvFile(const FilePath &filePath)
|
||||
return items;
|
||||
}
|
||||
|
||||
if (process.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (process.result() != ProcessResult::FinishedWithSuccess)
|
||||
return items;
|
||||
|
||||
// parsing process output
|
||||
|
||||
@@ -94,7 +94,7 @@ bool SubversionClient::doCommit(const FilePath &repositoryRoot,
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, repositoryRoot, args << svnExtraOptions << escapeFiles(files),
|
||||
VcsCommand::ShowStdOut | VcsCommand::NoFullySync);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
void SubversionClient::commit(const FilePath &repositoryRoot,
|
||||
@@ -153,7 +153,7 @@ QString SubversionClient::synchronousTopic(const FilePath &repository) const
|
||||
svnVersionBinary.append(HostOsInfo::withExecutableSuffix("svnversion"));
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, repository, {FilePath::fromString(svnVersionBinary), args});
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return QString();
|
||||
|
||||
return proc.stdOut().trimmed();
|
||||
|
||||
@@ -1030,7 +1030,7 @@ SubversionResponse SubversionPluginPrivate::runSvn(const FilePath &workingDir,
|
||||
QtcProcess proc;
|
||||
m_client->vcsFullySynchronousExec(proc, workingDir, arguments, flags, timeOutS, outputCodec);
|
||||
|
||||
response.error = proc.result() != QtcProcess::FinishedWithSuccess;
|
||||
response.error = proc.result() != ProcessResult::FinishedWithSuccess;
|
||||
if (response.error)
|
||||
response.message = proc.exitMessage();
|
||||
response.stdErr = proc.stdErr();
|
||||
|
||||
@@ -92,7 +92,7 @@ static FormatTask format(FormatTask task)
|
||||
process.setTimeoutS(5);
|
||||
process.setCommand({FilePath::fromString(executable), options});
|
||||
process.runBlocking();
|
||||
if (process.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (process.result() != ProcessResult::FinishedWithSuccess) {
|
||||
task.error = QString(QT_TRANSLATE_NOOP("TextEditor", "Failed to format: %1."))
|
||||
.arg(process.exitMessage());
|
||||
return task;
|
||||
|
||||
@@ -70,7 +70,7 @@ FilePath findFallbackDefinitionsLocation()
|
||||
process.setTimeoutS(5);
|
||||
process.setCommand({program, {"--prefix"}});
|
||||
process.runBlocking();
|
||||
if (process.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (process.result() == ProcessResult::FinishedWithSuccess) {
|
||||
QString output = process.stdOut();
|
||||
output.remove('\n');
|
||||
const FilePath dir = FilePath::fromString(output);
|
||||
|
||||
@@ -145,7 +145,7 @@ void UpdateInfoPlugin::startCheckForUpdates()
|
||||
60 * 3, // 3 minutes timeout
|
||||
/*workingDirectory=*/{},
|
||||
[](int /*exitCode*/) {
|
||||
return Utils::QtcProcess::FinishedWithSuccess;
|
||||
return Utils::ProcessResult::FinishedWithSuccess;
|
||||
});
|
||||
if (d->m_settings.checkForQtVersions) {
|
||||
d->m_checkUpdatesCommand
|
||||
@@ -153,7 +153,7 @@ void UpdateInfoPlugin::startCheckForUpdates()
|
||||
{"se", "qt[.]qt[0-9][.][0-9]+$", "-g", "*=false,ifw.package.*=true"}},
|
||||
60 * 3, // 3 minutes timeout
|
||||
/*workingDirectory=*/{},
|
||||
[](int /*exitCode*/) { return Utils::QtcProcess::FinishedWithSuccess; });
|
||||
[](int /*exitCode*/) { return Utils::ProcessResult::FinishedWithSuccess; });
|
||||
}
|
||||
d->m_checkUpdatesCommand->execute();
|
||||
d->m_progress = d->m_checkUpdatesCommand->futureProgress();
|
||||
|
||||
@@ -258,7 +258,7 @@ bool VcsBaseClient::synchronousCreateRepository(const FilePath &workingDirectory
|
||||
args << extraOptions;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return false;
|
||||
VcsOutputWindow::append(proc.stdOut());
|
||||
|
||||
@@ -279,7 +279,7 @@ bool VcsBaseClient::synchronousClone(const FilePath &workingDir,
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
resetCachedVcsInfo(workingDir);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousAdd(const FilePath &workingDir,
|
||||
@@ -290,7 +290,7 @@ bool VcsBaseClient::synchronousAdd(const FilePath &workingDir,
|
||||
args << vcsCommandString(AddCommand) << extraOptions << relFileName;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousRemove(const FilePath &workingDir,
|
||||
@@ -301,7 +301,7 @@ bool VcsBaseClient::synchronousRemove(const FilePath &workingDir,
|
||||
args << vcsCommandString(RemoveCommand) << extraOptions << filename;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousMove(const FilePath &workingDir,
|
||||
@@ -313,7 +313,7 @@ bool VcsBaseClient::synchronousMove(const FilePath &workingDir,
|
||||
args << vcsCommandString(MoveCommand) << extraOptions << from << to;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousPull(const FilePath &workingDir,
|
||||
@@ -329,7 +329,7 @@ bool VcsBaseClient::synchronousPull(const FilePath &workingDir,
|
||||
| VcsCommand::ShowSuccessMessage;
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, workingDir, args, flags);
|
||||
const bool ok = proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
const bool ok = proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
if (ok)
|
||||
emit changed(QVariant(workingDir.toString()));
|
||||
return ok;
|
||||
@@ -348,7 +348,7 @@ bool VcsBaseClient::synchronousPush(const FilePath &workingDir,
|
||||
| VcsCommand::ShowSuccessMessage;
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, workingDir, args, flags);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
VcsBaseEditorWidget *VcsBaseClient::annotate(
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/id.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/processenums.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
@@ -41,9 +41,12 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QFileInfo;
|
||||
class QTextCodec;
|
||||
class QToolBar;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils { class QtcProcess; }
|
||||
|
||||
namespace VcsBase {
|
||||
|
||||
class VcsCommand;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <diffeditor/diffutils.h>
|
||||
|
||||
#include <utils/commandline.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/runextensions.h>
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <projectexplorer/jsonwizard/jsonwizard.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/commandline.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QDir>
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/portlist.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
@@ -46,7 +47,6 @@
|
||||
using QtSupport::QtVersion;
|
||||
using QtSupport::QtVersionManager;
|
||||
|
||||
|
||||
using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
@@ -61,9 +61,9 @@ WinRtDevice::WinRtDevice()
|
||||
setDisplayType(displayNameForType(type()));
|
||||
setOsType(OsTypeWindows);
|
||||
|
||||
Utils::PortList portList;
|
||||
portList.addRange(Utils::Port(ProjectExplorer::Constants::DESKTOP_PORT_START),
|
||||
Utils::Port(ProjectExplorer::Constants::DESKTOP_PORT_END));
|
||||
PortList portList;
|
||||
portList.addRange(Port(ProjectExplorer::Constants::DESKTOP_PORT_START),
|
||||
Port(ProjectExplorer::Constants::DESKTOP_PORT_END));
|
||||
setFreePorts(portList);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ QVariantMap WinRtDevice::toMap() const
|
||||
return map;
|
||||
}
|
||||
|
||||
QString WinRtDevice::displayNameForType(Utils::Id type)
|
||||
QString WinRtDevice::displayNameForType(Id type)
|
||||
{
|
||||
if (type == Constants::WINRT_DEVICE_TYPE_LOCAL)
|
||||
return QCoreApplication::translate("WinRt::Internal::WinRtDevice",
|
||||
@@ -114,7 +114,7 @@ QString WinRtDevice::displayNameForType(Utils::Id type)
|
||||
|
||||
// Factory
|
||||
|
||||
WinRtDeviceFactory::WinRtDeviceFactory(Utils::Id deviceType)
|
||||
WinRtDeviceFactory::WinRtDeviceFactory(Id deviceType)
|
||||
: ProjectExplorer::IDeviceFactory(deviceType)
|
||||
{
|
||||
if (allPrerequisitesLoaded()) {
|
||||
@@ -143,7 +143,7 @@ void WinRtDeviceFactory::autoDetect()
|
||||
|
||||
if (!m_process) {
|
||||
qCDebug(winrtDeviceLog) << __FUNCTION__ << "Creating process";
|
||||
m_process = new Utils::QtcProcess(this);
|
||||
m_process = new QtcProcess(this);
|
||||
connect(m_process, &QtcProcess::errorOccurred, this, &WinRtDeviceFactory::onProcessError);
|
||||
connect(m_process, &QtcProcess::finished, this, &WinRtDeviceFactory::onProcessFinished);
|
||||
}
|
||||
@@ -310,7 +310,7 @@ void WinRtDeviceFactory::parseRunnerOutput(const QByteArray &output) const
|
||||
}
|
||||
|
||||
const IDevice::MachineType machineType = machineTypeFromLine(line);
|
||||
Utils::Id deviceType;
|
||||
Id deviceType;
|
||||
QString name;
|
||||
QString internalName = QStringLiteral("WinRT.");
|
||||
if (state == AppxState) {
|
||||
@@ -333,7 +333,7 @@ void WinRtDeviceFactory::parseRunnerOutput(const QByteArray &output) const
|
||||
deviceType = Constants::WINRT_DEVICE_TYPE_PHONE;
|
||||
}
|
||||
internalName += QString::number(deviceId);
|
||||
const Utils::Id internalId = Utils::Id::fromString(internalName);
|
||||
const Id internalId = Id::fromString(internalName);
|
||||
++numFound;
|
||||
if (DeviceManager::instance()->find(internalId)) {
|
||||
qCDebug(winrtDeviceLog) << __FUNCTION__ << "Skipping device with ID" << deviceId;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <projectexplorer/devicesupport/idevice.h>
|
||||
#include <projectexplorer/devicesupport/idevicefactory.h>
|
||||
|
||||
#include <utils/qtcprocess.h>
|
||||
namespace Utils { class QtcProcess; }
|
||||
|
||||
namespace WinRt {
|
||||
namespace Internal {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "winrtdevice.h"
|
||||
|
||||
#include <projectexplorer/runcontrol.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
namespace WinRt {
|
||||
namespace Internal {
|
||||
@@ -52,7 +51,6 @@ private:
|
||||
void onProcessError();
|
||||
|
||||
State m_state = StoppedState;
|
||||
Utils::QtcProcess *m_process = nullptr;
|
||||
WinRtRunnerHelper *m_runner = nullptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -935,7 +935,7 @@ void tst_QtcProcess::exitCode()
|
||||
|
||||
QVERIFY(finished);
|
||||
QCOMPARE(qtcP.exitCode(), exitCode);
|
||||
QCOMPARE(qtcP.exitCode() == 0, qtcP.result() == QtcProcess::FinishedWithSuccess);
|
||||
QCOMPARE(qtcP.exitCode() == 0, qtcP.result() == ProcessResult::FinishedWithSuccess);
|
||||
}
|
||||
{
|
||||
QtcProcess sP;
|
||||
@@ -944,7 +944,7 @@ void tst_QtcProcess::exitCode()
|
||||
sP.runBlocking();
|
||||
|
||||
QCOMPARE(sP.exitCode(), exitCode);
|
||||
QCOMPARE(sP.exitCode() == 0, sP.result() == QtcProcess::FinishedWithSuccess);
|
||||
QCOMPARE(sP.exitCode() == 0, sP.result() == ProcessResult::FinishedWithSuccess);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -989,7 +989,7 @@ void tst_QtcProcess::runBlockingStdOut()
|
||||
// See also QTCREATORBUG-25667 for why it is a bad idea to use QtcProcess::runBlocking
|
||||
// with interactive cli tools.
|
||||
QEXPECT_FAIL("Unterminated stdout lost: early timeout", "", Continue);
|
||||
QVERIFY2(sp.result() != QtcProcess::Hang, "Process run did not time out.");
|
||||
QVERIFY2(sp.result() != ProcessResult::Hang, "Process run did not time out.");
|
||||
QEXPECT_FAIL("Unterminated stdout lost: early timeout", "", Continue);
|
||||
QVERIFY2(readLastLine, "Last line was read.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user