void IosDeployStep::run(QFutureInterface<bool> &fi) { m_futureInterface = fi; QTC_CHECK(m_transferStatus == NoTransfer); if (iosdevice().isNull()) { m_futureInterface.reportResult(!iossimulator().isNull()); cleanup(); m_futureInterface.reportFinished(); return; } m_transferStatus = TransferInProgress; IosToolHandler *toolHandler = new IosToolHandler(IosToolHandler::IosDeviceType, this); m_futureInterface.setProgressRange(0, 200); m_futureInterface.setProgressValueAndText(0, QLatin1String("Transferring application")); m_futureInterface.reportStarted(); connect(toolHandler, SIGNAL(isTransferringApp(Ios::IosToolHandler*,QString,QString,int,int,QString)), SLOT(handleIsTransferringApp(Ios::IosToolHandler*,QString,QString,int,int,QString))); connect(toolHandler, SIGNAL(didTransferApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus)), SLOT(handleDidTransferApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus))); connect(toolHandler, SIGNAL(finished(Ios::IosToolHandler*)), SLOT(handleFinished(Ios::IosToolHandler*))); connect(toolHandler, SIGNAL(errorMsg(Ios::IosToolHandler*,QString)), SLOT(handleErrorMsg(Ios::IosToolHandler*,QString))); toolHandler->requestTransferApp(appBundle(), deviceId()); }
void IosDeployStep::run(QFutureInterface<bool> &fi) { m_futureInterface = fi; QTC_CHECK(m_transferStatus == NoTransfer); if (iosdevice().isNull()) { if (iossimulator().isNull()) TaskHub::addTask(Task::Error, tr("Deployment failed. No iOS device found."), ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); m_futureInterface.reportResult(!iossimulator().isNull()); cleanup(); emit finished(); return; } m_transferStatus = TransferInProgress; QTC_CHECK(m_toolHandler == 0); m_toolHandler = new IosToolHandler(IosDeviceType::IosDevice, this); 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))); m_toolHandler->requestTransferApp(appBundle(), deviceId()); }
QString Uploader::sam7Path( ) { QString uploaderName; #ifdef Q_OS_MAC // get the path within the app bundle CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle()); CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef, kCFURLPOSIXPathStyle); QDir appBundle( CFStringGetCStringPtr(macPath, CFStringGetSystemEncoding()) ); uploaderName = appBundle.filePath( "Contents/Resources/sam7" ); #elif defined (Q_OS_WIN) QDir d = QDir::current(); if(!d.exists("sam7.exe")) // in dev mode, we're one dir down in 'bin' d.cdUp(); uploaderName = d.filePath("sam7.exe"); #else QSettings settings; QDir dir( settings.value("sam7_path", DEFAULT_SAM7_PATH).toString() ); uploaderName = dir.filePath("sam7"); #endif return uploaderName; }