//CONSTRUCTOR KitList::KitList(std::string path) { boost::filesystem::directory_iterator it (path); for(it; it != boost::filesystem::directory_iterator(); ++it) { Kit tempKit = Kit(it->path().generic_string()); this->kits.insert(make_pair(tempKit.getKitNo(), tempKit)); } }
void KitOptionsPage::cloneKit() { Kit *current = m_model->kit(currentIndex()); if (!current) return; Kit *k = current->clone(); m_model->markForAddition(k); QModelIndex newIdx = m_model->indexOf(k); m_kitsView->scrollTo(newIdx); m_selectionModel->select(newIdx, QItemSelectionModel::Clear | QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); }
Kit* MerTarget::createKit() const { if (!isValid()) return 0; const QString sysroot(m_sdk->sharedTargetsPath() + QLatin1Char('/') + m_name); FileName path = FileName::fromString(sysroot); if (!path.toFileInfo().exists()) { qWarning() << "Sysroot does not exist" << sysroot; return 0; } Kit *k = new Kit(); k->setAutoDetected(true); k->setUnexpandedDisplayName(QString::fromLatin1("%1-%2").arg(m_sdk->virtualMachineName(), m_name)); k->setIconPath(FileName::fromString(QLatin1String(Constants::MER_OPTIONS_CATEGORY_ICON))); SysRootKitInformation::setSysRoot(k, FileName::fromUserInput(sysroot)); DeviceTypeKitInformation::setDeviceTypeId(k, Constants::MER_DEVICE_TYPE); k->setMutable(DeviceKitInformation::id(), true); const QString gdb = HostOsInfo::withExecutableSuffix(m_defaultGdb); QString gdbDir = QCoreApplication::applicationDirPath(); if (HostOsInfo::isMacHost()) { QDir dir = QDir(gdbDir); dir.cdUp(); dir.cdUp(); dir.cdUp(); gdbDir = dir.path(); } FileName gdbFileName = FileName::fromString(gdbDir + QLatin1Char('/') + gdb); DebuggerItem debugger; debugger.setCommand(gdbFileName); debugger.setEngineType(GdbEngineType); const QString vmName = m_sdk->virtualMachineName(); debugger.setUnexpandedDisplayName(QObject::tr("GDB for %1 %2").arg(vmName, m_name)); debugger.setAutoDetected(true); debugger.setAbi(Abi::abiFromTargetTriplet(m_gccMachineDump)); // TODO is this OK? QVariant id = DebuggerItemManager::registerDebugger(debugger); DebuggerKitInformation::setDebugger(k, id); MerSdkKitInformation::setSdk(k,m_sdk); MerTargetKitInformation::setTargetName(k,name()); return k; }
void QmlProfilerTool::startRemoteTool(ProjectExplorer::RunConfiguration *rc) { Id kitId; quint16 port; Kit *kit = 0; { QSettings *settings = ICore::settings(); kitId = Id::fromSetting(settings->value(QLatin1String("AnalyzerQmlAttachDialog/kitId"))); port = settings->value(QLatin1String("AnalyzerQmlAttachDialog/port"), 3768).toUInt(); QmlProfilerAttachDialog dialog; dialog.setKitId(kitId); dialog.setPort(port); if (dialog.exec() != QDialog::Accepted) return; kit = dialog.kit(); port = dialog.port(); settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/kitId"), kit->id().toSetting()); settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/port"), port); } AnalyzerConnection connection; IDevice::ConstPtr device = DeviceKitInformation::device(kit); if (device) { Connection toolControl = device->toolControlChannel(IDevice::QmlControlChannel); QTC_ASSERT(toolControl.is<HostName>(), return); connection.analyzerHost = toolControl.as<HostName>().host(); connection.connParams = device->sshParameters(); } connection.analyzerPort = Utils::Port(port); auto runControl = qobject_cast<QmlProfilerRunControl *>(createRunControl(rc)); runControl->setConnection(connection); ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE); }
void KitOptionsPage::updateState() { if (!m_kitsView) return; bool canCopy = false; bool canDelete = false; bool canMakeDefault = false; QModelIndex index = currentIndex(); Kit *k = m_model->kit(index); if (k) { canCopy = k->isValid(); canDelete = !k->isAutoDetected(); canMakeDefault = !m_model->isDefaultKit(index); } m_cloneButton->setEnabled(canCopy); m_delButton->setEnabled(canDelete); m_makeDefaultButton->setEnabled(canMakeDefault); }
Kit *KitModel::markForAddition(Kit *baseKit) { KitNode *node = createNode(0); m_manualRoot->appendChild(node); Kit *k = node->widget->workingCopy(); KitGuard g(k); if (baseKit) { k->copyFrom(baseKit); k->setAutoDetected(false); // Make sure we have a manual kit! k->setSdkProvided(false); k->setUnexpandedDisplayName(tr("Clone of %1").arg(k->unexpandedDisplayName())); } else { k->setup(); } if (!m_defaultNode) setDefaultNode(node); return k; }
Core::Id KitChooser::currentKitId() const { Kit *kit = currentKit(); return kit ? kit->id() : Core::Id(); }
//The function addKit() creates a kit object in the kits map with the passed name. void KitList::addKit(std::string kitNo) { Kit tempKit = Kit(); tempKit.setKitNo(kitNo); this->kits.insert(std::pair<std::string, Kit>(kitNo, tempKit)); }
Kit *BlackBerryConfiguration::createKit( QnxAbstractQtVersion *version, QnxToolChain *toolChain, const QVariant &debuggerItemId) { Kit *kit = new Kit; bool isSimulator = version->architecture() == X86; QtKitInformation::setQtVersion(kit, version); ToolChainKitInformation::setToolChain(kit, toolChain); if (debuggerItemId.isValid()) DebuggerKitInformation::setDebugger(kit, debuggerItemId); if (isSimulator) QmakeProjectManager::QmakeKitInformation::setMkspec( kit, FileName::fromString(QLatin1String("blackberry-x86-qcc"))); DeviceTypeKitInformation::setDeviceTypeId(kit, Constants::QNX_BB_OS_TYPE); SysRootKitInformation::setSysRoot(kit, m_sysRoot); kit->setDisplayName(version->displayName()); kit->setIconPath(FileName::fromString(QLatin1String(Constants::QNX_BB_CATEGORY_ICON))); kit->setAutoDetected(true); kit->setMutable(DeviceKitInformation::id(), true); kit->setSticky(QtKitInformation::id(), true); kit->setSticky(ToolChainKitInformation::id(), true); kit->setSticky(DeviceTypeKitInformation::id(), true); kit->setSticky(SysRootKitInformation::id(), true); kit->setSticky(DebuggerKitInformation::id(), true); kit->setSticky(QmakeProjectManager::QmakeKitInformation::id(), true); KitManager::registerKit(kit); return kit; }