diff options
Diffstat (limited to 'src/winrtrunner/runner.cpp')
-rw-r--r-- | src/winrtrunner/runner.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/winrtrunner/runner.cpp b/src/winrtrunner/runner.cpp index 5b4725991..fa31c30d8 100644 --- a/src/winrtrunner/runner.cpp +++ b/src/winrtrunner/runner.cpp @@ -43,6 +43,9 @@ #include "runnerengine.h" +#ifndef RTRUNNER_NO_APPXPHONE +#include "appxphoneengine.h" +#endif #ifndef RTRUNNER_NO_APPXLOCAL #include "appxlocalengine.h" #endif @@ -80,6 +83,9 @@ QMap<QString, QStringList> Runner::deviceNames() #ifndef RTRUNNER_NO_APPXLOCAL deviceNames.insert(QStringLiteral("Appx"), AppxLocalEngine::deviceNames()); #endif +#ifndef RTRUNNER_NO_APPXPHONE + deviceNames.insert(QStringLiteral("Phone"), AppxPhoneEngine::deviceNames()); +#endif #ifndef RTRUNNER_NO_XAP deviceNames.insert(QStringLiteral("Xap"), XapEngine::deviceNames()); #endif @@ -98,6 +104,22 @@ Runner::Runner(const QString &app, const QStringList &arguments, bool deviceIndexKnown; d->deviceIndex = deviceName.toInt(&deviceIndexKnown); +#ifndef RTRUNNER_NO_APPXPHONE + if (!deviceIndexKnown) { + d->deviceIndex = AppxPhoneEngine::deviceNames().indexOf(deviceName); + if (d->deviceIndex < 0) + d->deviceIndex = 0; + } + if ((d->profile.isEmpty() || d->profile.toLower() == QStringLiteral("appxphone")) + && AppxPhoneEngine::canHandle(this)) { + if (RunnerEngine *engine = AppxPhoneEngine::create(this)) { + d->engine.reset(engine); + d->isValid = true; + qCWarning(lcWinRtRunner) << "Using the AppxPhone profile."; + return; + } + } +#endif #ifndef RTRUNNER_NO_APPXLOCAL if (!deviceIndexKnown) { d->deviceIndex = AppxLocalEngine::deviceNames().indexOf(deviceName); |