forked from qt-creator/qt-creator
ios: make device simulated configurable in runconfiguration
Change-Id: I54bcbd7f2142ab95618005f1f108a122bfe18d32 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "iostoolhandler.h"
|
||||
#include "iosconfigurations.h"
|
||||
#include "iosconstants.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -124,7 +125,7 @@ public:
|
||||
OpAppRun
|
||||
};
|
||||
|
||||
explicit IosToolHandlerPrivate(IosToolHandler::DeviceType devType, IosToolHandler *q);
|
||||
explicit IosToolHandlerPrivate(IosDeviceType::Enum devType, IosToolHandler *q);
|
||||
virtual ~IosToolHandlerPrivate() {}
|
||||
virtual void requestTransferApp(const QString &bundlePath, const QString &deviceId,
|
||||
int timeout = 1000) = 0;
|
||||
@@ -168,7 +169,7 @@ protected:
|
||||
IosToolHandler::RunKind runKind;
|
||||
State state;
|
||||
Op op;
|
||||
IosToolHandler::DeviceType devType;
|
||||
IosDeviceType::Enum devType;
|
||||
static const int lookaheadSize = 67;
|
||||
int iBegin, iEnd, gdbSocket;
|
||||
QList<ParserState> stack;
|
||||
@@ -177,7 +178,7 @@ protected:
|
||||
class IosDeviceToolHandlerPrivate : public IosToolHandlerPrivate
|
||||
{
|
||||
public:
|
||||
explicit IosDeviceToolHandlerPrivate(IosToolHandler::DeviceType devType, IosToolHandler *q);
|
||||
explicit IosDeviceToolHandlerPrivate(IosDeviceType::Enum devType, IosToolHandler *q);
|
||||
virtual void requestTransferApp(const QString &bundlePath, const QString &deviceId,
|
||||
int timeout = 1000);
|
||||
virtual void requestRunApp(const QString &bundlePath, const QStringList &extraArgs,
|
||||
@@ -190,7 +191,7 @@ public:
|
||||
class IosSimulatorToolHandlerPrivate : public IosToolHandlerPrivate
|
||||
{
|
||||
public:
|
||||
explicit IosSimulatorToolHandlerPrivate(IosToolHandler::DeviceType devType, IosToolHandler *q);
|
||||
explicit IosSimulatorToolHandlerPrivate(IosDeviceType::Enum devType, IosToolHandler *q);
|
||||
virtual void requestTransferApp(const QString &bundlePath, const QString &deviceId,
|
||||
int timeout = 1000);
|
||||
virtual void requestRunApp(const QString &bundlePath, const QStringList &extraArgs,
|
||||
@@ -202,7 +203,7 @@ private:
|
||||
void addDeviceArguments(QStringList &args) const;
|
||||
};
|
||||
|
||||
IosToolHandlerPrivate::IosToolHandlerPrivate(IosToolHandler::DeviceType devType,
|
||||
IosToolHandlerPrivate::IosToolHandlerPrivate(IosDeviceType::Enum devType,
|
||||
Ios::IosToolHandler *q) :
|
||||
q(q), state(NonStarted), devType(devType), iBegin(0), iEnd(0),
|
||||
gdbSocket(-1)
|
||||
@@ -576,7 +577,7 @@ void IosToolHandlerPrivate::subprocessHasData()
|
||||
|
||||
// IosDeviceToolHandlerPrivate
|
||||
|
||||
IosDeviceToolHandlerPrivate::IosDeviceToolHandlerPrivate(IosToolHandler::DeviceType devType,
|
||||
IosDeviceToolHandlerPrivate::IosDeviceToolHandlerPrivate(IosDeviceType::Enum devType,
|
||||
IosToolHandler *q)
|
||||
: IosToolHandlerPrivate(devType, q)
|
||||
{ }
|
||||
@@ -635,7 +636,7 @@ bool IosDeviceToolHandlerPrivate::expectsFileDescriptor()
|
||||
|
||||
// IosSimulatorToolHandlerPrivate
|
||||
|
||||
IosSimulatorToolHandlerPrivate::IosSimulatorToolHandlerPrivate(IosToolHandler::DeviceType devType,
|
||||
IosSimulatorToolHandlerPrivate::IosSimulatorToolHandlerPrivate(IosDeviceType::Enum devType,
|
||||
IosToolHandler *q)
|
||||
: IosToolHandlerPrivate(devType, q)
|
||||
{ }
|
||||
@@ -695,23 +696,23 @@ bool IosSimulatorToolHandlerPrivate::expectsFileDescriptor()
|
||||
void IosSimulatorToolHandlerPrivate::addDeviceArguments(QStringList &args) const
|
||||
{
|
||||
switch (devType) {
|
||||
case IosToolHandler::IosDeviceType:
|
||||
case IosDeviceType::IosDevice:
|
||||
qDebug() << "IosSimulatorToolHandlerPrivate has device type IosDeviceType";
|
||||
break;
|
||||
case IosToolHandler::IosSimulatedIphoneType:
|
||||
case IosDeviceType::SimulatedIphone:
|
||||
args << QLatin1String("--family") << QLatin1String("iphone");
|
||||
break;
|
||||
case IosToolHandler::IosSimulatedIpadType:
|
||||
case IosDeviceType::SimulatedIpad:
|
||||
args << QLatin1String("--family") << QLatin1String("ipad");
|
||||
break;
|
||||
case IosToolHandler::IosSimulatedIphoneRetina4InchType:
|
||||
case IosDeviceType::SimulatedIphoneRetina4Inch:
|
||||
args << QLatin1String("--family") << QLatin1String("iphone")
|
||||
<< QLatin1String("--retina") << QLatin1String("--tall");
|
||||
break;
|
||||
case IosToolHandler::IosSimulatedIphoneRetina3_5InchType:
|
||||
case IosDeviceType::SimulatedIphoneRetina3_5Inch:
|
||||
args << QLatin1String("--family") << QLatin1String("iphone") << QLatin1String("--retina");
|
||||
break;
|
||||
case IosToolHandler::IosSimulatedIpadRetinaType:
|
||||
case IosDeviceType::SimulatedIpadRetina:
|
||||
args << QLatin1String("--family") << QLatin1String("ipad") << QLatin1String("--retina");
|
||||
break;
|
||||
}
|
||||
@@ -743,10 +744,10 @@ QString IosToolHandler::iosSimulatorToolPath()
|
||||
return res;
|
||||
}
|
||||
|
||||
IosToolHandler::IosToolHandler(DeviceType devType, QObject *parent) :
|
||||
IosToolHandler::IosToolHandler(IosDeviceType::Enum devType, QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
if (devType == IosDeviceType)
|
||||
if (devType == IosDeviceType::IosDevice)
|
||||
d = new Internal::IosDeviceToolHandlerPrivate(devType, this);
|
||||
else
|
||||
d = new Internal::IosSimulatorToolHandlerPrivate(devType, this);
|
||||
|
||||
Reference in New Issue
Block a user