forked from qt-creator/qt-creator
iOS: More FileName::appendPath -> pathAppended changes
Change-Id: I3db6b1778e6e47e26e243fb2609c481651aa91fe Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -214,7 +214,7 @@ static void setupKit(Kit *kit, Core::Id pDeviceType, const ToolChainPair& toolCh
|
||||
|
||||
static QVersionNumber findXcodeVersion(const Utils::FileName &developerPath)
|
||||
{
|
||||
FileName xcodeInfo = developerPath.parentDir().appendPath("Info.plist");
|
||||
const FileName xcodeInfo = developerPath.parentDir().pathAppended("Info.plist");
|
||||
if (xcodeInfo.exists()) {
|
||||
QSettings settings(xcodeInfo.toString(), QSettings::NativeFormat);
|
||||
return QVersionNumber::fromString(settings.value("CFBundleShortVersionString").toString());
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#define ASSERT_STATE(state) ASSERT_STATE_GENERIC(State, state, m_state)
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Ios {
|
||||
namespace Internal {
|
||||
@@ -86,7 +87,7 @@ bool IosDeployStep::init()
|
||||
auto runConfig = qobject_cast<const IosRunConfiguration *>(
|
||||
this->target()->activeRunConfiguration());
|
||||
QTC_ASSERT(runConfig, return false);
|
||||
m_bundlePath = runConfig->bundleDirectory().toString();
|
||||
m_bundlePath = runConfig->bundleDirectory();
|
||||
|
||||
if (iosdevice()) {
|
||||
m_deviceType = IosDeviceType(IosDeviceType::IosDevice, deviceId());
|
||||
@@ -122,7 +123,7 @@ void IosDeployStep::doRun()
|
||||
connect(m_toolHandler, &IosToolHandler::errorMsg,
|
||||
this, &IosDeployStep::handleErrorMsg);
|
||||
checkProvisioningProfile();
|
||||
m_toolHandler->requestTransferApp(appBundle(), m_deviceType.identifier);
|
||||
m_toolHandler->requestTransferApp(m_bundlePath.toString(), m_deviceType.identifier);
|
||||
}
|
||||
|
||||
void IosDeployStep::doCancel()
|
||||
@@ -227,11 +228,6 @@ QString IosDeployStep::deviceId() const
|
||||
return iosdevice()->uniqueDeviceID();
|
||||
}
|
||||
|
||||
QString IosDeployStep::appBundle() const
|
||||
{
|
||||
return m_bundlePath;
|
||||
}
|
||||
|
||||
void IosDeployStep::raiseError(const QString &errorString)
|
||||
{
|
||||
emit addTask(Task(Task::Error, errorString, Utils::FileName::fromString(QString()), -1,
|
||||
@@ -249,8 +245,7 @@ void IosDeployStep::checkProvisioningProfile()
|
||||
if (device.isNull())
|
||||
return;
|
||||
|
||||
Utils::FileName provisioningFilePath = Utils::FileName::fromString(appBundle());
|
||||
provisioningFilePath.appendPath(QLatin1String("embedded.mobileprovision"));
|
||||
const FileName provisioningFilePath = m_bundlePath.pathAppended("embedded.mobileprovision");
|
||||
|
||||
// the file is a signed plist stored in DER format
|
||||
// we simply search for start and end of the plist instead of decoding the DER payload
|
||||
|
||||
@@ -76,7 +76,6 @@ private:
|
||||
IosSimulator::ConstPtr iossimulator() const;
|
||||
|
||||
QString deviceId() const;
|
||||
QString appBundle() const;
|
||||
void raiseError(const QString &error);
|
||||
void writeOutput(const QString &text, OutputFormat = OutputFormat::NormalMessage);
|
||||
void checkProvisioningProfile();
|
||||
@@ -84,7 +83,7 @@ private:
|
||||
TransferStatus m_transferStatus = NoTransfer;
|
||||
IosToolHandler *m_toolHandler = nullptr;
|
||||
ProjectExplorer::IDevice::ConstPtr m_device;
|
||||
QString m_bundlePath;
|
||||
Utils::FileName m_bundlePath;
|
||||
IosDeviceType m_deviceType;
|
||||
static const Core::Id Id;
|
||||
bool m_expectFail = false;
|
||||
|
||||
@@ -146,8 +146,8 @@ QStringList IosDsymBuildStep::defaultCleanCmdList() const
|
||||
QStringList IosDsymBuildStep::defaultCmdList() const
|
||||
{
|
||||
QString dsymutilCmd = "dsymutil";
|
||||
Utils::FileName dsymUtilPath = IosConfigurations::developerPath()
|
||||
.appendPath("Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil");
|
||||
const Utils::FileName dsymUtilPath = IosConfigurations::developerPath()
|
||||
.pathAppended("Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil");
|
||||
if (dsymUtilPath.exists())
|
||||
dsymutilCmd = dsymUtilPath.toUserOutput();
|
||||
auto runConf = qobject_cast<const IosRunConfiguration *>(target()->activeRunConfiguration());
|
||||
|
||||
@@ -165,13 +165,13 @@ QString IosRunConfiguration::applicationName() const
|
||||
|
||||
FileName IosRunConfiguration::bundleDirectory() const
|
||||
{
|
||||
FileName res;
|
||||
Core::Id devType = DeviceTypeKitAspect::deviceTypeId(target()->kit());
|
||||
bool isDevice = (devType == Constants::IOS_DEVICE_TYPE);
|
||||
if (!isDevice && devType != Constants::IOS_SIMULATOR_TYPE) {
|
||||
qCWarning(iosLog) << "unexpected device type in bundleDirForTarget: " << devType.toString();
|
||||
return res;
|
||||
return {};
|
||||
}
|
||||
FileName res;
|
||||
if (BuildConfiguration *bc = target()->activeBuildConfiguration()) {
|
||||
Project *project = target()->project();
|
||||
if (ProjectNode *node = project->findNodeForBuildKey(buildKey()))
|
||||
@@ -182,29 +182,28 @@ FileName IosRunConfiguration::bundleDirectory() const
|
||||
case BuildConfiguration::Debug :
|
||||
case BuildConfiguration::Unknown :
|
||||
if (isDevice)
|
||||
res.appendPath(QLatin1String("Debug-iphoneos"));
|
||||
res = res.pathAppended("Debug-iphoneos");
|
||||
else
|
||||
res.appendPath(QLatin1String("Debug-iphonesimulator"));
|
||||
res = res.pathAppended("Debug-iphonesimulator");
|
||||
break;
|
||||
case BuildConfiguration::Profile :
|
||||
case BuildConfiguration::Release :
|
||||
if (isDevice)
|
||||
res.appendPath(QLatin1String("Release-iphoneos"));
|
||||
res = res.pathAppended("Release-iphoneos");
|
||||
else
|
||||
res.appendPath(QLatin1String("Release-iphonesimulator"));
|
||||
res = res.pathAppended("Release-iphonesimulator");
|
||||
break;
|
||||
default:
|
||||
qCWarning(iosLog) << "IosBuildStep had an unknown buildType "
|
||||
<< target()->activeBuildConfiguration()->buildType();
|
||||
}
|
||||
}
|
||||
res.appendPath(applicationName() + QLatin1String(".app"));
|
||||
return res;
|
||||
return res.pathAppended(applicationName() + ".app");
|
||||
}
|
||||
|
||||
FileName IosRunConfiguration::localExecutable() const
|
||||
{
|
||||
return bundleDirectory().appendPath(applicationName());
|
||||
return bundleDirectory().pathAppended(applicationName());
|
||||
}
|
||||
|
||||
void IosDeviceTypeAspect::fromMap(const QVariantMap &map)
|
||||
|
||||
@@ -449,9 +449,9 @@ void IosDebugSupport::start()
|
||||
if (deviceSdk1.toFileInfo().isDir()) {
|
||||
deviceSdk = deviceSdk1.toString();
|
||||
} else {
|
||||
FileName deviceSdk2 = IosConfigurations::developerPath()
|
||||
.appendPath("Platforms/iPhoneOS.platform/DeviceSupport/")
|
||||
.appendPath(osVersion).appendPath("Symbols");
|
||||
const FileName deviceSdk2 = IosConfigurations::developerPath()
|
||||
.pathAppended("Platforms/iPhoneOS.platform/DeviceSupport/"
|
||||
+ osVersion + "/Symbols");
|
||||
if (deviceSdk2.toFileInfo().isDir()) {
|
||||
deviceSdk = deviceSdk2.toString();
|
||||
} else {
|
||||
|
||||
@@ -275,7 +275,7 @@ void IosSettingsWidget::onScreenshot()
|
||||
const auto generatePath = [this](const SimulatorInfo &info) {
|
||||
const QString fileName = QString("%1_%2_%3.png").arg(info.name).arg(info.runtimeName)
|
||||
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_HH-mm-ss-z")).replace(' ', '_');
|
||||
return m_ui->pathWidget->fileName().appendPath(fileName).toString();
|
||||
return m_ui->pathWidget->fileName().pathAppended(fileName).toString();
|
||||
};
|
||||
|
||||
QPointer<SimulatorOperationDialog> statusDialog = new SimulatorOperationDialog(this);
|
||||
|
||||
@@ -96,7 +96,7 @@ static bool runSimCtlCommand(QStringList args, QString *output)
|
||||
static bool launchSimulator(const QString &simUdid) {
|
||||
QTC_ASSERT(!simUdid.isEmpty(), return false);
|
||||
const QString simulatorAppPath = IosConfigurations::developerPath()
|
||||
.appendPath("Applications/Simulator.app/Contents/MacOS/Simulator").toString();
|
||||
.pathAppended("Applications/Simulator.app/Contents/MacOS/Simulator").toString();
|
||||
|
||||
if (IosConfigurations::xcodeVersion() >= QVersionNumber(9)) {
|
||||
// For XCode 9 boot the second device instead of launching simulator app twice.
|
||||
|
||||
Reference in New Issue
Block a user