Commit 3410fee6 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Ios: Use Qt5-style connects

The heavy lifting was done by clazy.

Change-Id: I1b25f0108939d87e859d0407a35f75b88fa0edc3
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent a21e71ec
...@@ -89,13 +89,12 @@ public: ...@@ -89,13 +89,12 @@ public:
QString displayName() const override; QString displayName() const override;
QString summaryText() const override; QString summaryText() const override;
private slots: private:
void buildArgumentsChanged(); void buildArgumentsChanged();
void resetDefaultArguments(); void resetDefaultArguments();
void extraArgumentsChanged(); void extraArgumentsChanged();
void updateDetails(); void updateDetails();
private:
Ui::IosBuildStep *m_ui; Ui::IosBuildStep *m_ui;
IosBuildStep *m_buildStep; IosBuildStep *m_buildStep;
QString m_summaryText; QString m_summaryText;
......
...@@ -344,7 +344,8 @@ void IosConfigurations::setDeveloperPath(const FileName &devPath) ...@@ -344,7 +344,8 @@ void IosConfigurations::setDeveloperPath(const FileName &devPath)
m_instance->save(); m_instance->save();
if (!hasDevPath && !devPath.isEmpty()) { if (!hasDevPath && !devPath.isEmpty()) {
hasDevPath = true; hasDevPath = true;
QTimer::singleShot(1000, IosDeviceManager::instance(), SLOT(monitorAvailableDevices())); QTimer::singleShot(1000, IosDeviceManager::instance(),
&IosDeviceManager::monitorAvailableDevices);
m_instance->updateSimulators(); m_instance->updateSimulators();
} }
emit m_instance->updated(); emit m_instance->updated();
......
...@@ -60,13 +60,11 @@ public: ...@@ -60,13 +60,11 @@ public:
static void setIgnoreAllDevices(bool ignoreDevices); static void setIgnoreAllDevices(bool ignoreDevices);
static Utils::FileName developerPath(); static Utils::FileName developerPath();
static Utils::FileName lldbPath(); static Utils::FileName lldbPath();
static void updateAutomaticKitList();
signals: signals:
void updated(); void updated();
public slots:
static void updateAutomaticKitList();
private: private:
IosConfigurations(QObject *parent); IosConfigurations(QObject *parent);
void load(); void load();
......
...@@ -77,10 +77,10 @@ void IosDeployStep::ctor() ...@@ -77,10 +77,10 @@ void IosDeployStep::ctor()
m_transferStatus = NoTransfer; m_transferStatus = NoTransfer;
cleanup(); cleanup();
updateDisplayNames(); updateDisplayNames();
connect(DeviceManager::instance(), SIGNAL(updated()), connect(DeviceManager::instance(), &DeviceManager::updated,
SLOT(updateDisplayNames())); this, &IosDeployStep::updateDisplayNames);
connect(target(), SIGNAL(kitChanged()), connect(target(), &Target::kitChanged,
SLOT(updateDisplayNames())); this, &IosDeployStep::updateDisplayNames);
} }
void IosDeployStep::updateDisplayNames() void IosDeployStep::updateDisplayNames()
...@@ -127,14 +127,14 @@ void IosDeployStep::run(QFutureInterface<bool> &fi) ...@@ -127,14 +127,14 @@ void IosDeployStep::run(QFutureInterface<bool> &fi)
m_futureInterface.setProgressRange(0, 200); m_futureInterface.setProgressRange(0, 200);
m_futureInterface.setProgressValueAndText(0, QLatin1String("Transferring application")); m_futureInterface.setProgressValueAndText(0, QLatin1String("Transferring application"));
m_futureInterface.reportStarted(); m_futureInterface.reportStarted();
connect(m_toolHandler, SIGNAL(isTransferringApp(Ios::IosToolHandler*,QString,QString,int,int,QString)), connect(m_toolHandler, &IosToolHandler::isTransferringApp,
SLOT(handleIsTransferringApp(Ios::IosToolHandler*,QString,QString,int,int,QString))); this, &IosDeployStep::handleIsTransferringApp);
connect(m_toolHandler, SIGNAL(didTransferApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus)), connect(m_toolHandler, &IosToolHandler::didTransferApp,
SLOT(handleDidTransferApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus))); this, &IosDeployStep::handleDidTransferApp);
connect(m_toolHandler, SIGNAL(finished(Ios::IosToolHandler*)), connect(m_toolHandler, &IosToolHandler::finished,
SLOT(handleFinished(Ios::IosToolHandler*))); this, &IosDeployStep::handleFinished);
connect(m_toolHandler, SIGNAL(errorMsg(Ios::IosToolHandler*,QString)), connect(m_toolHandler, &IosToolHandler::errorMsg,
SLOT(handleErrorMsg(Ios::IosToolHandler*,QString))); this, &IosDeployStep::handleErrorMsg);
checkProvisioningProfile(); checkProvisioningProfile();
m_toolHandler->requestTransferApp(appBundle(), deviceId()); m_toolHandler->requestTransferApp(appBundle(), deviceId());
} }
......
...@@ -71,7 +71,7 @@ signals: ...@@ -71,7 +71,7 @@ signals:
//void done(); //void done();
//void error(); //void error();
private slots: private:
void handleIsTransferringApp(Ios::IosToolHandler *handler, const QString &bundlePath, void handleIsTransferringApp(Ios::IosToolHandler *handler, const QString &bundlePath,
const QString &deviceId, int progress, int maxProgress, const QString &deviceId, int progress, int maxProgress,
const QString &info); const QString &info);
...@@ -80,9 +80,7 @@ private slots: ...@@ -80,9 +80,7 @@ private slots:
void handleFinished(Ios::IosToolHandler *handler); void handleFinished(Ios::IosToolHandler *handler);
void handleErrorMsg(Ios::IosToolHandler *handler, const QString &msg); void handleErrorMsg(Ios::IosToolHandler *handler, const QString &msg);
void updateDisplayNames(); void updateDisplayNames();
private: IosDeployStep(ProjectExplorer::BuildStepList *bc, IosDeployStep *other);
IosDeployStep(ProjectExplorer::BuildStepList *bc,
IosDeployStep *other);
bool init(QList<const BuildStep *> &earlierSteps) override; bool init(QList<const BuildStep *> &earlierSteps) override;
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
bool immutable() const override { return true; } bool immutable() const override { return true; }
...@@ -97,7 +95,7 @@ private: ...@@ -97,7 +95,7 @@ private:
void raiseError(const QString &error); void raiseError(const QString &error);
void writeOutput(const QString &text, OutputFormat = MessageOutput); void writeOutput(const QString &text, OutputFormat = MessageOutput);
void checkProvisioningProfile(); void checkProvisioningProfile();
private:
TransferStatus m_transferStatus; TransferStatus m_transferStatus;
IosToolHandler *m_toolHandler; IosToolHandler *m_toolHandler;
QFutureInterface<bool> m_futureInterface; QFutureInterface<bool> m_futureInterface;
......
...@@ -42,7 +42,8 @@ IosDeployStepWidget::IosDeployStepWidget(IosDeployStep *step) : ...@@ -42,7 +42,8 @@ IosDeployStepWidget::IosDeployStepWidget(IosDeployStep *step) :
m_step(step) m_step(step)
{ {
ui->setupUi(this); ui->setupUi(this);
connect(m_step, SIGNAL(displayNameChanged()), SIGNAL(updateSummary())); connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged,
this, &ProjectExplorer::BuildStepConfigWidget::updateSummary);
} }
IosDeployStepWidget::~IosDeployStepWidget() IosDeployStepWidget::~IosDeployStepWidget()
......
...@@ -288,10 +288,10 @@ void IosDeviceManager::deviceDisconnected(const QString &uid) ...@@ -288,10 +288,10 @@ void IosDeviceManager::deviceDisconnected(const QString &uid)
void IosDeviceManager::updateInfo(const QString &devId) void IosDeviceManager::updateInfo(const QString &devId)
{ {
IosToolHandler *requester = new IosToolHandler(IosDeviceType(IosDeviceType::IosDevice), this); IosToolHandler *requester = new IosToolHandler(IosDeviceType(IosDeviceType::IosDevice), this);
connect(requester, SIGNAL(deviceInfo(Ios::IosToolHandler*,QString,Ios::IosToolHandler::Dict)), connect(requester, &IosToolHandler::deviceInfo,
SLOT(deviceInfo(Ios::IosToolHandler*,QString,Ios::IosToolHandler::Dict)), Qt::QueuedConnection); this, &IosDeviceManager::deviceInfo, Qt::QueuedConnection);
connect(requester, SIGNAL(finished(Ios::IosToolHandler*)), connect(requester, &IosToolHandler::finished,
SLOT(infoGathererFinished(Ios::IosToolHandler*))); this, &IosDeviceManager::infoGathererFinished);
requester->requestDeviceInfo(devId); requester->requestDeviceInfo(devId);
} }
...@@ -518,8 +518,8 @@ IosDeviceManager::IosDeviceManager(QObject *parent) : ...@@ -518,8 +518,8 @@ IosDeviceManager::IosDeviceManager(QObject *parent) :
{ {
m_userModeDevicesTimer.setSingleShot(true); m_userModeDevicesTimer.setSingleShot(true);
m_userModeDevicesTimer.setInterval(8000); m_userModeDevicesTimer.setInterval(8000);
connect(&m_userModeDevicesTimer, SIGNAL(timeout()), connect(&m_userModeDevicesTimer, &QTimer::timeout,
SLOT(updateUserModeDevices())); this, &IosDeviceManager::updateUserModeDevices);
} }
void IosDeviceManager::updateUserModeDevices() void IosDeviceManager::updateUserModeDevices()
......
...@@ -93,16 +93,13 @@ public: ...@@ -93,16 +93,13 @@ public:
void deviceConnected(const QString &uid, const QString &name = QString()); void deviceConnected(const QString &uid, const QString &name = QString());
void deviceDisconnected(const QString &uid); void deviceDisconnected(const QString &uid);
friend class IosConfigurations; friend class IosConfigurations;
public slots:
void updateInfo(const QString &devId); void updateInfo(const QString &devId);
//private slots:
void deviceInfo(Ios::IosToolHandler *gatherer, const QString &deviceId, void deviceInfo(Ios::IosToolHandler *gatherer, const QString &deviceId,
const Ios::IosToolHandler::Dict &info); const Ios::IosToolHandler::Dict &info);
void infoGathererFinished(Ios::IosToolHandler *gatherer); void infoGathererFinished(Ios::IosToolHandler *gatherer);
void monitorAvailableDevices(); void monitorAvailableDevices();
private slots:
void updateUserModeDevices();
private: private:
void updateUserModeDevices();
IosDeviceManager(QObject *parent = 0); IosDeviceManager(QObject *parent = 0);
QTimer m_userModeDevicesTimer; QTimer m_userModeDevicesTimer;
QStringList m_userModeDeviceIds; QStringList m_userModeDeviceIds;
......
...@@ -81,13 +81,12 @@ public: ...@@ -81,13 +81,12 @@ public:
QString displayName() const override; QString displayName() const override;
QString summaryText() const override; QString summaryText() const override;
private slots: private:
void commandChanged(); void commandChanged();
void argumentsChanged(); void argumentsChanged();
void resetDefaults(); void resetDefaults();
void updateDetails(); void updateDetails();
private:
Ui::IosPresetBuildStep *m_ui; Ui::IosPresetBuildStep *m_ui;
IosPresetBuildStep *m_buildStep; IosPresetBuildStep *m_buildStep;
QString m_summaryText; QString m_summaryText;
......
...@@ -81,19 +81,19 @@ bool IosPlugin::initialize(const QStringList &arguments, QString *errorMessage) ...@@ -81,19 +81,19 @@ bool IosPlugin::initialize(const QStringList &arguments, QString *errorMessage)
void IosPlugin::extensionsInitialized() void IosPlugin::extensionsInitialized()
{ {
connect(ProjectExplorer::KitManager::instance(), SIGNAL(kitsLoaded()), connect(ProjectExplorer::KitManager::instance(), &ProjectExplorer::KitManager::kitsLoaded,
this, SLOT(kitsRestored())); this, &IosPlugin::kitsRestored);
} }
void IosPlugin::kitsRestored() void IosPlugin::kitsRestored()
{ {
disconnect(ProjectExplorer::KitManager::instance(), SIGNAL(kitsLoaded()), disconnect(ProjectExplorer::KitManager::instance(), &ProjectExplorer::KitManager::kitsLoaded,
this, SLOT(kitsRestored())); this, &IosPlugin::kitsRestored);
Internal::IosConfigurations::updateAutomaticKitList(); Internal::IosConfigurations::updateAutomaticKitList();
connect(QtSupport::QtVersionManager::instance(), connect(QtSupport::QtVersionManager::instance(),
SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), &QtSupport::QtVersionManager::qtVersionsChanged,
Internal::IosConfigurations::instance(), Internal::IosConfigurations::instance(),
SLOT(updateAutomaticKitList())); &Internal::IosConfigurations::updateAutomaticKitList);
} }
} // namespace Ios } // namespace Ios
...@@ -39,7 +39,7 @@ public: ...@@ -39,7 +39,7 @@ public:
bool initialize(const QStringList &arguments, QString *errorMessage) override; bool initialize(const QStringList &arguments, QString *errorMessage) override;
void extensionsInitialized() override; void extensionsInitialized() override;
private slots: private:
void kitsRestored(); void kitsRestored();
}; };
......
...@@ -71,12 +71,12 @@ public: ...@@ -71,12 +71,12 @@ public:
protected: protected:
IosRunConfiguration(ProjectExplorer::Target *parent, IosRunConfiguration *source); IosRunConfiguration(ProjectExplorer::Target *parent, IosRunConfiguration *source);
private slots:
void proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress);
void deviceChanges();
signals: signals:
void localExecutableChanged(); void localExecutableChanged();
private: private:
void proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress);
void deviceChanges();
void init(); void init();
void enabledCheck(); void enabledCheck();
friend class IosRunConfigurationWidget; friend class IosRunConfigurationWidget;
......
...@@ -56,12 +56,12 @@ void IosRunControl::start() ...@@ -56,12 +56,12 @@ void IosRunControl::start()
emit started(); emit started();
disconnect(m_runner, 0, this, 0); disconnect(m_runner, 0, this, 0);
connect(m_runner, SIGNAL(errorMsg(QString)), connect(m_runner, &IosRunner::errorMsg,
SLOT(handleRemoteErrorOutput(QString))); this, &IosRunControl::handleRemoteErrorOutput);
connect(m_runner, SIGNAL(appOutput(QString)), connect(m_runner, &IosRunner::appOutput,
SLOT(handleRemoteOutput(QString))); this, &IosRunControl::handleRemoteOutput);
connect(m_runner, SIGNAL(finished(bool)), connect(m_runner, &IosRunner::finished,
SLOT(handleRemoteProcessFinished(bool))); this, &IosRunControl::handleRemoteProcessFinished);
appendMessage(tr("Starting remote process.") + QLatin1Char('\n'), Utils::NormalMessageFormat); appendMessage(tr("Starting remote process.") + QLatin1Char('\n'), Utils::NormalMessageFormat);
m_runner->start(); m_runner->start();
} }
......
...@@ -47,12 +47,11 @@ public: ...@@ -47,12 +47,11 @@ public:
bool isRunning() const override; bool isRunning() const override;
QString displayName() const override; QString displayName() const override;
private slots: private:
void handleRemoteProcessFinished(bool cleanEnd); void handleRemoteProcessFinished(bool cleanEnd);
void handleRemoteOutput(const QString &output); void handleRemoteOutput(const QString &output);
void handleRemoteErrorOutput(const QString &output); void handleRemoteErrorOutput(const QString &output);
private:
IosRunner *const m_runner; IosRunner *const m_runner;
bool m_running; bool m_running;
}; };
......
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
IosToolHandler::RunKind runType(); IosToolHandler::RunKind runType();
bool cppDebug() const; bool cppDebug() const;
QmlDebug::QmlDebugServicesPreset qmlDebugServices() const; QmlDebug::QmlDebugServicesPreset qmlDebugServices() const;
public slots:
void start(); void start();
void stop(); void stop();
......
...@@ -49,8 +49,6 @@ public: ...@@ -49,8 +49,6 @@ public:
void saveSettings(); void saveSettings();
private slots:
private: private:
void initGui(); void initGui();
......
...@@ -51,21 +51,4 @@ ...@@ -51,21 +51,4 @@
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>
<slots>
<slot>sdkLocationEditingFinished()</slot>
<slot>ndkLocationEditingFinished()</slot>
<slot>browseSDKLocation()</slot>
<slot>browseNDKLocation()</slot>
<slot>antLocationEditingFinished()</slot>
<slot>browseAntLocation()</slot>
<slot>addAVD()</slot>
<slot>removeAVD()</slot>
<slot>startAVD()</slot>
<slot>avdActivated(QModelIndex)</slot>
<slot>dataPartitionSizeEditingFinished()</slot>
<slot>openJDKLocationEditingFinished()</slot>
<slot>browseOpenJDKLocation()</slot>
<slot>manageAVD()</slot>
<slot>createKitToggled()</slot>
</slots>
</ui> </ui>
...@@ -226,13 +226,16 @@ IosToolHandlerPrivate::IosToolHandlerPrivate(const IosDeviceType &devType, ...@@ -226,13 +226,16 @@ IosToolHandlerPrivate::IosToolHandlerPrivate(const IosDeviceType &devType,
env.insert(QLatin1String("DYLD_FALLBACK_FRAMEWORK_PATH"), frameworkPaths.join(QLatin1Char(':'))); env.insert(QLatin1String("DYLD_FALLBACK_FRAMEWORK_PATH"), frameworkPaths.join(QLatin1Char(':')));
qCDebug(toolHandlerLog) << "IosToolHandler runEnv:" << env.toStringList(); qCDebug(toolHandlerLog) << "IosToolHandler runEnv:" << env.toStringList();
process.setProcessEnvironment(env); process.setProcessEnvironment(env);
QObject::connect(&process, SIGNAL(readyReadStandardOutput()), q, SLOT(subprocessHasData())); QObject::connect(&process, &QProcess::readyReadStandardOutput,
QObject::connect(&process, SIGNAL(finished(int,QProcess::ExitStatus)), q, &IosToolHandler::subprocessHasData);
q, SLOT(subprocessFinished(int,QProcess::ExitStatus))); QObject::connect(&process,
QObject::connect(&process, SIGNAL(error(QProcess::ProcessError)), static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
q, SLOT(subprocessError(QProcess::ProcessError))); q, &IosToolHandler::subprocessFinished);
QObject::connect(&killTimer, SIGNAL(timeout()), QObject::connect(&process,
q, SLOT(killProcess())); static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
q, &IosToolHandler::subprocessError);
QObject::connect(&killTimer, &QTimer::timeout,
q, &IosToolHandler::killProcess);
} }
bool IosToolHandlerPrivate::isRunning() bool IosToolHandlerPrivate::isRunning()
......
...@@ -65,6 +65,8 @@ public: ...@@ -65,6 +65,8 @@ public:
const QString &deviceId, int timeout = 1000); const QString &deviceId, int timeout = 1000);
void requestDeviceInfo(const QString &deviceId, int timeout = 1000); void requestDeviceInfo(const QString &deviceId, int timeout = 1000);
bool isRunning(); bool isRunning();
void stop();
signals: signals:
void isTransferringApp(Ios::IosToolHandler *handler, const QString &bundlePath, void isTransferringApp(Ios::IosToolHandler *handler, const QString &bundlePath,
const QString &deviceId, int progress, int maxProgress, const QString &deviceId, int progress, int maxProgress,
...@@ -83,9 +85,7 @@ signals: ...@@ -83,9 +85,7 @@ signals:
void errorMsg(Ios::IosToolHandler *handler, const QString &msg); void errorMsg(Ios::IosToolHandler *handler, const QString &msg);
void toolExited(Ios::IosToolHandler *handler, int code); void toolExited(Ios::IosToolHandler *handler, int code);
void finished(Ios::IosToolHandler *handler); void finished(Ios::IosToolHandler *handler);
public slots: private:
void stop();
private slots:
void subprocessError(QProcess::ProcessError error); void subprocessError(QProcess::ProcessError error);
void subprocessFinished(int exitCode, QProcess::ExitStatus exitStatus); void subprocessFinished(int exitCode, QProcess::ExitStatus exitStatus);
void subprocessHasData(); void subprocessHasData();
......
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