本文整理汇总了C++中idevice::ConstPtr类的典型用法代码示例。如果您正苦于以下问题:C++ ConstPtr类的具体用法?C++ ConstPtr怎么用?C++ ConstPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConstPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deviceConnected
void IosDeviceManager::deviceConnected(const QString &uid, const QString &name)
{
DeviceManager *devManager = DeviceManager::instance();
Core::Id baseDevId(Constants::IOS_DEVICE_ID);
Core::Id devType(Constants::IOS_DEVICE_TYPE);
Core::Id devId = baseDevId.withSuffix(uid);
IDevice::ConstPtr dev = devManager->find(devId);
if (dev.isNull()) {
IosDevice *newDev = new IosDevice(uid);
if (!name.isNull())
newDev->setDisplayName(name);
qCDebug(detectLog) << "adding ios device " << uid;
devManager->addDevice(IDevice::ConstPtr(newDev));
} else if (dev->deviceState() != IDevice::DeviceConnected &&
dev->deviceState() != IDevice::DeviceReadyToUse) {
qCDebug(detectLog) << "updating ios device " << uid;
IosDevice *newDev = 0;
if (dev->type() == devType) {
const IosDevice *iosDev = static_cast<const IosDevice *>(dev.data());
newDev = new IosDevice(*iosDev);
} else {
newDev = new IosDevice(uid);
}
devManager->addDevice(IDevice::ConstPtr(newDev));
}
updateInfo(uid);
}
示例2: currentDeviceChanged
void DeviceSettingsWidget::currentDeviceChanged(int index)
{
qDeleteAll(m_additionalActionButtons);
delete m_configWidget;
m_configWidget = 0;
m_additionalActionButtons.clear();
const IDevice::ConstPtr device = m_deviceManagerModel->device(index);
if (device.isNull()) {
m_ui->removeConfigButton->setEnabled(false);
clearDetails();
m_ui->defaultDeviceButton->setEnabled(false);
} else {
m_ui->removeConfigButton->setEnabled(true);
foreach (const Core::Id actionId, device->actionIds()) {
QPushButton * const button = new QPushButton(device->displayNameForActionId(actionId));
m_additionalActionButtons << button;
connect(button, SIGNAL(clicked()), m_additionalActionsMapper, SLOT(map()));
m_additionalActionsMapper->setMapping(button, actionId.uniqueIdentifier());
m_ui->buttonsLayout->insertWidget(m_ui->buttonsLayout->count() - 1, button);
}
if (!m_ui->osSpecificGroupBox->layout())
new QVBoxLayout(m_ui->osSpecificGroupBox);
int managerIndex = m_deviceManager->indexOf(device);
m_configWidget = m_deviceManager->mutableDeviceAt(managerIndex)->createWidget();
if (m_configWidget)
m_ui->osSpecificGroupBox->layout()->addWidget(m_configWidget);
displayCurrent();
}
}
示例3: IosAnalyzeSupport
RunControl *IosAnalyzeSupport::createAnalyzeRunControl(IosRunConfiguration *runConfig,
QString *errorMessage)
{
Q_UNUSED(errorMessage);
Target *target = runConfig->target();
if (!target)
return 0;
IDevice::ConstPtr device = DeviceKitInformation::device(target->kit());
if (device.isNull())
return 0;
AnalyzerStartParameters params;
params.runMode = QmlProfilerRunMode;
params.sysroot = SysRootKitInformation::sysRoot(target->kit()).toString();
params.debuggee = runConfig->localExecutable().toUserOutput();
params.debuggeeArgs = Utils::QtcProcess::joinArgs(runConfig->commandLineArguments());
params.analyzerHost = QLatin1String("localhost");
if (device->type() == Core::Id(Ios::Constants::IOS_DEVICE_TYPE)) {
IosDevice::ConstPtr iosDevice = device.dynamicCast<const IosDevice>();
if (iosDevice.isNull())
return 0;
}
params.displayName = runConfig->applicationName();
AnalyzerRunControl *analyzerRunControl = AnalyzerManager::createRunControl(params, runConfig);
(void) new IosAnalyzeSupport(runConfig, analyzerRunControl, false, true);
return analyzerRunControl;
}
示例4: createDebuggerStartParameters
static DebuggerStartParameters createDebuggerStartParameters(QnxRunConfiguration *runConfig)
{
DebuggerStartParameters params;
Target *target = runConfig->target();
Kit *k = target->kit();
const IDevice::ConstPtr device = DeviceKitInformation::device(k);
if (device.isNull())
return params;
params.startMode = AttachToRemoteServer;
params.useCtrlCStub = true;
params.inferior.executable = runConfig->localExecutableFilePath();
params.remoteExecutable = runConfig->remoteExecutableFilePath();
params.remoteChannel = device->sshParameters().host + QLatin1String(":-1");
params.remoteSetupNeeded = true;
params.closeMode = KillAtClose;
params.inferior.commandLineArguments = runConfig->arguments();
auto aspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>();
if (aspect->useQmlDebugger()) {
params.qmlServerAddress = device->sshParameters().host;
params.qmlServerPort = 0; // QML port is handed out later
}
auto qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitInformation::qtVersion(k));
if (qtVersion)
params.solibSearchPath = QnxUtils::searchPaths(qtVersion);
return params;
}
示例5: deviceMatches
bool TypeSpecificDeviceConfigurationListModel::deviceMatches(IDevice::ConstPtr dev) const
{
if (dev.isNull())
return false;
Core::Id typeId = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
return dev->type() == typeId;
}
示例6: createAnalyzerStartParameters
static AnalyzerStartParameters createAnalyzerStartParameters(const QnxRunConfiguration *runConfig, RunMode mode)
{
AnalyzerStartParameters params;
Target *target = runConfig->target();
Kit *k = target->kit();
const IDevice::ConstPtr device = DeviceKitInformation::device(k);
if (device.isNull())
return params;
if (mode == QmlProfilerRunMode)
params.startMode = StartLocal;
params.runMode = mode;
params.debuggee = runConfig->remoteExecutableFilePath();
params.debuggeeArgs = runConfig->arguments().join(QLatin1Char(' '));
params.connParams = DeviceKitInformation::device(runConfig->target()->kit())->sshParameters();
params.displayName = runConfig->displayName();
params.sysroot = SysRootKitInformation::sysRoot(runConfig->target()->kit()).toString();
params.analyzerHost = params.connParams.host;
params.analyzerPort = params.connParams.port;
if (EnvironmentAspect *environment = runConfig->extraAspect<EnvironmentAspect>())
params.environment = environment->environment();
return params;
}
示例7: initialize
bool WinRtPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments)
Q_UNUSED(errorMessage)
m_runData = new WinRtPluginRunData;
auto runConstraint = [](RunConfiguration *runConfig) {
IDevice::ConstPtr device = DeviceKitInformation::device(runConfig->target()->kit());
if (!device)
return false;
return qobject_cast<WinRtRunConfiguration *>(runConfig) != nullptr;
};
auto debugConstraint = [](RunConfiguration *runConfig) {
IDevice::ConstPtr device = DeviceKitInformation::device(runConfig->target()->kit());
if (!device)
return false;
if (device->type() != Internal::Constants::WINRT_DEVICE_TYPE_LOCAL)
return false;
return qobject_cast<WinRtRunConfiguration *>(runConfig) != nullptr;
};
RunControl::registerWorker<WinRtRunner>
(ProjectExplorer::Constants::NORMAL_RUN_MODE, runConstraint);
RunControl::registerWorker<WinRtDebugSupport>
(ProjectExplorer::Constants::DEBUG_RUN_MODE, debugConstraint);
return true;
}
示例8: tr
QList<Task> DeviceTypeKitInformation::validate(Kit *k) const
{
IDevice::ConstPtr dev = DeviceKitInformation::device(k);
QList<Task> result;
if (!dev.isNull() && dev->type() != DeviceTypeKitInformation::deviceTypeId(k))
result.append(Task(Task::Error, tr("Device does not match device type."),
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
return result;
}
示例9: 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));
}
示例10: init
bool MerEmulatorStartStep::init()
{
IDevice::ConstPtr d = DeviceKitInformation::device(this->target()->kit());
if(d.isNull() || d->type() != Constants::MER_DEVICE_TYPE_I486) {
setEnabled(false);
return false;
}
const MerEmulatorDevice* device = static_cast<const MerEmulatorDevice*>(d.data());
m_vm = device->virtualMachine();
m_ssh = device->sshParameters();
return !m_vm.isEmpty();
}
示例11: isEnabled
bool IosRunConfiguration::isEnabled() const
{
if (m_parseInProgress || !m_parseSuccess)
return false;
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target()->kit());
if (devType != Constants::IOS_DEVICE_TYPE && devType != Constants::IOS_SIMULATOR_TYPE)
return false;
IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit());
if (dev.isNull() || dev->deviceState() != IDevice::DeviceReadyToUse)
return false;
return RunConfiguration::isEnabled();
}
示例12: createDebuggerStartParameters
static DebuggerStartParameters createDebuggerStartParameters(QnxRunConfiguration *runConfig)
{
DebuggerStartParameters params;
Target *target = runConfig->target();
Kit *k = target->kit();
const IDevice::ConstPtr device = DeviceKitInformation::device(k);
if (device.isNull())
return params;
params.startMode = AttachToRemoteServer;
params.debuggerCommand = DebuggerKitInformation::debuggerCommand(k).toString();
params.sysRoot = SysRootKitInformation::sysRoot(k).toString();
params.useCtrlCStub = true;
params.runConfiguration = runConfig;
if (ToolChain *tc = ToolChainKitInformation::toolChain(k))
params.toolChainAbi = tc->targetAbi();
params.executable = runConfig->localExecutableFilePath();
params.remoteExecutable = runConfig->remoteExecutableFilePath();
params.remoteChannel = device->sshParameters().host + QLatin1String(":-1");
params.displayName = runConfig->displayName();
params.remoteSetupNeeded = true;
params.closeMode = KillAtClose;
params.processArgs = runConfig->arguments().join(QLatin1Char(' '));
DebuggerRunConfigurationAspect *aspect
= runConfig->extraAspect<DebuggerRunConfigurationAspect>();
if (aspect->useQmlDebugger()) {
params.languages |= QmlLanguage;
params.qmlServerAddress = device->sshParameters().host;
params.qmlServerPort = 0; // QML port is handed out later
}
if (aspect->useCppDebugger())
params.languages |= CppLanguage;
if (const Project *project = runConfig->target()->project()) {
params.projectSourceDirectory = project->projectDirectory().toString();
if (const BuildConfiguration *buildConfig = runConfig->target()->activeBuildConfiguration())
params.projectBuildDirectory = buildConfig->buildDirectory().toString();
params.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
}
QnxQtVersion *qtVersion =
dynamic_cast<QnxQtVersion *>(QtSupport::QtKitInformation::qtVersion(k));
if (qtVersion)
params.solibSearchPath = QnxUtils::searchPaths(qtVersion);
return params;
}
示例13: defaultDeviceConfig
IDevice::ConstPtr TypeSpecificDeviceConfigurationListModel::defaultDeviceConfig() const
{
const DeviceManager * const deviceManager = DeviceManager::instance();
const int deviceCount = deviceManager->deviceCount();
for (int i = 0; i < deviceCount; ++i) {
const IDevice::ConstPtr device = deviceManager->deviceAt(i);
if (deviceMatches(device)
&& deviceManager->defaultDevice(device->type()) == device) {
return device;
}
}
return IDevice::ConstPtr();
}
示例14: QDialog
StartRemoteDialog::StartRemoteDialog(QWidget *parent)
: QDialog(parent)
, d(new Internal::StartRemoteDialogPrivate)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Start Remote Analysis"));
d->kitChooser = new KitChooser(this);
d->kitChooser->setKitPredicate([](const Kit *kit) {
const IDevice::ConstPtr device = DeviceKitInformation::device(kit);
return kit->isValid() && device && !device->sshParameters().host().isEmpty();
});
d->executable = new QLineEdit(this);
d->arguments = new QLineEdit(this);
d->workingDirectory = new QLineEdit(this);
d->buttonBox = new QDialogButtonBox(this);
d->buttonBox->setOrientation(Qt::Horizontal);
d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
QFormLayout *formLayout = new QFormLayout;
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
formLayout->addRow(tr("Kit:"), d->kitChooser);
formLayout->addRow(tr("Executable:"), d->executable);
formLayout->addRow(tr("Arguments:"), d->arguments);
formLayout->addRow(tr("Working directory:"), d->workingDirectory);
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout);
verticalLayout->addWidget(d->buttonBox);
QSettings *settings = Core::ICore::settings();
settings->beginGroup(QLatin1String("AnalyzerStartRemoteDialog"));
d->kitChooser->populate();
d->kitChooser->setCurrentKitId(Core::Id::fromSetting(settings->value(QLatin1String("profile"))));
d->executable->setText(settings->value(QLatin1String("executable")).toString());
d->workingDirectory->setText(settings->value(QLatin1String("workingDirectory")).toString());
d->arguments->setText(settings->value(QLatin1String("arguments")).toString());
settings->endGroup();
connect(d->kitChooser, &KitChooser::activated, this, &StartRemoteDialog::validate);
connect(d->executable, &QLineEdit::textChanged, this, &StartRemoteDialog::validate);
connect(d->workingDirectory, &QLineEdit::textChanged, this, &StartRemoteDialog::validate);
connect(d->arguments, &QLineEdit::textChanged, this, &StartRemoteDialog::validate);
connect(d->buttonBox, &QDialogButtonBox::accepted, this, &StartRemoteDialog::accept);
connect(d->buttonBox, &QDialogButtonBox::rejected, this, &StartRemoteDialog::reject);
validate();
}
示例15: freePorts
PortList MaemoGlobal::freePorts(const Kit *k)
{
IDevice::ConstPtr device = DeviceKitInformation::device(k);
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(k);
if (!device || !qtVersion)
return PortList();
if (device->machineType() == IDevice::Emulator) {
MaemoQemuRuntime rt;
const int id = qtVersion->uniqueId();
if (MaemoQemuManager::instance().runtimeForQtVersion(id, &rt))
return rt.m_freePorts;
}
return device->freePorts();
}