diff options
author | hjk <hjk@qt.io> | 2020-01-15 08:56:11 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2020-01-20 10:11:59 +0000 |
commit | 0334b6e491a3688f2455e075595afde87b8f76af (patch) | |
tree | cc63a1fae976a46ea6ddc5d2cb956d1d7ac37516 /src/plugins/ios | |
parent | 7e19d1af7c356dae703e110f9d24b75429ef8fb5 (diff) |
ProjectManager: Add convenience Task subclasses
For Compile, BuildSystem and Deployment. Unclutters user code and reduces
binary size.
Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/ios')
-rw-r--r-- | src/plugins/ios/iosdeploystep.cpp | 24 | ||||
-rw-r--r-- | src/plugins/ios/iosrunner.cpp | 24 |
2 files changed, 18 insertions, 30 deletions
diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index fcdd6c4020..329fab7bfd 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -105,8 +105,8 @@ void IosDeployStep::doRun() { QTC_CHECK(m_transferStatus == NoTransfer); if (device().isNull()) { - TaskHub::addTask(Task::Error, tr("Deployment failed. No iOS device found."), - ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); + TaskHub::addTask( + DeploymentTask(Task::Error, tr("Deployment failed. No iOS device found."))); emit finished(!iossimulator().isNull()); cleanup(); return; @@ -160,9 +160,8 @@ void IosDeployStep::handleDidTransferApp(IosToolHandler *handler, const QString } else { m_transferStatus = TransferFailed; if (!m_expectFail) - TaskHub::addTask(Task::Error, - tr("Deployment failed. The settings in the Devices window of Xcode might be incorrect."), - ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); + TaskHub::addTask(DeploymentTask(Task::Error, + tr("Deployment failed. The settings in the Devices window of Xcode might be incorrect."))); } emit finished(status == IosToolHandler::Success); } @@ -172,8 +171,7 @@ void IosDeployStep::handleFinished(IosToolHandler *handler) switch (m_transferStatus) { case TransferInProgress: m_transferStatus = TransferFailed; - TaskHub::addTask(Task::Error, tr("Deployment failed."), - ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); + TaskHub::addTask(DeploymentTask(Task::Error, tr("Deployment failed."))); emit finished(false); break; case NoTransfer: @@ -190,9 +188,8 @@ void IosDeployStep::handleErrorMsg(IosToolHandler *handler, const QString &msg) { Q_UNUSED(handler) if (msg.contains(QLatin1String("AMDeviceInstallApplication returned -402653103"))) - TaskHub::addTask(Task::Warning, - tr("The Info.plist might be incorrect."), - ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); + TaskHub::addTask(DeploymentTask(Task::Warning, tr("The Info.plist might be incorrect."))); + emit addOutput(msg, BuildStep::OutputFormat::ErrorMessage); } @@ -258,14 +255,11 @@ void IosDeployStep::checkProvisioningProfile() m_expectFail = true; QString provisioningProfile = provisionPlist.value(QLatin1String("Name")).toString(); QString provisioningUid = provisionPlist.value(QLatin1String("UUID")).toString(); - Task task(Task::Warning, + CompileTask task(Task::Warning, tr("The provisioning profile \"%1\" (%2) used to sign the application " "does not cover the device %3 (%4). Deployment to it will fail.") .arg(provisioningProfile, provisioningUid, device->displayName(), - targetId), - Utils::FilePath(), /* filename */ - -1, /* line */ - ProjectExplorer::Constants::TASK_CATEGORY_COMPILE); + targetId)); emit addTask(task); } diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index e37d28e66b..690921c59f 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -160,9 +160,7 @@ void IosRunner::start() m_cleanExit = false; m_qmlServerPort = Port(); if (!QFileInfo::exists(m_bundleDir)) { - TaskHub::addTask(Task::Warning, - tr("Could not find %1.").arg(m_bundleDir), - ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); + TaskHub::addTask(DeploymentTask(Task::Warning, tr("Could not find %1.").arg(m_bundleDir))); reportFailure(); return; } @@ -292,13 +290,11 @@ void IosRunner::handleErrorMsg(IosToolHandler *handler, const QString &msg) QString res(msg); QString lockedErr ="Unexpected reply: ELocked (454c6f636b6564) vs OK (4f4b)"; if (msg.contains("AMDeviceStartService returned -402653150")) { - TaskHub::addTask(Task::Warning, - tr("Run failed. The settings in the Organizer window of Xcode might be incorrect."), - ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); + TaskHub::addTask(DeploymentTask(Task::Warning, tr("Run failed. " + "The settings in the Organizer window of Xcode might be incorrect."))); } else if (res.contains(lockedErr)) { QString message = tr("The device is locked, please unlock."); - TaskHub::addTask(Task::Error, message, - ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); + TaskHub::addTask(DeploymentTask(Task::Error, message)); res.replace(lockedErr, message); } QRegExp qmlPortRe("QML Debugger: Waiting for connection on port ([0-9]+)..."); @@ -454,12 +450,11 @@ void IosDebugSupport::start() if (deviceSdk2.isDir()) { deviceSdk = deviceSdk2.toString(); } else { - TaskHub::addTask(Task::Warning, tr( + TaskHub::addTask(DeploymentTask(Task::Warning, tr( "Could not find device specific debug symbols at %1. " "Debugging initialization will be slow until you open the Organizer window of " "Xcode with the device connected to have the symbols generated.") - .arg(deviceSdk1.toUserOutput()), - ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); + .arg(deviceSdk1.toUserOutput()))); } } setDeviceSymbolsRoot(deviceSdk); @@ -487,10 +482,9 @@ void IosDebugSupport::start() FilePath dsymPath = FilePath::fromString(bundlePath.append(".dSYM")); if (dsymPath.exists() && dsymPath.toFileInfo().lastModified() < QFileInfo(iosRunConfig->localExecutable().toUserOutput()).lastModified()) { - TaskHub::addTask(Task::Warning, - tr("The dSYM %1 seems to be outdated, it might confuse the debugger.") - .arg(dsymPath.toUserOutput()), - ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); + TaskHub::addTask(DeploymentTask(Task::Warning, + tr("The dSYM %1 seems to be outdated, it might confuse the debugger.") + .arg(dsymPath.toUserOutput()))); } } |