Commit dfe8bb0d authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

WinRT: Use Qt5-style connects



The heavy lifting was done by clazy.

Change-Id: Iaa91215dd9f3adb44f39839901de56c07f0c8702
Reviewed-by: Maurice Kalinowski's avatarMaurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 35c17ac7
......@@ -53,7 +53,7 @@ WinRtDebugSupport::WinRtDebugSupport(RunControl *runControl, WinRtRunnerHelper *
, m_debugRunControl(runControl)
, m_runner(runner)
{
connect(m_debugRunControl, SIGNAL(finished()), this, SLOT(finish()));
connect(m_debugRunControl, &RunControl::finished, this, &WinRtDebugSupport::finish);
}
bool WinRtDebugSupport::useQmlDebugging(WinRtRunConfiguration *runConfig)
......
......@@ -47,14 +47,13 @@ public:
private:
WinRtDebugSupport(ProjectExplorer::RunControl *runControl, WinRtRunnerHelper *runner);
void finish();
static bool useQmlDebugging(WinRtRunConfiguration *runConfig);
static bool getFreePort(Utils::Port &qmlDebuggerPort, QString *errorMessage);
ProjectExplorer::RunControl *m_debugRunControl;
WinRtRunnerHelper *m_runner;
private slots:
void finish();
};
} // namespace Internal
......
......@@ -102,9 +102,12 @@ void WinRtDeviceFactory::autoDetect()
if (!m_process) {
m_process = new Utils::QtcProcess(this);
connect(m_process, SIGNAL(error(QProcess::ProcessError)), SLOT(onProcessError()));
connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)),
SLOT(onProcessFinished(int,QProcess::ExitStatus)));
connect(m_process,
static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
this, &WinRtDeviceFactory::onProcessError);
connect(m_process,
static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
this, &WinRtDeviceFactory::onProcessFinished);
}
const QString args = QStringLiteral("--list-devices");
......
......@@ -43,15 +43,13 @@ public:
bool canRestore(const QVariantMap &map) const;
ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const;
public slots:
void autoDetect();
void onPrerequisitesLoaded();
private slots:
private:
void onProcessError();
void onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
private:
static bool allPrerequisitesLoaded();
QString findRunnerFilePath() const;
void parseRunnerOutput(const QByteArray &output) const;
......
......@@ -44,11 +44,10 @@ public:
virtual QString summaryText() const;
virtual QString displayName() const;
private slots:
private:
void on_btnRestoreDefaultArgs_clicked();
void on_leArguments_textChanged(QString str);
private:
Ui::WinRtPackageDeploymentStepWidget *m_ui;
WinRtPackageDeploymentStep *m_step;
};
......
......@@ -45,14 +45,12 @@ public:
const QString &proFilePath() const { return m_proFilePath; }
QString arguments() const;
bool uninstallAfterStop() const { return m_uninstallAfterStop; }
void setUninstallAfterStop(bool b);
signals:
void argumentsChanged(QString);
void uninstallAfterStopChanged(bool);
public slots:
void setUninstallAfterStop(bool b);
private:
QString m_proFilePath;
bool m_uninstallAfterStop;
......
......@@ -108,9 +108,9 @@ bool WinRtRunControl::startWinRtRunner()
{
QTC_ASSERT(!m_runner, return false);
m_runner = new WinRtRunnerHelper(this);
connect(m_runner, SIGNAL(started()), SLOT(onProcessStarted()));
connect(m_runner, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(onProcessFinished()));
connect(m_runner, SIGNAL(error(QProcess::ProcessError)), SLOT(onProcessError()));
connect(m_runner, &WinRtRunnerHelper::started, this, &WinRtRunControl::onProcessStarted);
connect(m_runner, &WinRtRunnerHelper::finished, this, &WinRtRunControl::onProcessFinished);
connect(m_runner, &WinRtRunnerHelper::error, this, &WinRtRunControl::onProcessError);
m_state = StartingState;
m_runner->start();
return true;
......
......@@ -54,13 +54,12 @@ public:
StopResult stop() override;
bool isRunning() const override;
private slots:
private:
enum State { StartingState, StartedState, StoppedState };
void onProcessStarted();
void onProcessFinished();
void onProcessError();
private:
enum State { StartingState, StartedState, StoppedState };
bool startWinRtRunner();
WinRtRunConfiguration *m_runConfiguration;
......
......@@ -228,13 +228,14 @@ void WinRtRunnerHelper::startWinRtRunner(const RunConf &conf)
appendMessage(QStringLiteral("winrtrunner ") + runnerArgs + QLatin1Char('\n'), NormalMessageFormat);
if (connectProcess) {
connect(process, SIGNAL(started()), SIGNAL(started()));
connect(process, SIGNAL(finished(int,QProcess::ExitStatus)),
SLOT(onProcessFinished(int,QProcess::ExitStatus)));
connect(process, SIGNAL(error(QProcess::ProcessError)),
SLOT(onProcessError(QProcess::ProcessError)));
connect(process, SIGNAL(readyReadStandardOutput()), SLOT(onProcessReadyReadStdOut()));
connect(process, SIGNAL(readyReadStandardError()), SLOT(onProcessReadyReadStdErr()));
connect(process, &QProcess::started, this, &WinRtRunnerHelper::started);
connect(process,
static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
this, &WinRtRunnerHelper::onProcessFinished);
connect(process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
this, &WinRtRunnerHelper::onProcessError);
connect(process, &QProcess::readyReadStandardOutput, this, &WinRtRunnerHelper::onProcessReadyReadStdOut);
connect(process, &QProcess::readyReadStandardError, this, &WinRtRunnerHelper::onProcessReadyReadStdErr);
}
process->setUseCtrlCStub(true);
......
......@@ -63,14 +63,14 @@ signals:
void finished(int exitCode, QProcess::ExitStatus exitStatus);
void error(QProcess::ProcessError error);
private slots:
private:
enum RunConf { Start, Stop, Debug };
void onProcessReadyReadStdOut();
void onProcessReadyReadStdErr();
void onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
void onProcessError(QProcess::ProcessError processError);
private:
enum RunConf { Start, Stop, Debug };
void startWinRtRunner(const RunConf &conf);
bool init(WinRtRunConfiguration *runConfiguration, QString *errorMessage);
void appendMessage(const QString &message, Utils::OutputFormat format);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment