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