本文整理汇总了C++中idevice::ConstPtr::displayName方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstPtr::displayName方法的具体用法?C++ ConstPtr::displayName怎么用?C++ ConstPtr::displayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idevice::ConstPtr
的用法示例。
在下文中一共展示了ConstPtr::displayName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: disabledReason
QString IosRunConfiguration::disabledReason() const
{
if (m_parseInProgress)
return tr("The .pro file \"%1\" is currently being parsed.")
.arg(QFileInfo(m_profilePath).fileName());
if (!m_parseSuccess)
return static_cast<QmakeProject *>(target()->project())
->disabledReasonForRunConfiguration(m_profilePath);
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target()->kit());
if (devType != Constants::IOS_DEVICE_TYPE && devType != Constants::IOS_SIMULATOR_TYPE)
return tr("Kit has incorrect device type for running on iOS devices.");
IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit());
QString validDevName;
bool hasConncetedDev = false;
if (devType == Constants::IOS_DEVICE_TYPE) {
DeviceManager *dm = DeviceManager::instance();
for (int idev = 0; idev < dm->deviceCount(); ++idev) {
IDevice::ConstPtr availDev = dm->deviceAt(idev);
if (!availDev.isNull() && availDev->type() == Constants::IOS_DEVICE_TYPE) {
if (availDev->deviceState() == IDevice::DeviceReadyToUse) {
validDevName += QLatin1Char(' ');
validDevName += availDev->displayName();
} else if (availDev->deviceState() == IDevice::DeviceConnected) {
hasConncetedDev = true;
}
}
}
}
if (dev.isNull()) {
if (!validDevName.isEmpty())
return tr("No device chosen. Select %1.").arg(validDevName); // should not happen
else if (hasConncetedDev)
return tr("No device chosen. Enable developer mode on a device."); // should not happen
else
return tr("No device available.");
} else {
switch (dev->deviceState()) {
case IDevice::DeviceReadyToUse:
break;
case IDevice::DeviceConnected:
return tr("To use this device you need to enable developer mode on it.");
case IDevice::DeviceDisconnected:
case IDevice::DeviceStateUnknown:
if (!validDevName.isEmpty())
return tr("%1 is not connected. Select %2?")
.arg(dev->displayName(), validDevName);
else if (hasConncetedDev)
return tr("%1 is not connected. Enable developer mode on a device?")
.arg(dev->displayName());
else
return tr("%1 is not connected.").arg(dev->displayName());
}
}
return RunConfiguration::disabledReason();
}
示例2: updateDisplayNames
void IosRunConfiguration::updateDisplayNames()
{
if (DeviceTypeKitInformation::deviceTypeId(target()->kit()) == Constants::IOS_DEVICE_TYPE)
m_deviceType = IosDeviceType(IosDeviceType::IosDevice);
else if (m_deviceType.type == IosDeviceType::IosDevice)
m_deviceType = IosDeviceType(IosDeviceType::SimulatedDevice);
IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit());
const QString devName = dev.isNull() ? IosDevice::name() : dev->displayName();
setDefaultDisplayName(tr("Run on %1").arg(devName));
setDisplayName(tr("Run %1 on %2").arg(applicationName()).arg(devName));
}
示例3: init
bool MerLocalRsyncDeployStep::init()
{
Qt4ProjectManager::Qt4BuildConfiguration *bc = qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration*>(buildConfiguration());
if (!bc)
bc = qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration*>(target()->activeBuildConfiguration());
if (!bc) {
addOutput(tr("Cannot deploy: No active build configuration."),
ErrorMessageOutput);
return false;
}
const MerSdk *const merSdk = MerSdkKitInformation::sdk(target()->kit());
if (!merSdk) {
addOutput(tr("Cannot deploy: Missing MerSdk information in the kit"),ErrorMessageOutput);
return false;
}
const QString target = MerTargetKitInformation::targetName(this->target()->kit());
if (target.isEmpty()) {
addOutput(tr("Cannot deploy: Missing MerTarget information in the kit"),ErrorMessageOutput);
return false;
}
IDevice::ConstPtr device = DeviceKitInformation::device(this->target()->kit());
//TODO: HACK
if (device.isNull() && DeviceTypeKitInformation::deviceTypeId(this->target()->kit()) != Constants::MER_DEVICE_TYPE_ARM) {
addOutput(tr("Cannot deploy: Missing MerDevice information in the kit"),ErrorMessageOutput);
return false;
}
const QString projectDirectory = bc->shadowBuild() ? bc->shadowBuildDirectory() : project()->projectDirectory();
const QString deployCommand = QLatin1String("rsync");
ProcessParameters *pp = processParameters();
Utils::Environment env = bc ? bc->environment() : Utils::Environment::systemEnvironment();
//TODO HACK
if(!device.isNull())
env.appendOrSet(QLatin1String(Constants::MER_SSH_DEVICE_NAME),device->displayName());
pp->setMacroExpander(bc ? bc->macroExpander() : Core::VariableManager::instance()->macroExpander());
pp->setEnvironment(env);
pp->setWorkingDirectory(projectDirectory);
pp->setCommand(deployCommand);
pp->setArguments(arguments());
return AbstractProcessStep::init();
}