forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.13' into master
Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/plugins/cmakeprojectmanager/cmakebuildstep.cpp src/plugins/cmakeprojectmanager/cmakebuildstep.h tests/auto/debugger/tst_namedemangler.cpp tests/auto/qml/codemodel/check/tst_check.cpp Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
This commit is contained in:
@@ -24,18 +24,21 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "iosdevice.h"
|
||||
#include "iossimulator.h"
|
||||
#include "iosconstants.h"
|
||||
#include "iosconfigurations.h"
|
||||
#include "iosconstants.h"
|
||||
#include "iossimulator.h"
|
||||
#include "iostoolhandler.h"
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <coreplugin/helpmanager.h>
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <projectexplorer/devicesupport/idevicewidget.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <utils/portlist.h>
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QMessageBox>
|
||||
#include <QVariant>
|
||||
#include <QVariantMap>
|
||||
#include <QMessageBox>
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include <IOKit/IOKitLib.h>
|
||||
@@ -57,6 +60,9 @@
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
static const char kDeviceName[] = "deviceName";
|
||||
static const char kUniqueDeviceId[] = "uniqueDeviceId";
|
||||
|
||||
namespace {
|
||||
static Q_LOGGING_CATEGORY(detectLog, "qtc.ios.deviceDetect", QtWarningMsg)
|
||||
}
|
||||
@@ -87,6 +93,14 @@ static QString CFStringRef2QString(CFStringRef s)
|
||||
namespace Ios {
|
||||
namespace Internal {
|
||||
|
||||
class IosDeviceInfoWidget : public IDeviceWidget
|
||||
{
|
||||
public:
|
||||
IosDeviceInfoWidget(const ProjectExplorer::IDevice::Ptr &device);
|
||||
|
||||
void updateDeviceFromUi() {}
|
||||
};
|
||||
|
||||
IosDevice::IosDevice(CtorHelper)
|
||||
: m_lastPort(Constants::IOS_DEVICE_PORT_START)
|
||||
{
|
||||
@@ -128,7 +142,7 @@ IDevice::DeviceInfo IosDevice::deviceInformation() const
|
||||
|
||||
IDeviceWidget *IosDevice::createWidget()
|
||||
{
|
||||
return nullptr;
|
||||
return new IosDeviceInfoWidget(sharedFromThis());
|
||||
}
|
||||
|
||||
DeviceProcessSignalOperation::Ptr IosDevice::signalOperation() const
|
||||
@@ -156,11 +170,21 @@ QVariantMap IosDevice::toMap() const
|
||||
return res;
|
||||
}
|
||||
|
||||
QString IosDevice::deviceName() const
|
||||
{
|
||||
return m_extraInfo.value(kDeviceName);
|
||||
}
|
||||
|
||||
QString IosDevice::uniqueDeviceID() const
|
||||
{
|
||||
return id().suffixAfter(Utils::Id(Constants::IOS_DEVICE_ID));
|
||||
}
|
||||
|
||||
QString IosDevice::uniqueInternalDeviceId() const
|
||||
{
|
||||
return m_extraInfo.value(kUniqueDeviceId);
|
||||
}
|
||||
|
||||
QString IosDevice::name()
|
||||
{
|
||||
return QCoreApplication::translate("Ios::Internal::IosDevice", "iOS Device");
|
||||
@@ -171,6 +195,11 @@ QString IosDevice::osVersion() const
|
||||
return m_extraInfo.value(QLatin1String("osVersion"));
|
||||
}
|
||||
|
||||
QString IosDevice::cpuArchitecture() const
|
||||
{
|
||||
return m_extraInfo.value("cpuArchitecture");
|
||||
}
|
||||
|
||||
Utils::Port IosDevice::nextPort() const
|
||||
{
|
||||
// use qrand instead?
|
||||
@@ -193,7 +222,7 @@ IosDeviceManager::TranslationMap IosDeviceManager::translationMap()
|
||||
if (translationMap)
|
||||
return *translationMap;
|
||||
TranslationMap &tMap = *new TranslationMap;
|
||||
tMap[QLatin1String("deviceName")] = tr("Device name");
|
||||
tMap[kDeviceName] = tr("Device name");
|
||||
//: Whether the device is in developer mode.
|
||||
tMap[QLatin1String("developerStatus")] = tr("Developer status");
|
||||
tMap[QLatin1String("deviceConnected")] = tr("Connected");
|
||||
@@ -243,7 +272,7 @@ void IosDeviceManager::deviceDisconnected(const QString &uid)
|
||||
} else {
|
||||
auto iosDev = static_cast<const IosDevice *>(dev.data());
|
||||
if (iosDev->m_extraInfo.isEmpty()
|
||||
|| iosDev->m_extraInfo.value(QLatin1String("deviceName")) == QLatin1String("*unknown*")) {
|
||||
|| iosDev->m_extraInfo.value(kDeviceName) == QLatin1String("*unknown*")) {
|
||||
devManager->removeDevice(iosDev->id());
|
||||
} else if (iosDev->deviceState() != IDevice::DeviceDisconnected) {
|
||||
qCDebug(detectLog) << "disconnecting device " << iosDev->uniqueDeviceID();
|
||||
@@ -285,9 +314,8 @@ void IosDeviceManager::deviceInfo(IosToolHandler *, const QString &uid,
|
||||
newDev = new IosDevice(uid);
|
||||
}
|
||||
if (!skipUpdate) {
|
||||
QString devNameKey = QLatin1String("deviceName");
|
||||
if (info.contains(devNameKey))
|
||||
newDev->setDisplayName(info.value(devNameKey));
|
||||
if (info.contains(kDeviceName))
|
||||
newDev->setDisplayName(info.value(kDeviceName));
|
||||
newDev->m_extraInfo = info;
|
||||
qCDebug(detectLog) << "updated info of ios device " << uid;
|
||||
dev = IDevice::ConstPtr(newDev);
|
||||
@@ -546,11 +574,24 @@ IosDeviceFactory::IosDeviceFactory()
|
||||
bool IosDeviceFactory::canRestore(const QVariantMap &map) const
|
||||
{
|
||||
QVariantMap vMap = map.value(QLatin1String(Constants::EXTRA_INFO_KEY)).toMap();
|
||||
if (vMap.isEmpty()
|
||||
|| vMap.value(QLatin1String("deviceName")).toString() == QLatin1String("*unknown*"))
|
||||
if (vMap.isEmpty() || vMap.value(kDeviceName).toString() == QLatin1String("*unknown*"))
|
||||
return false; // transient device (probably generated during an activation)
|
||||
return true;
|
||||
}
|
||||
|
||||
IosDeviceInfoWidget::IosDeviceInfoWidget(const IDevice::Ptr &device)
|
||||
: IDeviceWidget(device)
|
||||
{
|
||||
const auto iosDevice = qSharedPointerCast<IosDevice>(device);
|
||||
const auto formLayout = new QFormLayout(this);
|
||||
formLayout->setContentsMargins(0, 0, 0, 0);
|
||||
setLayout(formLayout);
|
||||
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||
formLayout->addRow(IosDevice::tr("Device name:"), new QLabel(iosDevice->deviceName()));
|
||||
formLayout->addRow(IosDevice::tr("Identifier:"), new QLabel(iosDevice->uniqueInternalDeviceId()));
|
||||
formLayout->addRow(IosDevice::tr("OS Version:"), new QLabel(iosDevice->osVersion()));
|
||||
formLayout->addRow(IosDevice::tr("CPU Architecture:"), new QLabel(iosDevice->cpuArchitecture()));
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Ios
|
||||
|
||||
@@ -57,8 +57,11 @@ public:
|
||||
|
||||
void fromMap(const QVariantMap &map) override;
|
||||
QVariantMap toMap() const override;
|
||||
QString deviceName() const;
|
||||
QString uniqueDeviceID() const;
|
||||
QString uniqueInternalDeviceId() const;
|
||||
QString osVersion() const;
|
||||
QString cpuArchitecture() const;
|
||||
Utils::Port nextPort() const;
|
||||
bool canAutoDetectPorts() const override;
|
||||
|
||||
|
||||
@@ -436,28 +436,26 @@ void IosDebugSupport::start()
|
||||
IosDevice::ConstPtr dev = device().dynamicCast<const IosDevice>();
|
||||
setStartMode(AttachToRemoteProcess);
|
||||
setIosPlatform("remote-ios");
|
||||
QString osVersion = dev->osVersion();
|
||||
FilePath deviceSdk1 = FilePath::fromString(QDir::homePath()
|
||||
+ "/Library/Developer/Xcode/iOS DeviceSupport/"
|
||||
+ osVersion + "/Symbols");
|
||||
QString deviceSdk;
|
||||
if (deviceSdk1.isDir()) {
|
||||
deviceSdk = deviceSdk1.toString();
|
||||
} else {
|
||||
const FilePath deviceSdk2 = IosConfigurations::developerPath()
|
||||
.pathAppended("Platforms/iPhoneOS.platform/DeviceSupport/"
|
||||
+ osVersion + "/Symbols");
|
||||
if (deviceSdk2.isDir()) {
|
||||
deviceSdk = deviceSdk2.toString();
|
||||
} else {
|
||||
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())));
|
||||
}
|
||||
const QString osVersion = dev->osVersion();
|
||||
const QString cpuArchitecture = dev->cpuArchitecture();
|
||||
const FilePaths symbolsPathCandidates = {
|
||||
FilePath::fromString(QDir::homePath() + "/Library/Developer/Xcode/iOS DeviceSupport/"
|
||||
+ osVersion + " " + cpuArchitecture + "/Symbols"),
|
||||
FilePath::fromString(QDir::homePath() + "/Library/Developer/Xcode/iOS DeviceSupport/"
|
||||
+ osVersion + "/Symbols"),
|
||||
IosConfigurations::developerPath().pathAppended(
|
||||
"Platforms/iPhoneOS.platform/DeviceSupport/" + osVersion + "/Symbols")};
|
||||
const FilePath deviceSdk = Utils::findOrDefault(symbolsPathCandidates, &FilePath::isDir);
|
||||
|
||||
if (deviceSdk.isEmpty()) {
|
||||
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(symbolsPathCandidates.constFirst().toUserOutput())));
|
||||
}
|
||||
setDeviceSymbolsRoot(deviceSdk);
|
||||
setDeviceSymbolsRoot(deviceSdk.toString());
|
||||
} else {
|
||||
setStartMode(AttachExternal);
|
||||
setIosPlatform("ios-simulator");
|
||||
|
||||
Reference in New Issue
Block a user