forked from qt-creator/qt-creator
s/profile/kit/
* Rename profiles to kits. * Update some strings: * projects mode has a Kits tab, not a Targets tab. * " Settings" was dropped from the sub-tabs of the Kits tab * menu entry "Build/Open Build/Run Target Selector" was renamed to "Build/Open Build and Run Kits Selector". * Use "Kit" instead of "Target" in miniprojecttargetselector. (The class was not renamed as it does indeed select targets, not kits) Change-Id: I0727e086e2dfa0e8aaaf89fdc6f2e3596c7a4314 Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
committed by
Eike Ziller
parent
328d205b62
commit
8ba422d07c
@@ -32,8 +32,8 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/id.h>
|
||||
#include <projectexplorer/profilechooser.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitchooser.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <ssh/sshconnection.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Internal {
|
||||
class StartRemoteDialogPrivate
|
||||
{
|
||||
public:
|
||||
ProfileChooser *profileChooser;
|
||||
KitChooser *kitChooser;
|
||||
QLineEdit *executable;
|
||||
QLineEdit *arguments;
|
||||
QLineEdit *workingDirectory;
|
||||
@@ -69,7 +69,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
setWindowTitle(tr("Start Remote Analysis"));
|
||||
|
||||
d->profileChooser = new ProfileChooser(this, ProfileChooser::RemoteDebugging);
|
||||
d->kitChooser = new KitChooser(this, KitChooser::RemoteDebugging);
|
||||
d->executable = new QLineEdit(this);
|
||||
d->arguments = new QLineEdit(this);
|
||||
d->workingDirectory = new QLineEdit(this);
|
||||
@@ -80,7 +80,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
|
||||
|
||||
QFormLayout *formLayout = new QFormLayout;
|
||||
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||
formLayout->addRow(tr("Target:"), d->profileChooser);
|
||||
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);
|
||||
@@ -91,14 +91,14 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
|
||||
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
settings->beginGroup(QLatin1String("AnalyzerStartRemoteDialog"));
|
||||
QString profile = settings->value(QLatin1String("profile")).toString();
|
||||
d->profileChooser->setCurrentProfileId(Core::Id(profile));
|
||||
QString kit = settings->value(QLatin1String("profile")).toString();
|
||||
d->kitChooser->setCurrentKitId(Core::Id(kit));
|
||||
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->profileChooser, SIGNAL(activated(int)), SLOT(validate()));
|
||||
connect(d->kitChooser, SIGNAL(activated(int)), SLOT(validate()));
|
||||
connect(d->executable, SIGNAL(textChanged(QString)), SLOT(validate()));
|
||||
connect(d->workingDirectory, SIGNAL(textChanged(QString)), SLOT(validate()));
|
||||
connect(d->arguments, SIGNAL(textChanged(QString)), SLOT(validate()));
|
||||
@@ -117,7 +117,7 @@ void StartRemoteDialog::accept()
|
||||
{
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
settings->beginGroup(QLatin1String("AnalyzerStartRemoteDialog"));
|
||||
settings->setValue(QLatin1String("profile"), d->profileChooser->currentProfileId().toString());
|
||||
settings->setValue(QLatin1String("profile"), d->kitChooser->currentKitId().toString());
|
||||
settings->setValue(QLatin1String("executable"), d->executable->text());
|
||||
settings->setValue(QLatin1String("workingDirectory"), d->workingDirectory->text());
|
||||
settings->setValue(QLatin1String("arguments"), d->arguments->text());
|
||||
@@ -134,8 +134,8 @@ void StartRemoteDialog::validate()
|
||||
|
||||
QSsh::SshConnectionParameters StartRemoteDialog::sshParams() const
|
||||
{
|
||||
Profile *profile = d->profileChooser->currentProfile();
|
||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
||||
Kit *kit = d->kitChooser->currentKit();
|
||||
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
|
||||
return device->sshParameters();
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Target:</string>
|
||||
<string>Kit:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
|
@@ -37,7 +37,7 @@
|
||||
|
||||
#include <debugger/debuggerengine.h>
|
||||
#include <debugger/debuggerplugin.h>
|
||||
#include <debugger/debuggerprofileinformation.h>
|
||||
#include <debugger/debuggerkitinformation.h>
|
||||
#include <debugger/debuggerrunner.h>
|
||||
#include <debugger/debuggerstartparameters.h>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qt4projectmanager/qt4nodes.h>
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
#include <QDir>
|
||||
|
||||
@@ -93,10 +93,10 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
|
||||
|
||||
if (runConfig->debuggerAspect()->useCppDebugger()) {
|
||||
params.languages |= CppLanguage;
|
||||
Profile *profile = target->profile();
|
||||
params.sysRoot = SysRootProfileInformation::sysRoot(profile).toString();
|
||||
params.debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
||||
if (ToolChain *tc = ToolChainProfileInformation::toolChain(profile))
|
||||
Kit *kit = target->kit();
|
||||
params.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
|
||||
params.debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString();
|
||||
if (ToolChain *tc = ToolChainKitInformation::toolChain(kit))
|
||||
params.toolChainAbi = tc->targetAbi();
|
||||
params.executable = project->rootQt4ProjectNode()->buildDir() + QLatin1String("/app_process");
|
||||
params.remoteChannel = runConfig->remoteChannel();
|
||||
@@ -105,7 +105,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
|
||||
foreach (Qt4ProFileNode *node, nodes)
|
||||
if (node->projectType() == ApplicationTemplate)
|
||||
params.solibSearchPath.append(node->targetInformation().buildDir);
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(profile);
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
|
||||
params.solibSearchPath.append(qtSoPaths(version));
|
||||
}
|
||||
if (runConfig->debuggerAspect()->useQmlDebugger()) {
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
@@ -119,15 +119,15 @@ QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(Target *
|
||||
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
|
||||
return ids;
|
||||
|
||||
if (!parent->project()->supportsProfile(parent->profile()))
|
||||
if (!parent->project()->supportsKit(parent->kit()))
|
||||
return ids;
|
||||
|
||||
ToolChain *tc = ToolChainProfileInformation::toolChain(parent->profile());
|
||||
ToolChain *tc = ToolChainKitInformation::toolChain(parent->kit());
|
||||
|
||||
if (!tc || tc->targetAbi().osFlavor() != Abi::AndroidLinuxFlavor)
|
||||
return ids;
|
||||
|
||||
if (QtSupport::QtProfileInformation::qtVersion(parent->profile())->type() != QLatin1String(Constants::ANDROIDQT))
|
||||
if (QtSupport::QtKitInformation::qtVersion(parent->kit())->type() != QLatin1String(Constants::ANDROIDQT))
|
||||
return ids;
|
||||
|
||||
ids << Core::Id(ANDROID_DEPLOYCONFIGURATION_ID);
|
||||
|
@@ -44,7 +44,7 @@
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qt4projectmanager/qt4nodes.h>
|
||||
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
#include <QDir>
|
||||
|
||||
@@ -97,7 +97,7 @@ bool AndroidDeployStep::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||
if (!version)
|
||||
return false;
|
||||
|
||||
|
@@ -37,7 +37,7 @@
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
|
@@ -44,7 +44,7 @@
|
||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qtsupport/customexecutablerunconfiguration.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
#include <QDir>
|
||||
@@ -81,7 +81,7 @@ bool AndroidManager::supportsAndroid(ProjectExplorer::Target *target)
|
||||
{
|
||||
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(target->project()))
|
||||
return false;
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
|
||||
return version && version->platformName() == QLatin1String(QtSupport::Constants::ANDROID_PLATFORM);
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ QString AndroidManager::targetApplicationPath(ProjectExplorer::Target *target)
|
||||
|
||||
bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *target)
|
||||
{
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
|
||||
Qt4ProjectManager::Qt4Project *qt4Project = qobject_cast<Qt4ProjectManager::Qt4Project*>(target->project());
|
||||
if (!qt4Project || !qt4Project->rootProjectNode() || !version)
|
||||
return false;
|
||||
@@ -555,7 +555,7 @@ void AndroidManager::updateTarget(ProjectExplorer::Target *target, const QString
|
||||
|
||||
Utils::FileName AndroidManager::localLibsRulesFilePath(ProjectExplorer::Target *target)
|
||||
{
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
|
||||
if (!version)
|
||||
return Utils::FileName();
|
||||
return Utils::FileName::fromString(version->qmakeProperty("QT_INSTALL_LIBS") + QLatin1String("/rules.xml"));
|
||||
@@ -573,7 +573,7 @@ QString AndroidManager::loadLocalJars(ProjectExplorer::Target *target, int apiLe
|
||||
|
||||
QStringList AndroidManager::availableQtLibs(ProjectExplorer::Target *target)
|
||||
{
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
|
||||
if (!target->activeRunConfiguration())
|
||||
return QStringList();
|
||||
|
||||
|
@@ -36,7 +36,7 @@
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
@@ -34,10 +34,10 @@
|
||||
#include "androidtoolchain.h"
|
||||
#include "androidmanager.h"
|
||||
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qtsupport/qtoutputformatter.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -87,7 +87,7 @@ AndroidConfig AndroidRunConfiguration::config() const
|
||||
|
||||
const Utils::FileName AndroidRunConfiguration::gdbCmd() const
|
||||
{
|
||||
ToolChain *tc = ToolChainProfileInformation::toolChain(target()->profile());
|
||||
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
||||
if (!tc)
|
||||
return Utils::FileName();
|
||||
return AndroidConfigurations::instance().gdbPath(tc->targetAbi().architecture());
|
||||
@@ -110,7 +110,7 @@ const QString AndroidRunConfiguration::remoteChannel() const
|
||||
|
||||
const QString AndroidRunConfiguration::dumperLib() const
|
||||
{
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||
if (!version)
|
||||
return QString();
|
||||
return version->gdbDebuggingHelperLibrary();
|
||||
|
@@ -43,7 +43,7 @@
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qt4projectmanager/qt4nodes.h>
|
||||
#include <qtsupport/customexecutablerunconfiguration.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ RunConfiguration *AndroidRunConfigurationFactory::clone(Target *parent, RunConfi
|
||||
|
||||
bool AndroidRunConfigurationFactory::canHandle(Target *t) const
|
||||
{
|
||||
if (!t->project()->supportsProfile(t->profile()))
|
||||
if (!t->project()->supportsKit(t->kit()))
|
||||
return false;
|
||||
return AndroidManager::supportsAndroid(t);
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
|
||||
#include <utils/environment.h>
|
||||
@@ -93,7 +93,7 @@ void AndroidToolChain::addToEnvironment(Utils::Environment &env) const
|
||||
|
||||
Qt4Project *qt4pro = qobject_cast<Qt4Project *>(ProjectExplorerPlugin::instance()->currentProject());
|
||||
if (!qt4pro || !qt4pro->activeTarget()
|
||||
|| QtSupport::QtProfileInformation::qtVersion(qt4pro->activeTarget()->profile())->type() != QLatin1String(Constants::ANDROIDQT))
|
||||
|| QtSupport::QtKitInformation::qtVersion(qt4pro->activeTarget()->kit())->type() != QLatin1String(Constants::ANDROIDQT))
|
||||
return;
|
||||
|
||||
QString ndk_host = QLatin1String(
|
||||
|
@@ -42,7 +42,7 @@
|
||||
#include "configurestep.h"
|
||||
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
@@ -117,7 +117,7 @@ void AutotoolsBuildConfiguration::setBuildDirectory(const QString &buildDirector
|
||||
|
||||
IOutputParser *AutotoolsBuildConfiguration::createOutputParser() const
|
||||
{
|
||||
ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile());
|
||||
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
|
||||
if (tc)
|
||||
return tc->outputParser();
|
||||
return 0;
|
||||
@@ -214,7 +214,7 @@ AutotoolsBuildConfiguration *AutotoolsBuildConfigurationFactory::createDefaultCo
|
||||
|
||||
bool AutotoolsBuildConfigurationFactory::canHandle(const Target *t) const
|
||||
{
|
||||
if (!t->project()->supportsProfile(t->profile()))
|
||||
if (!t->project()->supportsKit(t->kit()))
|
||||
return false;
|
||||
return t->project()->id() == Constants::AUTOTOOLS_PROJECT_ID;
|
||||
}
|
||||
|
@@ -44,8 +44,8 @@
|
||||
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/buildenvironmentwidget.h>
|
||||
#include <projectexplorer/profilemanager.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
@@ -158,9 +158,9 @@ bool AutotoolsProject::fromMap(const QVariantMap &map)
|
||||
// Load the project tree structure.
|
||||
loadProjectTree();
|
||||
|
||||
Profile *defaultProfile = ProfileManager::instance()->defaultProfile();
|
||||
if (!activeTarget() && defaultProfile)
|
||||
addTarget(createTarget(defaultProfile));
|
||||
Kit *defaultKit = KitManager::instance()->defaultKit();
|
||||
if (!activeTarget() && defaultKit)
|
||||
addTarget(createTarget(defaultKit));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -418,7 +418,7 @@ void AutotoolsProject::updateCppCodeModel()
|
||||
QByteArray macros;
|
||||
|
||||
if (activeTarget()) {
|
||||
ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(activeTarget()->profile());
|
||||
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(activeTarget()->kit());
|
||||
if (tc) {
|
||||
const QList<HeaderPath> allHeaderPaths = tc->systemHeaderPaths();
|
||||
foreach (const HeaderPath &headerPath, allHeaderPaths) {
|
||||
|
@@ -41,7 +41,7 @@
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/gnumakeparser.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
@@ -174,7 +174,7 @@ bool MakeStep::init()
|
||||
|
||||
setIgnoreReturnValue(m_clean);
|
||||
|
||||
ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(bc->target()->profile());
|
||||
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
|
||||
|
||||
ProcessParameters *pp = processParameters();
|
||||
pp->setMacroExpander(bc->macroExpander());
|
||||
@@ -289,7 +289,7 @@ QString MakeStepConfigWidget::summaryText() const
|
||||
void MakeStepConfigWidget::updateDetails()
|
||||
{
|
||||
AutotoolsBuildConfiguration *bc = m_makeStep->autotoolsBuildConfiguration();
|
||||
ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(m_makeStep->target()->profile());
|
||||
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(m_makeStep->target()->kit());
|
||||
|
||||
if (tc) {
|
||||
QString arguments = Utils::QtcProcess::joinArgs(m_makeStep->m_buildTargets);
|
||||
@@ -303,7 +303,7 @@ void MakeStepConfigWidget::updateDetails()
|
||||
param.setArguments(arguments);
|
||||
m_summaryText = param.summary(displayName());
|
||||
} else {
|
||||
m_summaryText = QLatin1String("<b>") + ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget() + QLatin1String("</b>");
|
||||
m_summaryText = QLatin1String("<b>") + ProjectExplorer::ToolChainKitInformation::msgNoToolChainInTarget() + QLatin1String("</b>");
|
||||
}
|
||||
|
||||
emit updateSummary();
|
||||
|
@@ -36,12 +36,12 @@
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/gnumakeparser.h>
|
||||
#include <projectexplorer/ioutputparser.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtparser.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QInputDialog>
|
||||
@@ -113,11 +113,11 @@ ProjectExplorer::IOutputParser *CMakeBuildConfiguration::createOutputParser() co
|
||||
{
|
||||
ProjectExplorer::IOutputParser *parserchain = new ProjectExplorer::GnuMakeParser;
|
||||
|
||||
int versionId = QtSupport::QtProfileInformation::qtVersionId(target()->profile());
|
||||
int versionId = QtSupport::QtKitInformation::qtVersionId(target()->kit());
|
||||
if (versionId >= 0)
|
||||
parserchain->appendOutputParser(new QtSupport::QtParser);
|
||||
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile());
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
|
||||
if (tc)
|
||||
parserchain->appendOutputParser(tc->outputParser());
|
||||
return parserchain;
|
||||
@@ -126,7 +126,7 @@ ProjectExplorer::IOutputParser *CMakeBuildConfiguration::createOutputParser() co
|
||||
Utils::Environment CMakeBuildConfiguration::baseEnvironment() const
|
||||
{
|
||||
Utils::Environment env = BuildConfiguration::baseEnvironment();
|
||||
target()->profile()->addToEnvironment(env);
|
||||
target()->kit()->addToEnvironment(env);
|
||||
return env;
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::restore(ProjectExplorer
|
||||
|
||||
bool CMakeBuildConfigurationFactory::canHandle(const ProjectExplorer::Target *t) const
|
||||
{
|
||||
if (!t->project()->supportsProfile(t->profile()))
|
||||
if (!t->project()->supportsKit(t->kit()))
|
||||
return false;
|
||||
return qobject_cast<CMakeProject *>(t->project());
|
||||
}
|
||||
|
@@ -34,8 +34,8 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/profilemanager.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <texteditor/fontsettings.h>
|
||||
@@ -405,13 +405,13 @@ void CMakeRunPage::initializePage()
|
||||
m_generatorComboBox->clear();
|
||||
bool hasCodeBlocksGenerator = m_cmakeWizard->cmakeManager()->hasCodeBlocksMsvcGenerator();
|
||||
|
||||
QList<ProjectExplorer::Profile *> profileList =
|
||||
ProjectExplorer::ProfileManager::instance()->profiles();
|
||||
QList<ProjectExplorer::Kit *> kitList =
|
||||
ProjectExplorer::KitManager::instance()->kits();
|
||||
|
||||
foreach (ProjectExplorer::Profile *p, profileList) {
|
||||
QVariant profileVariant = qVariantFromValue(static_cast<void *>(p));
|
||||
foreach (ProjectExplorer::Kit *k, kitList) {
|
||||
QVariant kitVariant = qVariantFromValue(static_cast<void *>(k));
|
||||
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(p);
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
|
||||
if (!tc)
|
||||
continue;
|
||||
ProjectExplorer::Abi targetAbi = tc->targetAbi();
|
||||
@@ -421,21 +421,21 @@ void CMakeRunPage::initializePage()
|
||||
|| targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2010Flavor
|
||||
|| targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2012Flavor) {
|
||||
if (hasCodeBlocksGenerator && (cachedGenerator.isEmpty() || cachedGenerator == "NMake Makefiles"))
|
||||
m_generatorComboBox->addItem(tr("NMake Generator (%1)").arg(p->displayName()), profileVariant);
|
||||
m_generatorComboBox->addItem(tr("NMake Generator (%1)").arg(k->displayName()), kitVariant);
|
||||
} else if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor) {
|
||||
#ifdef Q_OS_WIN
|
||||
if (cachedGenerator.isEmpty() || cachedGenerator == "MinGW Makefiles")
|
||||
m_generatorComboBox->addItem(tr("MinGW Generator (%1)").arg(p->displayName()), profileVariant);
|
||||
m_generatorComboBox->addItem(tr("MinGW Generator (%1)").arg(p->displayName()), kitVariant);
|
||||
#else
|
||||
if (cachedGenerator.isEmpty() || cachedGenerator == "Unix Makefiles")
|
||||
m_generatorComboBox->addItem(tr("Unix Generator (%1)").arg(p->displayName()), profileVariant);
|
||||
m_generatorComboBox->addItem(tr("Unix Generator (%1)").arg(k->displayName()), kitVariant);
|
||||
#endif
|
||||
|
||||
}
|
||||
} else {
|
||||
// Non windows
|
||||
if (cachedGenerator.isEmpty() || cachedGenerator == "Unix Makefiles")
|
||||
m_generatorComboBox->addItem(tr("Unix Generator (%1)").arg(p->displayName()), profileVariant);
|
||||
m_generatorComboBox->addItem(tr("Unix Generator (%1)").arg(k->displayName()), kitVariant);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -448,15 +448,15 @@ void CMakeRunPage::runCMake()
|
||||
|
||||
int index = m_generatorComboBox->currentIndex();
|
||||
|
||||
ProjectExplorer::Profile *p = 0;
|
||||
ProjectExplorer::Kit *p = 0;
|
||||
if (index >= 0)
|
||||
p = static_cast<ProjectExplorer::Profile *>(m_generatorComboBox->itemData(index).value<void *>());
|
||||
p = static_cast<ProjectExplorer::Kit *>(m_generatorComboBox->itemData(index).value<void *>());
|
||||
if (!p) {
|
||||
m_output->appendPlainText(tr("No generator selected."));
|
||||
return;
|
||||
}
|
||||
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(p);
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(p);
|
||||
|
||||
m_runCMake->setEnabled(false);
|
||||
m_argumentsLineEdit->setEnabled(false);
|
||||
|
@@ -45,8 +45,8 @@
|
||||
#include <projectexplorer/buildenvironmentwidget.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/buildmanager.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/profilemanager.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qtsupport/customexecutablerunconfiguration.h>
|
||||
@@ -286,7 +286,7 @@ bool CMakeProject::parseCMakeLists()
|
||||
|
||||
createUiCodeModelSupport();
|
||||
|
||||
ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(activeTarget()->profile());
|
||||
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(activeTarget()->kit());
|
||||
if (!tc) {
|
||||
emit buildTargetsChanged();
|
||||
emit fileListChanged();
|
||||
@@ -530,9 +530,9 @@ bool CMakeProject::fromMap(const QVariantMap &map)
|
||||
if (!Project::fromMap(map))
|
||||
return false;
|
||||
|
||||
Profile *defaultProfile = ProfileManager::instance()->defaultProfile();
|
||||
if (!activeTarget() && defaultProfile)
|
||||
addTarget(createTarget(defaultProfile));
|
||||
Kit *defaultKit = KitManager::instance()->defaultKit();
|
||||
if (!activeTarget() && defaultKit)
|
||||
addTarget(createTarget(defaultKit));
|
||||
|
||||
// We have a user file, but we could still be missing the cbp file
|
||||
// or simply run createXml with the saved settings
|
||||
|
@@ -496,7 +496,7 @@ QString CMakeRunConfigurationFactory::displayNameForId(const Core::Id id) const
|
||||
|
||||
bool CMakeRunConfigurationFactory::canHandle(ProjectExplorer::Target *parent) const
|
||||
{
|
||||
if (!parent->project()->supportsProfile(parent->profile()))
|
||||
if (!parent->project()->supportsKit(parent->kit()))
|
||||
return false;
|
||||
return qobject_cast<CMakeProject *>(parent->project());
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/deployconfiguration.h>
|
||||
#include <projectexplorer/gnumakeparser.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
@@ -137,7 +137,7 @@ bool MakeStep::init()
|
||||
|
||||
setIgnoreReturnValue(m_clean);
|
||||
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile());
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
|
||||
ProcessParameters *pp = processParameters();
|
||||
pp->setMacroExpander(bc->macroExpander());
|
||||
pp->setEnvironment(bc->environment());
|
||||
@@ -308,7 +308,7 @@ void MakeStepConfigWidget::updateDetails()
|
||||
return;
|
||||
}
|
||||
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(m_makeStep->target()->profile());
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(m_makeStep->target()->kit());
|
||||
if (tc) {
|
||||
QString arguments = Utils::QtcProcess::joinArgs(m_makeStep->buildTargets());
|
||||
Utils::QtcProcess::addArgs(&arguments, m_makeStep->additionalArguments());
|
||||
@@ -321,7 +321,7 @@ void MakeStepConfigWidget::updateDetails()
|
||||
param.setArguments(arguments);
|
||||
m_summaryText = param.summary(displayName());
|
||||
} else {
|
||||
m_summaryText = QLatin1String("<b>") + ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget() + QLatin1String("</b>");
|
||||
m_summaryText = QLatin1String("<b>") + ProjectExplorer::ToolChainKitInformation::msgNoToolChainInTarget() + QLatin1String("</b>");
|
||||
}
|
||||
emit updateSummary();
|
||||
}
|
||||
|
@@ -38,8 +38,8 @@ HEADERS += \
|
||||
debuggerstartparameters.h \
|
||||
debuggerstreamops.h \
|
||||
debuggerstringutils.h \
|
||||
debuggerprofileconfigwidget.h \
|
||||
debuggerprofileinformation.h \
|
||||
debuggerkitconfigwidget.h \
|
||||
debuggerkitinformation.h \
|
||||
disassembleragent.h \
|
||||
disassemblerlines.h \
|
||||
loadcoredialog.h \
|
||||
@@ -92,8 +92,8 @@ SOURCES += \
|
||||
debuggerplugin.cpp \
|
||||
debuggerrunner.cpp \
|
||||
debuggerstreamops.cpp \
|
||||
debuggerprofileconfigwidget.cpp \
|
||||
debuggerprofileinformation.cpp \
|
||||
debuggerkitconfigwidget.cpp \
|
||||
debuggerkitinformation.cpp \
|
||||
disassembleragent.cpp \
|
||||
disassemblerlines.cpp \
|
||||
loadcoredialog.cpp \
|
||||
|
@@ -33,10 +33,10 @@ QtcPlugin {
|
||||
|
||||
files: [
|
||||
"debugger.qrc",
|
||||
"debuggerprofileconfigwidget.cpp",
|
||||
"debuggerprofileconfigwidget.h",
|
||||
"debuggerprofileinformation.cpp",
|
||||
"debuggerprofileinformation.h",
|
||||
"debuggerkitconfigwidget.cpp",
|
||||
"debuggerkitconfigwidget.h",
|
||||
"debuggerkitinformation.cpp",
|
||||
"debuggerkitinformation.h",
|
||||
"basewindow.cpp",
|
||||
"breakhandler.cpp",
|
||||
"breakhandler.h",
|
||||
|
@@ -32,15 +32,15 @@
|
||||
#include "debuggerstartparameters.h"
|
||||
|
||||
#include "debuggerconstants.h"
|
||||
#include "debuggerprofileinformation.h"
|
||||
#include "debuggerkitinformation.h"
|
||||
#include "debuggerstringutils.h"
|
||||
#include "cdb/cdbengine.h"
|
||||
#include "shared/hostutils.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/profilechooser.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitchooser.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <utils/historycompleter.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -88,7 +88,7 @@ namespace Internal {
|
||||
class StartApplicationDialogPrivate
|
||||
{
|
||||
public:
|
||||
ProfileChooser *profileChooser;
|
||||
KitChooser *kitChooser;
|
||||
PathChooser *localExecutablePathChooser;
|
||||
FancyLineEdit *arguments;
|
||||
PathChooser *workingDirectory;
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
bool operator==(const StartApplicationParameters &p) const { return equals(p); }
|
||||
bool operator!=(const StartApplicationParameters &p) const { return !equals(p); }
|
||||
|
||||
Id profileId;
|
||||
Id kitId;
|
||||
QString localExecutable;
|
||||
QString processArgs;
|
||||
QString workingDirectory;
|
||||
@@ -150,7 +150,7 @@ bool StartApplicationParameters::equals(const StartApplicationParameters &rhs) c
|
||||
&& breakAtMain == rhs.breakAtMain
|
||||
&& runInTerminal == rhs.runInTerminal
|
||||
&& serverStartScript == rhs.serverStartScript
|
||||
&& profileId == rhs.profileId
|
||||
&& kitId == rhs.kitId
|
||||
&& debugInfoLocation == rhs.debugInfoLocation;
|
||||
}
|
||||
|
||||
@@ -167,15 +167,15 @@ QString StartApplicationParameters::displayName() const
|
||||
name += QLatin1String("...");
|
||||
}
|
||||
|
||||
if (Profile *profile = ProfileManager::instance()->find(profileId))
|
||||
name += QString::fromLatin1(" (%1)").arg(profile->displayName());
|
||||
if (Kit *kit = KitManager::instance()->find(kitId))
|
||||
name += QString::fromLatin1(" (%1)").arg(kit->displayName());
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
void StartApplicationParameters::toSettings(QSettings *settings) const
|
||||
{
|
||||
settings->setValue(_("LastProfileId"), profileId.toString());
|
||||
settings->setValue(_("LastProfileId"), kitId.toString());
|
||||
settings->setValue(_("LastExternalExecutable"), localExecutable);
|
||||
settings->setValue(_("LastExternalExecutableArguments"), processArgs);
|
||||
settings->setValue(_("LastExternalWorkingDirectory"), workingDirectory);
|
||||
@@ -187,8 +187,8 @@ void StartApplicationParameters::toSettings(QSettings *settings) const
|
||||
|
||||
void StartApplicationParameters::fromSettings(const QSettings *settings)
|
||||
{
|
||||
const QString profileIdString = settings->value(_("LastProfileId")).toString();
|
||||
profileId = profileIdString.isEmpty() ? Id() : Id(profileIdString);
|
||||
const QString kitIdString = settings->value(_("LastProfileId")).toString();
|
||||
kitId = kitIdString.isEmpty() ? Id() : Id(kitIdString);
|
||||
localExecutable = settings->value(_("LastExternalExecutable")).toString();
|
||||
processArgs = settings->value(_("LastExternalExecutableArguments")).toString();
|
||||
workingDirectory = settings->value(_("LastExternalWorkingDirectory")).toString();
|
||||
@@ -225,7 +225,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
|
||||
|
||||
d->runInTerminalCheckBox = new QCheckBox(this);
|
||||
|
||||
d->profileChooser = new ProfileChooser(this, ProfileChooser::LocalDebugging);
|
||||
d->kitChooser = new KitChooser(this, KitChooser::LocalDebugging);
|
||||
|
||||
d->breakAtMainCheckBox = new QCheckBox(this);
|
||||
d->breakAtMainCheckBox->setText(QString());
|
||||
@@ -263,7 +263,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
|
||||
|
||||
QFormLayout *formLayout = new QFormLayout();
|
||||
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
||||
formLayout->addRow(tr("&Target:"), d->profileChooser);
|
||||
formLayout->addRow(tr("&Kit:"), d->kitChooser);
|
||||
formLayout->addRow(tr("Local &executable:"), d->localExecutablePathChooser);
|
||||
formLayout->addRow(tr("Command line &arguments:"), d->arguments);
|
||||
formLayout->addRow(tr("&Working directory:"), d->workingDirectory);
|
||||
@@ -319,9 +319,9 @@ void StartApplicationDialog::historyIndexChanged(int index)
|
||||
setParameters(v.value<StartApplicationParameters>());
|
||||
}
|
||||
|
||||
Id StartApplicationDialog::profileId() const
|
||||
Id StartApplicationDialog::kitId() const
|
||||
{
|
||||
return d->profileChooser->currentProfileId();
|
||||
return d->kitChooser->currentKitId();
|
||||
}
|
||||
|
||||
void StartApplicationDialog::updateState()
|
||||
@@ -373,9 +373,9 @@ bool StartApplicationDialog::run(QWidget *parent, QSettings *settings, DebuggerS
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
Profile *profile = dialog.d->profileChooser->currentProfile();
|
||||
QTC_ASSERT(profile, return false);
|
||||
fillParameters(sp, profile);
|
||||
Kit *kit = dialog.d->kitChooser->currentKit();
|
||||
QTC_ASSERT(kit, return false);
|
||||
fillParameters(sp, kit);
|
||||
|
||||
sp->executable = newParameters.localExecutable;
|
||||
sp->displayName = newParameters.displayName();
|
||||
@@ -387,7 +387,7 @@ bool StartApplicationDialog::run(QWidget *parent, QSettings *settings, DebuggerS
|
||||
sp->serverStartScript = newParameters.serverStartScript;
|
||||
sp->debugInfoLocation = newParameters.debugInfoLocation;
|
||||
|
||||
bool isLocal = DeviceProfileInformation::device(profile)->type()
|
||||
bool isLocal = DeviceKitInformation::device(kit)->type()
|
||||
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
||||
sp->startMode = isLocal ? StartExternal : StartRemoteProcess;
|
||||
return true;
|
||||
@@ -398,7 +398,7 @@ StartApplicationParameters StartApplicationDialog::parameters() const
|
||||
StartApplicationParameters result;
|
||||
result.localExecutable = d->localExecutablePathChooser->path();
|
||||
result.serverStartScript = d->serverStartScriptPathChooser->path();
|
||||
result.profileId = d->profileChooser->currentProfileId();
|
||||
result.kitId = d->kitChooser->currentKitId();
|
||||
result.debugInfoLocation = d->debuginfoPathChooser->path();
|
||||
result.processArgs = d->arguments->text();
|
||||
result.workingDirectory = d->workingDirectory->path();
|
||||
@@ -409,7 +409,7 @@ StartApplicationParameters StartApplicationDialog::parameters() const
|
||||
|
||||
void StartApplicationDialog::setParameters(const StartApplicationParameters &p)
|
||||
{
|
||||
d->profileChooser->setCurrentProfileId(p.profileId);
|
||||
d->kitChooser->setCurrentKitId(p.kitId);
|
||||
d->localExecutablePathChooser->setPath(p.localExecutable);
|
||||
d->serverStartScriptPathChooser->setPath(p.serverStartScript);
|
||||
d->debuginfoPathChooser->setPath(p.debugInfoLocation);
|
||||
@@ -430,7 +430,7 @@ class AttachToQmlPortDialogPrivate
|
||||
{
|
||||
public:
|
||||
QSpinBox *portSpinBox;
|
||||
ProfileChooser *profileChooser;
|
||||
KitChooser *kitChooser;
|
||||
};
|
||||
|
||||
AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
|
||||
@@ -440,7 +440,7 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
setWindowTitle(tr("Start Debugger"));
|
||||
|
||||
d->profileChooser = new ProfileChooser(this);
|
||||
d->kitChooser = new KitChooser(this);
|
||||
|
||||
d->portSpinBox = new QSpinBox(this);
|
||||
d->portSpinBox->setMaximum(65535);
|
||||
@@ -451,7 +451,7 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
|
||||
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
|
||||
|
||||
QFormLayout *formLayout = new QFormLayout();
|
||||
formLayout->addRow(tr("Target:"), d->profileChooser);
|
||||
formLayout->addRow(tr("Kit:"), d->kitChooser);
|
||||
formLayout->addRow(tr("&Port:"), d->portSpinBox);
|
||||
|
||||
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
|
||||
@@ -477,14 +477,14 @@ int AttachToQmlPortDialog::port() const
|
||||
return d->portSpinBox->value();
|
||||
}
|
||||
|
||||
Profile *AttachToQmlPortDialog::profile() const
|
||||
Kit *AttachToQmlPortDialog::kit() const
|
||||
{
|
||||
return d->profileChooser->currentProfile();
|
||||
return d->kitChooser->currentKit();
|
||||
}
|
||||
|
||||
void AttachToQmlPortDialog::setProfileId(const Id &id)
|
||||
void AttachToQmlPortDialog::setKitId(const Id &id)
|
||||
{
|
||||
d->profileChooser->setCurrentProfileId(id);
|
||||
d->kitChooser->setCurrentKitId(id);
|
||||
}
|
||||
|
||||
// --------- StartRemoteCdbDialog
|
||||
|
@@ -44,7 +44,7 @@ class QSettings;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core { class Id; }
|
||||
namespace ProjectExplorer { class Profile; }
|
||||
namespace ProjectExplorer { class Kit; }
|
||||
|
||||
namespace Debugger {
|
||||
class DebuggerStartParameters;
|
||||
@@ -78,7 +78,7 @@ private:
|
||||
void setParameters(const StartApplicationParameters &p);
|
||||
void setHistory(const QList<StartApplicationParameters> &l);
|
||||
void hideStartScript();
|
||||
Core::Id profileId() const;
|
||||
Core::Id kitId() const;
|
||||
|
||||
StartApplicationDialogPrivate *d;
|
||||
};
|
||||
@@ -94,8 +94,8 @@ public:
|
||||
int port() const;
|
||||
void setPort(const int port);
|
||||
|
||||
ProjectExplorer::Profile *profile() const;
|
||||
void setProfileId(const Core::Id &id);
|
||||
ProjectExplorer::Kit *kit() const;
|
||||
void setKitId(const Core::Id &id);
|
||||
|
||||
private:
|
||||
AttachToQmlPortDialogPrivate *d;
|
||||
|
@@ -28,12 +28,12 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "debuggerprofileconfigwidget.h"
|
||||
#include "debuggerkitconfigwidget.h"
|
||||
|
||||
#include "debuggerprofileinformation.h"
|
||||
#include "debuggerkitinformation.h"
|
||||
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -56,23 +56,23 @@ namespace Internal {
|
||||
static const char dgbToolsDownloadLink32C[] = "http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx";
|
||||
static const char dgbToolsDownloadLink64C[] = "http://www.microsoft.com/whdc/devtools/debugging/install64bit.Mspx";
|
||||
// -----------------------------------------------------------------------
|
||||
// DebuggerProfileConfigWidget:
|
||||
// DebuggerKitConfigWidget:
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
DebuggerProfileConfigWidget::DebuggerProfileConfigWidget(ProjectExplorer::Profile *p,
|
||||
const DebuggerProfileInformation *pi,
|
||||
QWidget *parent) :
|
||||
ProjectExplorer::ProfileConfigWidget(parent),
|
||||
m_profile(p),
|
||||
m_info(pi),
|
||||
DebuggerKitConfigWidget::DebuggerKitConfigWidget(ProjectExplorer::Kit *k,
|
||||
const DebuggerKitInformation *ki,
|
||||
QWidget *parent) :
|
||||
ProjectExplorer::KitConfigWidget(parent),
|
||||
m_kit(k),
|
||||
m_info(ki),
|
||||
m_chooser(new Utils::PathChooser)
|
||||
{
|
||||
setToolTip(tr("The debugger to use for this target."));
|
||||
setToolTip(tr("The debugger to use for this kit."));
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
layout->setMargin(0);
|
||||
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(p);
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
|
||||
if (tc && tc->targetAbi().os() == ProjectExplorer::Abi::WindowsOS
|
||||
&& tc->targetAbi().osFlavor() != ProjectExplorer::Abi::WindowsMSysFlavor) {
|
||||
QLabel *msvcDebuggerConfigLabel = new QLabel;
|
||||
@@ -104,43 +104,42 @@ DebuggerProfileConfigWidget::DebuggerProfileConfigWidget(ProjectExplorer::Profil
|
||||
connect(m_chooser, SIGNAL(changed(QString)), this, SIGNAL(dirty()));
|
||||
}
|
||||
|
||||
QString DebuggerProfileConfigWidget::displayName() const
|
||||
QString DebuggerKitConfigWidget::displayName() const
|
||||
{
|
||||
return tr("Debugger:");
|
||||
}
|
||||
|
||||
void DebuggerProfileConfigWidget::makeReadOnly()
|
||||
void DebuggerKitConfigWidget::makeReadOnly()
|
||||
{
|
||||
m_chooser->setEnabled(false);
|
||||
}
|
||||
|
||||
void DebuggerProfileConfigWidget::apply()
|
||||
void DebuggerKitConfigWidget::apply()
|
||||
{
|
||||
Utils::FileName fn = m_chooser->fileName();
|
||||
DebuggerProfileInformation::setDebuggerCommand(m_profile, fn);
|
||||
DebuggerKitInformation::setDebuggerCommand(m_kit, fn);
|
||||
}
|
||||
|
||||
void DebuggerProfileConfigWidget::discard()
|
||||
void DebuggerKitConfigWidget::discard()
|
||||
{
|
||||
m_chooser->setFileName(DebuggerProfileInformation::debuggerCommand(m_profile));
|
||||
m_chooser->setFileName(DebuggerKitInformation::debuggerCommand(m_kit));
|
||||
}
|
||||
|
||||
bool DebuggerProfileConfigWidget::isDirty() const
|
||||
bool DebuggerKitConfigWidget::isDirty() const
|
||||
{
|
||||
return m_chooser->fileName() != DebuggerProfileInformation::debuggerCommand(m_profile);
|
||||
return m_chooser->fileName() != DebuggerKitInformation::debuggerCommand(m_kit);
|
||||
}
|
||||
|
||||
QWidget *DebuggerProfileConfigWidget::buttonWidget() const
|
||||
QWidget *DebuggerKitConfigWidget::buttonWidget() const
|
||||
{
|
||||
return m_chooser->buttonAtIndex(1);
|
||||
}
|
||||
|
||||
void DebuggerProfileConfigWidget::autoDetectDebugger()
|
||||
void DebuggerKitConfigWidget::autoDetectDebugger()
|
||||
{
|
||||
QVariant v = m_info->defaultValue(m_profile);
|
||||
QVariant v = m_info->defaultValue(m_kit);
|
||||
m_chooser->setFileName(Utils::FileName::fromString(v.toString()));
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
} // namespace Debugger
|
@@ -28,33 +28,33 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef DEBUGGER_DEBUGGERPROFILECONFIGWIDGET_H
|
||||
#define DEBUGGER_DEBUGGERPROFILECONFIGWIDGET_H
|
||||
#ifndef DEBUGGER_DEBUGGERKITCONFIGWIDGET_H
|
||||
#define DEBUGGER_DEBUGGERKITCONFIGWIDGET_H
|
||||
|
||||
#include <projectexplorer/profileconfigwidget.h>
|
||||
#include <projectexplorer/kitconfigwidget.h>
|
||||
|
||||
#include <QLabel>
|
||||
#include <debuggerprofileinformation.h>
|
||||
#include <debuggerkitinformation.h>
|
||||
|
||||
namespace ProjectExplorer { class Profile; }
|
||||
namespace ProjectExplorer { class Kit; }
|
||||
namespace Utils { class PathChooser; }
|
||||
|
||||
namespace Debugger {
|
||||
class DebuggerProfileInformation;
|
||||
class DebuggerKitInformation;
|
||||
|
||||
namespace Internal {
|
||||
// -----------------------------------------------------------------------
|
||||
// DebuggerProfileConfigWidget:
|
||||
// DebuggerKitConfigWidget:
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
class DebuggerProfileConfigWidget : public ProjectExplorer::ProfileConfigWidget
|
||||
class DebuggerKitConfigWidget : public ProjectExplorer::KitConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DebuggerProfileConfigWidget(ProjectExplorer::Profile *p,
|
||||
const DebuggerProfileInformation *pi,
|
||||
QWidget *parent = 0);
|
||||
DebuggerKitConfigWidget(ProjectExplorer::Kit *p,
|
||||
const DebuggerKitInformation *ki,
|
||||
QWidget *parent = 0);
|
||||
|
||||
QString displayName() const;
|
||||
|
||||
@@ -69,12 +69,12 @@ private slots:
|
||||
void autoDetectDebugger();
|
||||
|
||||
private:
|
||||
ProjectExplorer::Profile *m_profile;
|
||||
const DebuggerProfileInformation *m_info;
|
||||
ProjectExplorer::Kit *m_kit;
|
||||
const DebuggerKitInformation *m_info;
|
||||
Utils::PathChooser *m_chooser;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
#endif // DEBUGGER_DEBUGGERPROFILEINFORMATION_H
|
||||
#endif // DEBUGGER_DEBUGGERKITINFORMATION_H
|
@@ -28,9 +28,9 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "debuggerprofileinformation.h"
|
||||
#include "debuggerkitinformation.h"
|
||||
|
||||
#include "debuggerprofileconfigwidget.h"
|
||||
#include "debuggerkitconfigwidget.h"
|
||||
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
@@ -115,30 +115,30 @@ static QPair<QString, QString> autoDetectCdbDebugger()
|
||||
namespace Debugger {
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// DebuggerProfileInformation:
|
||||
// DebuggerKitInformation:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
static const char DEBUGGER_INFORMATION[] = "Debugger.Information";
|
||||
|
||||
DebuggerProfileInformation::DebuggerProfileInformation()
|
||||
DebuggerKitInformation::DebuggerKitInformation()
|
||||
{
|
||||
setObjectName(QLatin1String("DebuggerProfileInformation"));
|
||||
setObjectName(QLatin1String("DebuggerKitInformation"));
|
||||
}
|
||||
|
||||
Core::Id DebuggerProfileInformation::dataId() const
|
||||
Core::Id DebuggerKitInformation::dataId() const
|
||||
{
|
||||
static Core::Id id = Core::Id(DEBUGGER_INFORMATION);
|
||||
return id;
|
||||
}
|
||||
|
||||
unsigned int DebuggerProfileInformation::priority() const
|
||||
unsigned int DebuggerKitInformation::priority() const
|
||||
{
|
||||
return 28000;
|
||||
}
|
||||
|
||||
QVariant DebuggerProfileInformation::defaultValue(Profile *p) const
|
||||
QVariant DebuggerKitInformation::defaultValue(Kit *k) const
|
||||
{
|
||||
ToolChain *tc = ToolChainProfileInformation::toolChain(p);
|
||||
ToolChain *tc = ToolChainKitInformation::toolChain(k);
|
||||
Abi abi = Abi::hostAbi();
|
||||
if (tc)
|
||||
abi = tc->targetAbi();
|
||||
@@ -166,11 +166,11 @@ QVariant DebuggerProfileInformation::defaultValue(Profile *p) const
|
||||
return env.searchInPath(debugger);
|
||||
}
|
||||
|
||||
QList<Task> DebuggerProfileInformation::validate(Profile *p) const
|
||||
QList<Task> DebuggerKitInformation::validate(Kit *k) const
|
||||
{
|
||||
const Core::Id id(Constants::TASK_CATEGORY_BUILDSYSTEM);
|
||||
QList<Task> result;
|
||||
FileName dbg = debuggerCommand(p);
|
||||
FileName dbg = debuggerCommand(k);
|
||||
if (dbg.isEmpty()) {
|
||||
result << Task(Task::Warning, tr("No debugger set up."), FileName(), -1, id);
|
||||
return result;
|
||||
@@ -182,7 +182,7 @@ QList<Task> DebuggerProfileInformation::validate(Profile *p) const
|
||||
else if (!fi.isExecutable())
|
||||
result << Task(Task::Error, tr("Debugger not exectutable."), FileName(), -1, id);
|
||||
|
||||
if (ToolChain *tc = ToolChainProfileInformation::toolChain(p)) {
|
||||
if (ToolChain *tc = ToolChainKitInformation::toolChain(k)) {
|
||||
// We need an absolute path to be able to locate Python on Windows.
|
||||
const Abi abi = tc->targetAbi();
|
||||
if (abi.os() == Abi::WindowsOS && !fi.isAbsolute()) {
|
||||
@@ -202,25 +202,25 @@ QList<Task> DebuggerProfileInformation::validate(Profile *p) const
|
||||
return result;
|
||||
}
|
||||
|
||||
ProfileConfigWidget *DebuggerProfileInformation::createConfigWidget(Profile *p) const
|
||||
KitConfigWidget *DebuggerKitInformation::createConfigWidget(Kit *k) const
|
||||
{
|
||||
return new Internal::DebuggerProfileConfigWidget(p, this);
|
||||
return new Internal::DebuggerKitConfigWidget(k, this);
|
||||
}
|
||||
|
||||
ProfileInformation::ItemList DebuggerProfileInformation::toUserOutput(Profile *p) const
|
||||
KitInformation::ItemList DebuggerKitInformation::toUserOutput(Kit *k) const
|
||||
{
|
||||
return ItemList() << qMakePair(tr("Debugger"), debuggerCommand(p).toUserOutput());
|
||||
return ItemList() << qMakePair(tr("Debugger"), debuggerCommand(k).toUserOutput());
|
||||
}
|
||||
|
||||
FileName DebuggerProfileInformation::debuggerCommand(const Profile *p)
|
||||
FileName DebuggerKitInformation::debuggerCommand(const Kit *k)
|
||||
{
|
||||
return FileName::fromString(p ? p->value(Core::Id(DEBUGGER_INFORMATION)).toString() : QString());
|
||||
return FileName::fromString(k ? k->value(Core::Id(DEBUGGER_INFORMATION)).toString() : QString());
|
||||
}
|
||||
|
||||
void DebuggerProfileInformation::setDebuggerCommand(Profile *p, const FileName &command)
|
||||
void DebuggerKitInformation::setDebuggerCommand(Kit *k, const FileName &command)
|
||||
{
|
||||
QTC_ASSERT(p, return);
|
||||
p->setValue(Core::Id(DEBUGGER_INFORMATION), command.toString());
|
||||
QTC_ASSERT(k, return);
|
||||
k->setValue(Core::Id(DEBUGGER_INFORMATION), command.toString());
|
||||
}
|
||||
|
||||
} // namespace Debugger
|
@@ -28,38 +28,38 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef DEBUGGER_DEBUGGERPROFILEINFORMATION_H
|
||||
#define DEBUGGER_DEBUGGERPROFILEINFORMATION_H
|
||||
#ifndef DEBUGGER_DEBUGGERKITINFORMATION_H
|
||||
#define DEBUGGER_DEBUGGERKITINFORMATION_H
|
||||
|
||||
#include "debugger_global.h"
|
||||
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
|
||||
namespace Debugger {
|
||||
|
||||
class DEBUGGER_EXPORT DebuggerProfileInformation : public ProjectExplorer::ProfileInformation
|
||||
class DEBUGGER_EXPORT DebuggerKitInformation : public ProjectExplorer::KitInformation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DebuggerProfileInformation();
|
||||
DebuggerKitInformation();
|
||||
|
||||
Core::Id dataId() const;
|
||||
|
||||
unsigned int priority() const; // the higher the closer to the top.
|
||||
|
||||
QVariant defaultValue(ProjectExplorer::Profile *p) const;
|
||||
QVariant defaultValue(ProjectExplorer::Kit *k) const;
|
||||
|
||||
QList<ProjectExplorer::Task> validate(ProjectExplorer::Profile *p) const;
|
||||
QList<ProjectExplorer::Task> validate(ProjectExplorer::Kit *k) const;
|
||||
|
||||
ProjectExplorer::ProfileConfigWidget *createConfigWidget(ProjectExplorer::Profile *p) const;
|
||||
ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *k) const;
|
||||
|
||||
ItemList toUserOutput(ProjectExplorer::Profile *p) const;
|
||||
ItemList toUserOutput(ProjectExplorer::Kit *k) const;
|
||||
|
||||
static Utils::FileName debuggerCommand(const ProjectExplorer::Profile *p);
|
||||
static void setDebuggerCommand(ProjectExplorer::Profile *p, const Utils::FileName &command);
|
||||
static Utils::FileName debuggerCommand(const ProjectExplorer::Kit *k);
|
||||
static void setDebuggerCommand(ProjectExplorer::Kit *k, const Utils::FileName &command);
|
||||
};
|
||||
|
||||
} // namespace Debugger
|
||||
|
||||
#endif // DEBUGGER_DEBUGGERPROFILEINFORMATION_H
|
||||
#endif // DEBUGGER_DEBUGGERKITINFORMATION_H
|
@@ -41,7 +41,7 @@
|
||||
#include "debuggerrunner.h"
|
||||
#include "debuggerruncontrolfactory.h"
|
||||
#include "debuggerstringutils.h"
|
||||
#include "debuggerprofileinformation.h"
|
||||
#include "debuggerkitinformation.h"
|
||||
#include "memoryagent.h"
|
||||
#include "breakpoint.h"
|
||||
#include "breakhandler.h"
|
||||
@@ -101,9 +101,9 @@
|
||||
#include <projectexplorer/projectexplorersettings.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/profilechooser.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/profilemanager.h>
|
||||
#include <projectexplorer/kitchooser.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
@@ -561,13 +561,13 @@ static inline QString executableForPid(qint64 pid)
|
||||
return QString();
|
||||
}
|
||||
|
||||
class AbiProfileMatcher : public ProfileMatcher
|
||||
class AbiKitMatcher : public KitMatcher
|
||||
{
|
||||
public:
|
||||
explicit AbiProfileMatcher(const QList<Abi> &abis) : m_abis(abis) {}
|
||||
bool matches(const Profile *p) const
|
||||
explicit AbiKitMatcher(const QList<Abi> &abis) : m_abis(abis) {}
|
||||
bool matches(const Kit *p) const
|
||||
{
|
||||
if (const ToolChain *tc = ToolChainProfileInformation::toolChain(p))
|
||||
if (const ToolChain *tc = ToolChainKitInformation::toolChain(p))
|
||||
return m_abis.contains(tc->targetAbi());
|
||||
return false;
|
||||
}
|
||||
@@ -576,13 +576,13 @@ private:
|
||||
const QList<Abi> m_abis;
|
||||
};
|
||||
|
||||
class CompatibleAbiProfileMatcher : public ProfileMatcher
|
||||
class CompatibleAbiKitMatcher : public KitMatcher
|
||||
{
|
||||
public:
|
||||
explicit CompatibleAbiProfileMatcher(const QList<Abi> &abis) : m_abis(abis) {}
|
||||
bool matches(const Profile *p) const
|
||||
explicit CompatibleAbiKitMatcher(const QList<Abi> &abis) : m_abis(abis) {}
|
||||
bool matches(const Kit *p) const
|
||||
{
|
||||
if (const ToolChain *tc = ToolChainProfileInformation::toolChain(p))
|
||||
if (const ToolChain *tc = ToolChainKitInformation::toolChain(p))
|
||||
foreach (const Abi &a, m_abis)
|
||||
if (a.isCompatibleWith(tc->targetAbi()))
|
||||
return true;
|
||||
@@ -593,14 +593,14 @@ private:
|
||||
const QList<Abi> m_abis;
|
||||
};
|
||||
|
||||
class CdbMatcher : ProfileMatcher
|
||||
class CdbMatcher : KitMatcher
|
||||
{
|
||||
public:
|
||||
CdbMatcher(char wordWidth = 0) : m_wordWidth(wordWidth) {}
|
||||
|
||||
bool matches(const Profile *profile) const
|
||||
bool matches(const Kit *k) const
|
||||
{
|
||||
const ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
||||
const ToolChain *tc = ToolChainKitInformation::toolChain(k);
|
||||
QTC_ASSERT(tc, return false);
|
||||
const Abi abi = tc->targetAbi();
|
||||
if (abi.architecture() != Abi::X86Architecture
|
||||
@@ -615,31 +615,31 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
// Find a CDB profile for debugging unknown processes.
|
||||
// Find a CDB kit for debugging unknown processes.
|
||||
// On a 64bit OS, prefer a 64bit debugger.
|
||||
static Profile *findUniversalCdbProfile()
|
||||
static Kit *findUniversalCdbKit()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
if (Utils::winIs64BitSystem()) {
|
||||
CdbMatcher matcher64(64);
|
||||
if (Profile *cdb64Profile = ProfileManager::instance()->find(&matcher64))
|
||||
return cdb64Profile;
|
||||
if (Kit *cdb64Kit = KitManager::instance()->find(&matcher64))
|
||||
return cdb64Kit;
|
||||
}
|
||||
#endif
|
||||
CdbMatcher matcher;
|
||||
return ProfileManager::instance()->find(&matcher);
|
||||
return KitManager::instance()->find(&matcher);
|
||||
}
|
||||
|
||||
private:
|
||||
const char m_wordWidth;
|
||||
};
|
||||
|
||||
void fillParameters(DebuggerStartParameters *sp, const Profile *profile /* = 0 */)
|
||||
void fillParameters(DebuggerStartParameters *sp, const Kit *kit /* = 0 */)
|
||||
{
|
||||
if (!profile) {
|
||||
if (!kit) {
|
||||
// This code can only be reached when starting via the command line
|
||||
// (-debug pid or executable) or attaching from runconfiguration
|
||||
// without specifying a profile. Try to find a profile via ABI.
|
||||
// without specifying a kit. Try to find a kit via ABI.
|
||||
QList<Abi> abis;
|
||||
if (sp->toolChainAbi.isValid()) {
|
||||
abis.push_back(sp->toolChainAbi);
|
||||
@@ -653,25 +653,25 @@ void fillParameters(DebuggerStartParameters *sp, const Profile *profile /* = 0 *
|
||||
abis = Abi::abisOfBinary(Utils::FileName::fromString(sp->executable));
|
||||
}
|
||||
if (!abis.isEmpty()) {
|
||||
AbiProfileMatcher matcher(abis);
|
||||
profile = ProfileManager::instance()->find(&matcher);
|
||||
if (!profile) {
|
||||
CompatibleAbiProfileMatcher matcher(abis);
|
||||
profile = ProfileManager::instance()->find(&matcher);
|
||||
AbiKitMatcher matcher(abis);
|
||||
kit = KitManager::instance()->find(&matcher);
|
||||
if (!kit) {
|
||||
CompatibleAbiKitMatcher matcher(abis);
|
||||
kit = KitManager::instance()->find(&matcher);
|
||||
}
|
||||
}
|
||||
if (!profile)
|
||||
profile = ProfileManager::instance()->defaultProfile();
|
||||
if (!kit)
|
||||
kit = KitManager::instance()->defaultKit();
|
||||
}
|
||||
|
||||
sp->sysRoot = SysRootProfileInformation::sysRoot(profile).toString();
|
||||
sp->debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
||||
sp->sysRoot = SysRootKitInformation::sysRoot(kit).toString();
|
||||
sp->debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString();
|
||||
|
||||
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
||||
ToolChain *tc = ToolChainKitInformation::toolChain(kit);
|
||||
if (tc)
|
||||
sp->toolChainAbi = tc->targetAbi();
|
||||
|
||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
||||
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
|
||||
if (device) {
|
||||
sp->connParams = device->sshParameters();
|
||||
sp->remoteChannel = sp->connParams.host + QLatin1Char(':') + QString::number(sp->connParams.port);
|
||||
@@ -1388,14 +1388,14 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
||||
{
|
||||
const QString &option = *it;
|
||||
// '-debug <pid>'
|
||||
// '-debug <exe>[,server=<server:port>][,core=<core>][,profile=<profile>]'
|
||||
// '-debug <exe>[,server=<server:port>][,core=<core>][,kit=<kit>]'
|
||||
if (*it == _("-debug")) {
|
||||
++it;
|
||||
if (it == cend) {
|
||||
*errorMessage = msgParameterMissing(*it);
|
||||
return false;
|
||||
}
|
||||
Profile *profile = 0;
|
||||
Kit *kit = 0;
|
||||
DebuggerStartParameters sp;
|
||||
qulonglong pid = it->toULongLong();
|
||||
if (pid) {
|
||||
@@ -1433,12 +1433,12 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
||||
sp.displayName = tr("Core file \"%1\"").arg(sp.coreFile);
|
||||
sp.startMessage = tr("Attaching to core file %1.").arg(sp.coreFile);
|
||||
}
|
||||
else if (key == QLatin1String("profile")) {
|
||||
profile = ProfileManager::instance()->find(Id(val));
|
||||
else if (key == QLatin1String("kit")) {
|
||||
kit = KitManager::instance()->find(Id(val));
|
||||
}
|
||||
}
|
||||
}
|
||||
fillParameters(&sp, profile);
|
||||
fillParameters(&sp, kit);
|
||||
if (sp.startMode == StartExternal) {
|
||||
sp.displayName = tr("Executable file \"%1\"").arg(sp.executable);
|
||||
sp.startMessage = tr("Debugging file %1.").arg(sp.executable);
|
||||
@@ -1458,7 +1458,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
||||
return false;
|
||||
}
|
||||
DebuggerStartParameters sp;
|
||||
fillParameters(&sp, CdbMatcher::findUniversalCdbProfile());
|
||||
fillParameters(&sp, CdbMatcher::findUniversalCdbKit());
|
||||
sp.startMode = AttachCrashedExternal;
|
||||
sp.crashParameter = it->section(QLatin1Char(':'), 0, 0);
|
||||
sp.attachPID = it->section(QLatin1Char(':'), 1, 1).toULongLong();
|
||||
@@ -1579,7 +1579,7 @@ void DebuggerPluginPrivate::attachCore()
|
||||
{
|
||||
AttachCoreDialog dlg(mainWindow());
|
||||
|
||||
dlg.setProfileId(Id(configValue(_("LastExternalProfile")).toString()));
|
||||
dlg.setKitId(Id(configValue(_("LastExternalProfile")).toString()));
|
||||
dlg.setLocalExecutableFile(configValue(_("LastExternalExecutableFile")).toString());
|
||||
dlg.setLocalCoreFile(configValue(_("LastLocalCoreFile")).toString());
|
||||
dlg.setRemoteCoreFile(configValue(_("LastRemoteCoreFile")).toString());
|
||||
@@ -1591,12 +1591,12 @@ void DebuggerPluginPrivate::attachCore()
|
||||
setConfigValue(_("LastExternalExecutableFile"), dlg.localExecutableFile());
|
||||
setConfigValue(_("LastLocalCoreFile"), dlg.localCoreFile());
|
||||
setConfigValue(_("LastRemoteCoreFile"), dlg.remoteCoreFile());
|
||||
setConfigValue(_("LastExternalProfile"), dlg.profile()->id().toString());
|
||||
setConfigValue(_("LastExternalProfile"), dlg.kit()->id().toString());
|
||||
setConfigValue(_("LastExternalStartScript"), dlg.overrideStartScript());
|
||||
|
||||
DebuggerStartParameters sp;
|
||||
QString display = dlg.isLocal() ? dlg.localCoreFile() : dlg.remoteCoreFile();
|
||||
fillParameters(&sp, dlg.profile());
|
||||
fillParameters(&sp, dlg.kit());
|
||||
sp.masterEngineType = GdbEngineType;
|
||||
sp.executable = dlg.localExecutableFile();
|
||||
sp.coreFile = dlg.localCoreFile();
|
||||
@@ -1611,9 +1611,9 @@ void DebuggerPluginPrivate::startRemoteCdbSession()
|
||||
{
|
||||
const QString connectionKey = _("CdbRemoteConnection");
|
||||
DebuggerStartParameters sp;
|
||||
Profile *profile = CdbMatcher::findUniversalCdbProfile();
|
||||
QTC_ASSERT(profile, return);
|
||||
fillParameters(&sp, profile);
|
||||
Kit *kit = CdbMatcher::findUniversalCdbKit();
|
||||
QTC_ASSERT(kit, return);
|
||||
fillParameters(&sp, kit);
|
||||
sp.startMode = AttachToRemoteServer;
|
||||
sp.closeMode = KillAtClose;
|
||||
StartRemoteCdbDialog dlg(mainWindow());
|
||||
@@ -1660,10 +1660,10 @@ void DebuggerPluginPrivate::attachToProcess(bool startServerOnly)
|
||||
}
|
||||
|
||||
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||
ProfileChooser *profileChooser = dlg->profileChooser();
|
||||
Profile *profile = profileChooser->currentProfile();
|
||||
QTC_ASSERT(profile, return);
|
||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
||||
KitChooser *kitChooser = dlg->kitChooser();
|
||||
Kit *kit = kitChooser->currentKit();
|
||||
QTC_ASSERT(kit, return);
|
||||
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
|
||||
QTC_ASSERT(device, return);
|
||||
DeviceProcess process = dlg->currentProcess();
|
||||
if (process.pid == 0) {
|
||||
@@ -1683,7 +1683,7 @@ void DebuggerPluginPrivate::attachToProcess(bool startServerOnly)
|
||||
|
||||
if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
||||
DebuggerStartParameters sp;
|
||||
fillParameters(&sp, profile);
|
||||
fillParameters(&sp, kit);
|
||||
sp.attachPID = process.pid;
|
||||
sp.displayName = tr("Process %1").arg(process.pid);
|
||||
sp.executable = process.exe;
|
||||
@@ -1704,11 +1704,11 @@ void DebuggerPluginPrivate::attachExternalApplication(ProjectExplorer::RunContro
|
||||
sp.startMode = AttachExternal;
|
||||
sp.closeMode = DetachAtClose;
|
||||
sp.toolChainAbi = rc->abi();
|
||||
Profile *profile = 0;
|
||||
Kit *kit = 0;
|
||||
if (const RunConfiguration *runConfiguration = rc->runConfiguration())
|
||||
if (const Target *target = runConfiguration->target())
|
||||
profile = target->profile();
|
||||
fillParameters(&sp, profile);
|
||||
kit = target->kit();
|
||||
fillParameters(&sp, kit);
|
||||
DebuggerRunControlFactory::createAndScheduleRun(sp);
|
||||
}
|
||||
|
||||
@@ -1723,19 +1723,19 @@ void DebuggerPluginPrivate::attachToQmlPort()
|
||||
else
|
||||
dlg.setPort(sp.qmlServerPort);
|
||||
|
||||
const QVariant profileId = configValue(_("LastProfile"));
|
||||
if (profileId.isValid())
|
||||
dlg.setProfileId(Id(profileId.toString()));
|
||||
const QVariant kitId = configValue(_("LastProfile"));
|
||||
if (kitId.isValid())
|
||||
dlg.setKitId(Id(kitId.toString()));
|
||||
|
||||
if (dlg.exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
||||
Profile *profile = dlg.profile();
|
||||
QTC_ASSERT(profile, return);
|
||||
Kit *kit = dlg.kit();
|
||||
QTC_ASSERT(kit, return);
|
||||
setConfigValue(_("LastQmlServerPort"), dlg.port());
|
||||
setConfigValue(_("LastProfile"), profile->id().toString());
|
||||
setConfigValue(_("LastProfile"), kit->id().toString());
|
||||
|
||||
fillParameters(&sp, profile);
|
||||
fillParameters(&sp, kit);
|
||||
sp.qmlServerAddress = sp.connParams.host;
|
||||
sp.qmlServerPort = dlg.port();
|
||||
sp.startMode = AttachToRemoteProcess;
|
||||
@@ -3369,7 +3369,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
|
||||
mstart->addSeparator(globalcontext, Constants::G_GENERAL);
|
||||
mstart->addSeparator(globalcontext, Constants::G_SPECIAL);
|
||||
|
||||
ProfileManager::instance()->registerProfileInformation(new DebuggerProfileInformation);
|
||||
KitManager::instance()->registerKitInformation(new DebuggerKitInformation);
|
||||
|
||||
return theDebuggerCore->initialize(arguments, errorMessage);
|
||||
}
|
||||
@@ -3463,12 +3463,12 @@ static Target *activeTarget()
|
||||
return project->activeTarget();
|
||||
}
|
||||
|
||||
static Profile *currentProfile()
|
||||
static Kit *currentKit()
|
||||
{
|
||||
Target *t = activeTarget();
|
||||
if (!t || !t->isEnabled())
|
||||
return 0;
|
||||
return activeTarget()->profile();
|
||||
return activeTarget()->kit();
|
||||
}
|
||||
|
||||
static LocalApplicationRunConfiguration *activeLocalRunConfiguration()
|
||||
@@ -3516,7 +3516,7 @@ void DebuggerPluginPrivate::testPythonDumpers1()
|
||||
void DebuggerPluginPrivate::testPythonDumpers2()
|
||||
{
|
||||
DebuggerStartParameters sp;
|
||||
fillParameters(&sp, currentProfile());
|
||||
fillParameters(&sp, currentKit());
|
||||
sp.executable = activeLocalRunConfiguration()->executable();
|
||||
testRunProject(sp, TestCallBack(this, "testPythonDumpers3"));
|
||||
}
|
||||
@@ -3548,7 +3548,7 @@ void DebuggerPluginPrivate::testStateMachine1()
|
||||
void DebuggerPluginPrivate::testStateMachine2()
|
||||
{
|
||||
DebuggerStartParameters sp;
|
||||
fillParameters(&sp, currentProfile());
|
||||
fillParameters(&sp, currentKit());
|
||||
sp.executable = activeLocalRunConfiguration()->executable();
|
||||
sp.testCase = TestNoBoundsOfCurrentFunction;
|
||||
testRunProject(sp, TestCallBack(this, "testStateMachine3"));
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include "debuggerplugin.h"
|
||||
#include "debuggerstringutils.h"
|
||||
#include "debuggerstartparameters.h"
|
||||
#include "debuggerprofileinformation.h"
|
||||
#include "debuggerkitinformation.h"
|
||||
#include "lldb/lldbenginehost.h"
|
||||
#include "debuggertooltipmanager.h"
|
||||
|
||||
@@ -485,8 +485,8 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
|
||||
QTC_ASSERT(rc, return sp);
|
||||
|
||||
Target *target = runConfiguration->target();
|
||||
Profile *profile = target ? target->profile() : ProfileManager::instance()->defaultProfile();
|
||||
fillParameters(&sp, profile);
|
||||
Kit *kit = target ? target->kit() : KitManager::instance()->defaultKit();
|
||||
fillParameters(&sp, kit);
|
||||
sp.environment = rc->environment();
|
||||
sp.workingDirectory = rc->workingDirectory();
|
||||
|
||||
@@ -624,7 +624,7 @@ static void fixupEngineTypes(DebuggerStartParameters &sp, RunConfiguration *rc)
|
||||
if (rc) {
|
||||
DebuggerRunConfigurationAspect *aspect = rc->debuggerAspect();
|
||||
if (const Target *target = rc->target())
|
||||
fillParameters(&sp, target->profile());
|
||||
fillParameters(&sp, target->kit());
|
||||
const bool useCppDebugger = aspect->useCppDebugger();
|
||||
const bool useQmlDebugger = aspect->useQmlDebugger();
|
||||
if (useQmlDebugger) {
|
||||
|
@@ -38,7 +38,7 @@
|
||||
#include <ssh/sshconnection.h>
|
||||
#include <utils/environment.h>
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/profile.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <QMetaType>
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
|
||||
namespace Internal {
|
||||
|
||||
void fillParameters(DebuggerStartParameters *sp, const ProjectExplorer::Profile *profile = 0);
|
||||
void fillParameters(DebuggerStartParameters *sp, const ProjectExplorer::Kit *kit = 0);
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
@@ -33,14 +33,14 @@
|
||||
#include "debuggercore.h"
|
||||
#include "debuggermainwindow.h"
|
||||
#include "debuggerplugin.h"
|
||||
#include "debuggerprofileinformation.h"
|
||||
#include "debuggerkitinformation.h"
|
||||
#include "debuggerrunner.h"
|
||||
#include "debuggerruncontrolfactory.h"
|
||||
#include "debuggerstartparameters.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <projectexplorer/profilechooser.h>
|
||||
#include <projectexplorer/kitchooser.h>
|
||||
#include <projectexplorer/devicesupport/deviceprocesslist.h>
|
||||
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
||||
#include <ssh/sshconnection.h>
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
DeviceProcessesDialog *dialog;
|
||||
bool startServerOnly;
|
||||
DeviceProcess process;
|
||||
Profile *profile;
|
||||
Kit *kit;
|
||||
IDevice::ConstPtr device;
|
||||
|
||||
DeviceUsedPortsGatherer gatherer;
|
||||
@@ -81,9 +81,9 @@ GdbServerStarter::GdbServerStarter(DeviceProcessesDialog *dlg, bool startServerO
|
||||
{
|
||||
d = new StartGdbServerDialogPrivate;
|
||||
d->dialog = dlg;
|
||||
d->profile = dlg->profileChooser()->currentProfile();
|
||||
d->kit = dlg->kitChooser()->currentKit();
|
||||
d->process = dlg->currentProcess();
|
||||
d->device = DeviceProfileInformation::device(d->profile);
|
||||
d->device = DeviceKitInformation::device(d->kit);
|
||||
d->startServerOnly = startServerOnly;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ void GdbServerStarter::handleProcessErrorOutput()
|
||||
|
||||
void GdbServerStarter::attach(int port)
|
||||
{
|
||||
QString sysroot = SysRootProfileInformation::sysRoot(d->profile).toString();
|
||||
QString sysroot = SysRootKitInformation::sysRoot(d->kit).toString();
|
||||
QString binary;
|
||||
QString localExecutable;
|
||||
QString candidate = sysroot + d->process.exe;
|
||||
@@ -207,7 +207,7 @@ void GdbServerStarter::attach(int port)
|
||||
}
|
||||
|
||||
DebuggerStartParameters sp;
|
||||
fillParameters(&sp, d->profile);
|
||||
fillParameters(&sp, d->kit);
|
||||
sp.masterEngineType = GdbEngineType;
|
||||
sp.connParams.port = port;
|
||||
sp.displayName = tr("Remote: \"%1:%2\"").arg(sp.connParams.host).arg(port);
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#define STARTGDBSERVERDIALOG_H
|
||||
|
||||
#include "debugger_global.h"
|
||||
#include <projectexplorer/profile.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/devicesupport/deviceprocessesdialog.h>
|
||||
|
||||
namespace Debugger {
|
||||
|
@@ -36,8 +36,8 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/profilechooser.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitchooser.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <ssh/sshconnection.h>
|
||||
#include <ssh/sshremoteprocessrunner.h>
|
||||
#include <ssh/sftpdefs.h>
|
||||
@@ -93,7 +93,7 @@ class SelectRemoteFileDialog : public QDialog
|
||||
public:
|
||||
explicit SelectRemoteFileDialog(QWidget *parent);
|
||||
|
||||
void attachToDevice(Profile *profile);
|
||||
void attachToDevice(Kit *k);
|
||||
QString localFile() const { return m_localFile; }
|
||||
QString remoteFile() const { return m_remoteFile; }
|
||||
|
||||
@@ -151,11 +151,11 @@ SelectRemoteFileDialog::SelectRemoteFileDialog(QWidget *parent)
|
||||
SLOT(handleConnectionError(QString)));
|
||||
}
|
||||
|
||||
void SelectRemoteFileDialog::attachToDevice(Profile *profile)
|
||||
void SelectRemoteFileDialog::attachToDevice(Kit *k)
|
||||
{
|
||||
m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||
QTC_ASSERT(profile, return);
|
||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
||||
QTC_ASSERT(k, return);
|
||||
IDevice::ConstPtr device = DeviceKitInformation::device(k);
|
||||
QTC_ASSERT(device, return);
|
||||
QSsh::SshConnectionParameters sshParams = device->sshParameters();
|
||||
m_fileSystemModel.setSshConnection(sshParams);
|
||||
@@ -223,7 +223,7 @@ void SelectRemoteFileDialog::selectFile()
|
||||
class AttachCoreDialogPrivate
|
||||
{
|
||||
public:
|
||||
ProfileChooser *profileChooser;
|
||||
KitChooser *kitChooser;
|
||||
|
||||
QSettings *settings;
|
||||
|
||||
@@ -245,7 +245,7 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
|
||||
|
||||
d->settings = ICore::settings();
|
||||
|
||||
d->profileChooser = new ProfileChooser(this);
|
||||
d->kitChooser = new KitChooser(this);
|
||||
|
||||
d->selectRemoteCoreButton = new QPushButton(tr("Browse..."), this);
|
||||
d->remoteCoreFileName = new QLineEdit(this);
|
||||
@@ -277,7 +277,7 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
|
||||
formLayout->setContentsMargins(0, 0, 0, 0);
|
||||
formLayout->setHorizontalSpacing(6);
|
||||
formLayout->setVerticalSpacing(6);
|
||||
formLayout->addRow(tr("Target:"), d->profileChooser);
|
||||
formLayout->addRow(tr("Kit:"), d->kitChooser);
|
||||
formLayout->addRow(tr("&Executable:"), d->localExecFileName);
|
||||
formLayout->addRow(tr("Core file:"), coreLayout);
|
||||
formLayout->addRow(tr("Override &start script:"), d->overrideStartScriptFileName);
|
||||
@@ -296,7 +296,7 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
|
||||
|
||||
connect(d->selectRemoteCoreButton, SIGNAL(clicked()), SLOT(selectRemoteCoreFile()));
|
||||
connect(d->remoteCoreFileName, SIGNAL(textChanged(QString)), SLOT(changed()));
|
||||
connect(d->profileChooser, SIGNAL(activated(int)), SLOT(changed()));
|
||||
connect(d->kitChooser, SIGNAL(activated(int)), SLOT(changed()));
|
||||
connect(d->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
||||
connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept()));
|
||||
}
|
||||
@@ -308,19 +308,19 @@ AttachCoreDialog::~AttachCoreDialog()
|
||||
|
||||
bool AttachCoreDialog::isLocal() const
|
||||
{
|
||||
Profile *profile = d->profileChooser->currentProfile();
|
||||
QTC_ASSERT(profile, return false);
|
||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
||||
Kit *k = d->kitChooser->currentKit();
|
||||
QTC_ASSERT(k, return false);
|
||||
IDevice::ConstPtr device = DeviceKitInformation::device(k);
|
||||
QTC_ASSERT(device, return false);
|
||||
SshConnectionParameters sshParams = device->sshParameters();
|
||||
d->settings->setValue(QLatin1String("LastProfile"),
|
||||
d->profileChooser->currentProfileId().toString());
|
||||
d->kitChooser->currentKitId().toString());
|
||||
return sshParams.host.isEmpty();
|
||||
}
|
||||
|
||||
void AttachCoreDialog::changed()
|
||||
{
|
||||
bool isValid = d->profileChooser->currentIndex() >= 0
|
||||
bool isValid = d->kitChooser->currentIndex() >= 0
|
||||
&& !localCoreFile().isEmpty();
|
||||
d->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(isValid);
|
||||
|
||||
@@ -341,7 +341,7 @@ void AttachCoreDialog::selectRemoteCoreFile()
|
||||
QTC_ASSERT(!isLocal(), return);
|
||||
SelectRemoteFileDialog dlg(this);
|
||||
dlg.setWindowTitle(tr("Select Remote Core File"));
|
||||
dlg.attachToDevice(d->profileChooser->currentProfile());
|
||||
dlg.attachToDevice(d->kitChooser->currentKit());
|
||||
if (dlg.exec() == QDialog::Rejected)
|
||||
return;
|
||||
d->localCoreFileName->setPath(dlg.localFile());
|
||||
@@ -379,15 +379,15 @@ QString AttachCoreDialog::remoteCoreFile() const
|
||||
return d->remoteCoreFileName->text();
|
||||
}
|
||||
|
||||
void AttachCoreDialog::setProfileId(const Core::Id &id)
|
||||
void AttachCoreDialog::setKitId(const Core::Id &id)
|
||||
{
|
||||
d->profileChooser->setCurrentProfileId(id);
|
||||
d->kitChooser->setCurrentKitId(id);
|
||||
changed();
|
||||
}
|
||||
|
||||
Profile *AttachCoreDialog::profile() const
|
||||
Kit *AttachCoreDialog::kit() const
|
||||
{
|
||||
return d->profileChooser->currentProfile();
|
||||
return d->kitChooser->currentKit();
|
||||
}
|
||||
|
||||
QString AttachCoreDialog::overrideStartScript() const
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include <QDialog>
|
||||
|
||||
namespace Core { class Id; }
|
||||
namespace ProjectExplorer { class Profile; }
|
||||
namespace ProjectExplorer { class Kit; }
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
@@ -56,12 +56,12 @@ public:
|
||||
bool isLocal() const;
|
||||
|
||||
// For persistance.
|
||||
ProjectExplorer::Profile *profile() const;
|
||||
ProjectExplorer::Kit *kit() const;
|
||||
void setLocalExecutableFile(const QString &executable);
|
||||
void setLocalCoreFile(const QString &core);
|
||||
void setRemoteCoreFile(const QString &core);
|
||||
void setOverrideStartScript(const QString &scriptName);
|
||||
void setProfileId(const Core::Id &id);
|
||||
void setKitId(const Core::Id &id);
|
||||
|
||||
private slots:
|
||||
void changed();
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include "genericproject.h"
|
||||
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <utils/pathchooser.h>
|
||||
@@ -113,7 +113,7 @@ BuildConfigWidget *GenericBuildConfiguration::createConfigWidget()
|
||||
|
||||
IOutputParser *GenericBuildConfiguration::createOutputParser() const
|
||||
{
|
||||
ToolChain *tc = ToolChainProfileInformation::toolChain(target()->profile());
|
||||
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
||||
return tc ? tc->outputParser() : 0;
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ BuildConfiguration *GenericBuildConfigurationFactory::restore(Target *parent, co
|
||||
|
||||
bool GenericBuildConfigurationFactory::canHandle(const Target *t) const
|
||||
{
|
||||
if (!t->project()->supportsProfile(t->profile()))
|
||||
if (!t->project()->supportsKit(t->kit()))
|
||||
return false;
|
||||
return qobject_cast<GenericProject *>(t->project());
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/gnumakeparser.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
@@ -119,7 +119,7 @@ bool GenericMakeStep::init()
|
||||
setIgnoreReturnValue(m_clean);
|
||||
|
||||
setOutputParser(new GnuMakeParser());
|
||||
ToolChain *tc = ToolChainProfileInformation::toolChain(bc->target()->profile());
|
||||
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
||||
if (tc)
|
||||
appendOutputParser(tc->outputParser());
|
||||
outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory());
|
||||
@@ -169,7 +169,7 @@ QString GenericMakeStep::makeCommand() const
|
||||
{
|
||||
QString command = m_makeCommand;
|
||||
if (command.isEmpty()) {
|
||||
ToolChain *tc = ToolChainProfileInformation::toolChain(target()->profile());
|
||||
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
||||
if (tc)
|
||||
command = tc->makeCommand();
|
||||
else
|
||||
@@ -243,7 +243,7 @@ GenericMakeStepConfigWidget::GenericMakeStepConfigWidget(GenericMakeStep *makeSt
|
||||
connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
|
||||
this, SLOT(updateDetails()));
|
||||
|
||||
connect(m_makeStep->target(), SIGNAL(profileChanged()),
|
||||
connect(m_makeStep->target(), SIGNAL(kitChanged()),
|
||||
this, SLOT(updateMakeOverrrideLabel()));
|
||||
}
|
||||
|
||||
|
@@ -43,8 +43,8 @@
|
||||
#include <projectexplorer/buildenvironmentwidget.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/headerpath.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/profilemanager.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <qtsupport/customexecutablerunconfiguration.h>
|
||||
#include <utils/fileutils.h>
|
||||
@@ -250,7 +250,7 @@ void GenericProject::refresh(RefreshOptions options)
|
||||
new CPlusPlus::CppModelManagerInterface::ProjectPart);
|
||||
|
||||
ToolChain *tc = activeTarget() ?
|
||||
ToolChainProfileInformation::toolChain(activeTarget()->profile()) : 0;
|
||||
ToolChainKitInformation::toolChain(activeTarget()->kit()) : 0;
|
||||
if (tc) {
|
||||
part->defines = tc->predefinedMacros(QStringList());
|
||||
part->defines += '\n';
|
||||
@@ -430,9 +430,9 @@ bool GenericProject::fromMap(const QVariantMap &map)
|
||||
if (!Project::fromMap(map))
|
||||
return false;
|
||||
|
||||
Profile *defaultProfile = ProfileManager::instance()->defaultProfile();
|
||||
if (!activeTarget() && defaultProfile)
|
||||
addTarget(createTarget(defaultProfile));
|
||||
Kit *defaultKit = KitManager::instance()->defaultKit();
|
||||
if (!activeTarget() && defaultKit)
|
||||
addTarget(createTarget(defaultKit));
|
||||
|
||||
// Sanity check: We need both a buildconfiguration and a runconfiguration!
|
||||
QList<Target *> targetList = targets();
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <utils/filesystemwatcher.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -612,7 +612,7 @@ DebianManager::ActionStatus DebianManager::createTemplate(Qt4ProjectManager::Qt4
|
||||
<< (packageName + QLatin1Char('_')
|
||||
+ AbstractMaemoPackageCreationStep::DefaultVersionNumber);
|
||||
|
||||
QtSupport::BaseQtVersion *lqt = QtSupport::QtProfileInformation::qtVersion(bc->target()->profile());
|
||||
QtSupport::BaseQtVersion *lqt = QtSupport::QtKitInformation::qtVersion(bc->target()->kit());
|
||||
if (!lqt) {
|
||||
raiseError(tr("Unable to create Debian templates: No Qt version set."));
|
||||
return ActionFailed;
|
||||
@@ -653,7 +653,7 @@ DebianManager::ActionStatus DebianManager::createTemplate(Qt4ProjectManager::Qt4
|
||||
|
||||
setPackageName(debianDir, packageName);
|
||||
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(bc->target()->profile());
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(bc->target()->kit());
|
||||
|
||||
const QByteArray sec = section(deviceType);
|
||||
const QByteArray nameField = packageManagerNameFieldName(deviceType);
|
||||
@@ -674,7 +674,7 @@ Utils::FileName DebianManager::debianDirectory(ProjectExplorer::Target *target)
|
||||
{
|
||||
Utils::FileName path = Utils::FileName::fromString(target->project()->projectDirectory());
|
||||
path.appendPath(PackagingDirName);
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target->profile());
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target->kit());
|
||||
if (deviceType == HarmattanOsType)
|
||||
path.appendPath(QLatin1String("debian_harmattan"));
|
||||
else if (deviceType == Maemo5OsType)
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#include "maemoqemumanager.h"
|
||||
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <remotelinux/abstractremotelinuxdeployservice.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
}
|
||||
|
||||
MaemoQemuRuntime rt;
|
||||
const int qtId = QtSupport::QtProfileInformation::qtVersionId(profile());
|
||||
const int qtId = QtSupport::QtKitInformation::qtVersionId(profile());
|
||||
if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) {
|
||||
MaemoQemuManager::instance().startRuntime();
|
||||
emit errorMessage(tr("Cannot deploy: Qemu was not running. "
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#include "maemoqemumanager.h"
|
||||
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <remotelinux/abstractuploadandinstallpackageservice.h>
|
||||
#include <remotelinux/remotelinuxdeployconfiguration.h>
|
||||
#include <ssh/sshconnection.h>
|
||||
@@ -117,7 +117,7 @@ MaemoUploadAndInstallPackageStep::MaemoUploadAndInstallPackageStep(ProjectExplor
|
||||
void MaemoUploadAndInstallPackageStep::ctor()
|
||||
{
|
||||
setDefaultDisplayName(displayName());
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||
if (deviceType == HarmattanOsType)
|
||||
m_deployService = new HarmattanUploadAndInstallPackageAction(this);
|
||||
else
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include "maemoconstants.h"
|
||||
#include "qt4maemodeployconfiguration.h"
|
||||
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qt4projectmanager/qt4nodes.h>
|
||||
#include <remotelinux/deployablefile.h>
|
||||
@@ -130,7 +130,7 @@ void MaemoDeployConfigurationWidget::addDesktopFile()
|
||||
DeployableFile d;
|
||||
d.remoteDir = QLatin1String("/usr/share/applications");
|
||||
Core::Id deviceType
|
||||
= ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(deployConfiguration()->target()->profile());
|
||||
= ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(deployConfiguration()->target()->kit());
|
||||
if (deviceType == Maemo5OsType)
|
||||
d.remoteDir += QLatin1String("/hildon");
|
||||
d.localFilePath = desktopFilePath;
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include "maemoremotemounter.h"
|
||||
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <ssh/sshconnection.h>
|
||||
@@ -63,15 +63,15 @@ MaemoDeploymentMounter::~MaemoDeploymentMounter() {}
|
||||
|
||||
void MaemoDeploymentMounter::setupMounts(SshConnection *connection,
|
||||
const QList<MaemoMountSpecification> &mountSpecs,
|
||||
const Profile *profile)
|
||||
const Kit *k)
|
||||
{
|
||||
QTC_ASSERT(m_state == Inactive, return);
|
||||
|
||||
m_mountSpecs = mountSpecs;
|
||||
m_connection = connection;
|
||||
m_profile = profile;
|
||||
m_devConf = DeviceProfileInformation::device(profile);
|
||||
m_mounter->setParameters(m_devConf, MaemoGlobal::maddeRoot(profile));
|
||||
m_kit = k;
|
||||
m_devConf = DeviceKitInformation::device(k);
|
||||
m_mounter->setParameters(m_devConf, MaemoGlobal::maddeRoot(k));
|
||||
connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError()));
|
||||
setState(UnmountingOldDirs);
|
||||
unmount();
|
||||
|
@@ -36,7 +36,7 @@
|
||||
#include <projectexplorer/devicesupport/idevice.h>
|
||||
#include <utils/portlist.h>
|
||||
|
||||
namespace ProjectExplorer { class Profile; }
|
||||
namespace ProjectExplorer { class Kit; }
|
||||
namespace QSsh { class SshConnection; }
|
||||
namespace Utils { class FileName; }
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
// Connection must be in connected state.
|
||||
void setupMounts(QSsh::SshConnection *connection,
|
||||
const QList<MaemoMountSpecification> &mountSpecs,
|
||||
const ProjectExplorer::Profile *profile);
|
||||
const ProjectExplorer::Kit *k);
|
||||
void tearDownMounts();
|
||||
|
||||
signals:
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
ProjectExplorer::IDevice::ConstPtr m_devConf;
|
||||
MaemoRemoteMounter * const m_mounter;
|
||||
QList<MaemoMountSpecification> m_mountSpecs;
|
||||
const ProjectExplorer::Profile *m_profile;
|
||||
const ProjectExplorer::Kit *m_kit;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -41,7 +41,7 @@
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
#include <remotelinux/genericdirectuploadstep.h>
|
||||
#include <remotelinux/remotelinuxcheckforfreediskspacestep.h>
|
||||
@@ -69,7 +69,7 @@ QList<Core::Id> MaemoDeployStepFactory::availableCreationIds(BuildStepList *pare
|
||||
return ids;
|
||||
|
||||
QString platform;
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(parent->target()->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(parent->target()->kit());
|
||||
if (version)
|
||||
platform = version->platformName();
|
||||
|
||||
@@ -121,7 +121,7 @@ bool MaemoDeployStepFactory::canCreate(BuildStepList *parent, const Core::Id id)
|
||||
|
||||
BuildStep *MaemoDeployStepFactory::create(BuildStepList *parent, const Core::Id id)
|
||||
{
|
||||
Core::Id deviceType = DeviceTypeProfileInformation::deviceTypeId(parent->target()->profile());
|
||||
Core::Id deviceType = DeviceTypeKitInformation::deviceTypeId(parent->target()->kit());
|
||||
|
||||
if (id == MaemoInstallDebianPackageToSysrootStep::Id)
|
||||
return new MaemoInstallDebianPackageToSysrootStep(parent);
|
||||
|
@@ -33,11 +33,11 @@
|
||||
#include "maemoqemumanager.h"
|
||||
|
||||
#include <projectexplorer/devicesupport/idevice.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <remotelinux/remotelinux_constants.h>
|
||||
#include <utils/environment.h>
|
||||
|
||||
@@ -58,9 +58,9 @@ namespace {
|
||||
static const QLatin1String binQmake("/bin/qmake" EXEC_SUFFIX);
|
||||
} // namespace
|
||||
|
||||
bool MaemoGlobal::hasMaemoDevice(const Profile *p)
|
||||
bool MaemoGlobal::hasMaemoDevice(const Kit *k)
|
||||
{
|
||||
IDevice::ConstPtr dev = DeviceProfileInformation::device(p);
|
||||
IDevice::ConstPtr dev = DeviceKitInformation::device(k);
|
||||
if (dev.isNull())
|
||||
return false;
|
||||
|
||||
@@ -68,9 +68,9 @@ bool MaemoGlobal::hasMaemoDevice(const Profile *p)
|
||||
return type == Maemo5OsType || type == HarmattanOsType;
|
||||
}
|
||||
|
||||
bool MaemoGlobal::supportsMaemoDevice(const Profile *p)
|
||||
bool MaemoGlobal::supportsMaemoDevice(const Kit *p)
|
||||
{
|
||||
const Core::Id type = DeviceTypeProfileInformation::deviceTypeId(p);
|
||||
const Core::Id type = DeviceTypeKitInformation::deviceTypeId(p);
|
||||
return type == Maemo5OsType || type == HarmattanOsType;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ QString MaemoGlobal::devrootshPath()
|
||||
|
||||
int MaemoGlobal::applicationIconSize(const Target *target)
|
||||
{
|
||||
Core::Id deviceType = DeviceTypeProfileInformation::deviceTypeId(target->profile());
|
||||
Core::Id deviceType = DeviceTypeKitInformation::deviceTypeId(target->kit());
|
||||
return deviceType == HarmattanOsType ? 80 : 64;
|
||||
}
|
||||
|
||||
@@ -144,10 +144,10 @@ QString MaemoGlobal::remoteSourceProfilesCommand()
|
||||
return QString::fromAscii(remoteCall);
|
||||
}
|
||||
|
||||
Utils::PortList MaemoGlobal::freePorts(const Profile *profile)
|
||||
Utils::PortList MaemoGlobal::freePorts(const Kit *k)
|
||||
{
|
||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
||||
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtProfileInformation::qtVersion(profile);
|
||||
IDevice::ConstPtr device = DeviceKitInformation::device(k);
|
||||
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(k);
|
||||
|
||||
if (!device || !qtVersion)
|
||||
return Utils::PortList();
|
||||
@@ -167,9 +167,9 @@ QString MaemoGlobal::maddeRoot(const QString &qmakePath)
|
||||
return dir.absolutePath();
|
||||
}
|
||||
|
||||
Utils::FileName MaemoGlobal::maddeRoot(const Profile *profile)
|
||||
Utils::FileName MaemoGlobal::maddeRoot(const Kit *k)
|
||||
{
|
||||
return SysRootProfileInformation::sysRoot(profile).parentDir().parentDir();
|
||||
return SysRootKitInformation::sysRoot(k).parentDir().parentDir();
|
||||
}
|
||||
|
||||
QString MaemoGlobal::targetRoot(const QString &qmakePath)
|
||||
|
@@ -45,7 +45,7 @@ class QProcess;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class Profile;
|
||||
class Kit;
|
||||
class Target;
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
@@ -81,8 +81,8 @@ class MaemoGlobal
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::MaemoGlobal)
|
||||
public:
|
||||
static bool hasMaemoDevice(const ProjectExplorer::Profile *p);
|
||||
static bool supportsMaemoDevice(const ProjectExplorer::Profile *p);
|
||||
static bool hasMaemoDevice(const ProjectExplorer::Kit *k);
|
||||
static bool supportsMaemoDevice(const ProjectExplorer::Kit *p);
|
||||
static bool isValidMaemo5QtVersion(const QString &qmakePath);
|
||||
static bool isValidHarmattanQtVersion(const QString &qmakePath);
|
||||
|
||||
@@ -91,12 +91,12 @@ public:
|
||||
static int applicationIconSize(const ProjectExplorer::Target *target);
|
||||
static QString remoteSudo(Core::Id deviceType, const QString &uname);
|
||||
static QString remoteSourceProfilesCommand();
|
||||
static Utils::PortList freePorts(const ProjectExplorer::Profile *profile);
|
||||
static Utils::PortList freePorts(const ProjectExplorer::Kit *k);
|
||||
|
||||
static void addMaddeEnvironment(Utils::Environment &env, const QString &qmakePath);
|
||||
static void transformMaddeCall(QString &command, QStringList &args, const QString &qmakePath);
|
||||
static QString maddeRoot(const QString &qmakePath);
|
||||
static Utils::FileName maddeRoot(const ProjectExplorer::Profile *profile);
|
||||
static Utils::FileName maddeRoot(const ProjectExplorer::Kit *k);
|
||||
static QString targetRoot(const QString &qmakePath);
|
||||
static QString targetName(const QString &qmakePath);
|
||||
static QString madCommand(const QString &qmakePath);
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <remotelinux/deploymentinfo.h>
|
||||
#include <remotelinux/remotelinuxdeployconfiguration.h>
|
||||
|
||||
@@ -157,7 +157,7 @@ bool AbstractMaemoInstallPackageToSysrootStep::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||
if (!version) {
|
||||
addOutput(tr("Cannot install package to sysroot without a Qt version."),
|
||||
ErrorMessageOutput);
|
||||
@@ -235,7 +235,7 @@ QStringList MaemoInstallDebianPackageToSysrootStep::madArguments() const
|
||||
{
|
||||
QStringList args;
|
||||
args << QLatin1String("xdpkg");
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||
if (deviceType == HarmattanOsType)
|
||||
args << QLatin1String("--no-force-downgrade");
|
||||
args << QLatin1String("-i");
|
||||
@@ -274,13 +274,13 @@ bool MaemoCopyToSysrootStep::init()
|
||||
}
|
||||
|
||||
const MaemoQtVersion *const qtVersion
|
||||
= dynamic_cast<MaemoQtVersion *>(QtSupport::QtProfileInformation::qtVersion(target()->profile()));
|
||||
= dynamic_cast<MaemoQtVersion *>(QtSupport::QtKitInformation::qtVersion(target()->kit()));
|
||||
if (!qtVersion) {
|
||||
addOutput(tr("Cannot copy to sysroot without valid Qt version."),
|
||||
ErrorMessageOutput);
|
||||
return false;
|
||||
}
|
||||
m_systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(target()->profile()).toString();
|
||||
m_systemRoot = ProjectExplorer::SysRootKitInformation::sysRoot(target()->kit()).toString();
|
||||
|
||||
const DeploymentInfo * const deploymentInfo
|
||||
= static_cast<RemoteLinuxDeployConfiguration *>(deployConfiguration())->deploymentInfo();
|
||||
@@ -352,7 +352,7 @@ bool MaemoMakeInstallToSysrootStep::init()
|
||||
return false;
|
||||
}
|
||||
const QtSupport::BaseQtVersion *const qtVersion
|
||||
= QtSupport::QtProfileInformation::qtVersion(target()->profile());
|
||||
= QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||
if (!qtVersion) {
|
||||
addOutput("Cannot deploy: Unusable build configuration.",
|
||||
ErrorMessageOutput);
|
||||
@@ -363,8 +363,8 @@ bool MaemoMakeInstallToSysrootStep::init()
|
||||
MaemoGlobal::addMaddeEnvironment(env, qtVersion->qmakeCommand().toString());
|
||||
QString command = MaemoGlobal::madCommand(qtVersion->qmakeCommand().toString());
|
||||
QString systemRoot;
|
||||
if (ProjectExplorer::SysRootProfileInformation::hasSysRoot(target()->profile()))
|
||||
systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(target()->profile()).toString();
|
||||
if (ProjectExplorer::SysRootKitInformation::hasSysRoot(target()->kit()))
|
||||
systemRoot = ProjectExplorer::SysRootKitInformation::sysRoot(target()->kit()).toString();
|
||||
QStringList args = QStringList() << QLatin1String("-t")
|
||||
<< MaemoGlobal::targetName(qtVersion->qmakeCommand().toString()) << QLatin1String("make")
|
||||
<< QLatin1String("install") << (QLatin1String("INSTALL_ROOT=") + systemRoot);
|
||||
|
@@ -36,7 +36,7 @@
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/deployconfiguration.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -96,7 +96,7 @@ bool AbstractMaemoPackageCreationStep::init()
|
||||
QLatin1String("nostrip"), QLatin1String(" "));
|
||||
}
|
||||
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||
if (!version) {
|
||||
raiseError(tr("Packaging failed: No Qt version."));
|
||||
return false;
|
||||
@@ -236,7 +236,7 @@ void AbstractMaemoPackageCreationStep::preparePackagingProcess(QProcess *proc,
|
||||
|
||||
QString AbstractMaemoPackageCreationStep::replaceDots(const QString &name) const
|
||||
{
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||
// Idiotic OVI store requirement for N900 (but not allowed for N9 ...).
|
||||
if (deviceType == Maemo5OsType) {
|
||||
QString adaptedName = name;
|
||||
@@ -274,7 +274,7 @@ bool MaemoDebianPackageCreationStep::init()
|
||||
{
|
||||
if (!AbstractMaemoPackageCreationStep::init())
|
||||
return false;
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||
m_maddeRoot = MaemoGlobal::maddeRoot(version->qmakeCommand().toString());
|
||||
m_projectDirectory = project()->projectDirectory();
|
||||
m_pkgFileName = DebianManager::packageFileName(DebianManager::debianDirectory(target())).toString();
|
||||
|
@@ -36,7 +36,7 @@
|
||||
#include "maemopackagecreationstep.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
@@ -71,7 +71,7 @@ void MaemoPackageCreationWidget::initGui()
|
||||
{
|
||||
m_ui->shortDescriptionLineEdit->setMaxLength(60);
|
||||
updateVersionInfo();
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(m_step->target()->profile());
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(m_step->target()->kit());
|
||||
const Utils::FileName path = DebianManager::debianDirectory(m_step->target());
|
||||
const QSize iconSize = MaddeDevice::packageManagerIconSize(deviceType);
|
||||
m_ui->packageManagerIconButton->setFixedSize(iconSize);
|
||||
@@ -170,7 +170,7 @@ void MaemoPackageCreationWidget::updatePackageManagerName()
|
||||
{
|
||||
const Utils::FileName path = DebianManager::debianDirectory(m_step->target());
|
||||
Core::Id deviceType
|
||||
= ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(m_step->target()->profile());
|
||||
= ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(m_step->target()->kit());
|
||||
m_ui->packageManagerNameLineEdit->setText(DebianManager::packageManagerName(path, deviceType));
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ void MaemoPackageCreationWidget::setPackageManagerIcon()
|
||||
{
|
||||
const Utils::FileName path = DebianManager::debianDirectory(m_step->target());
|
||||
Core::Id deviceType
|
||||
= ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(m_step->target()->profile());
|
||||
= ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(m_step->target()->kit());
|
||||
QString imageFilter = tr("Images") + QLatin1String("( ");
|
||||
const QList<QByteArray> &imageTypes = QImageReader::supportedImageFormats();
|
||||
foreach (const QByteArray &imageType, imageTypes)
|
||||
@@ -215,7 +215,7 @@ void MaemoPackageCreationWidget::setPackageManagerName()
|
||||
{
|
||||
const Utils::FileName path = DebianManager::debianDirectory(m_step->target());
|
||||
Core::Id deviceType
|
||||
= ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(m_step->target()->profile());
|
||||
= ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(m_step->target()->kit());
|
||||
if (!DebianManager::setPackageManagerName(path, deviceType, m_ui->packageManagerNameLineEdit->text())) {
|
||||
QMessageBox::critical(this, tr("File Error"),
|
||||
tr("Could not set package name for project manager."));
|
||||
|
@@ -42,7 +42,7 @@
|
||||
#include <qt4projectmanager/qmakestep.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <remotelinux/deployablefilesperprofile.h>
|
||||
#include <remotelinux/deploymentinfo.h>
|
||||
#include <utils/fileutils.h>
|
||||
@@ -311,10 +311,10 @@ void MaemoPublisherFremantleFree::handleProcessFinished(bool failedToStart)
|
||||
setState(RunningMakeDistclean);
|
||||
// Toolchain might be null! (yes because this sucks)
|
||||
ProjectExplorer::ToolChain *tc
|
||||
= ProjectExplorer::ToolChainProfileInformation::toolChain(m_buildConfig->target()->profile());
|
||||
= ProjectExplorer::ToolChainKitInformation::toolChain(m_buildConfig->target()->kit());
|
||||
if (!tc) {
|
||||
finishWithFailure(QString(), tr("Make distclean failed: %1")
|
||||
.arg(ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget()));
|
||||
.arg(ProjectExplorer::ToolChainKitInformation::msgNoToolChainInTarget()));
|
||||
}
|
||||
m_process->start(tc->makeCommand(), QStringList() << QLatin1String("distclean"));
|
||||
}
|
||||
@@ -380,7 +380,7 @@ void MaemoPublisherFremantleFree::runDpkgBuildPackage()
|
||||
}
|
||||
}
|
||||
|
||||
QtSupport::BaseQtVersion *lqt = QtSupport::QtProfileInformation::qtVersion(m_buildConfig->target()->profile());
|
||||
QtSupport::BaseQtVersion *lqt = QtSupport::QtKitInformation::qtVersion(m_buildConfig->target()->kit());
|
||||
if (!lqt)
|
||||
finishWithFailure(QString(), tr("No Qt version set."));
|
||||
|
||||
@@ -606,7 +606,7 @@ QStringList MaemoPublisherFremantleFree::findProblems() const
|
||||
QStringList problems;
|
||||
ProjectExplorer::Target *target = m_buildConfig->target();
|
||||
Core::Id deviceType
|
||||
= ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target->profile());
|
||||
= ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target->kit());
|
||||
if (deviceType != Maemo5OsType)
|
||||
return QStringList();
|
||||
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -79,7 +79,7 @@ void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(c
|
||||
m_buildConfigs.clear();
|
||||
|
||||
foreach (const Target *const target, project->targets()) {
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
|
||||
if (!version || version->platformName() != QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM))
|
||||
continue;
|
||||
foreach (BuildConfiguration *const bc, target->buildConfigurations()) {
|
||||
|
@@ -37,7 +37,7 @@
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
@@ -71,7 +71,7 @@ bool MaemoPublishingWizardFactoryFremantleFree::canCreateWizard(const Project *p
|
||||
if (!qobject_cast<const Qt4Project *>(project))
|
||||
return false;
|
||||
foreach (const Target *const target, project->targets()) {
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
|
||||
const QString &platform = version ? version->platformName() : QString();
|
||||
if (platform == QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM))
|
||||
return true;
|
||||
|
@@ -48,7 +48,7 @@
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <remotelinux/remotelinuxrunconfiguration.h>
|
||||
#include <utils/filesystemwatcher.h>
|
||||
@@ -246,23 +246,23 @@ void MaemoQemuManager::projectChanged(ProjectExplorer::Project *project)
|
||||
|
||||
void MaemoQemuManager::targetAdded(ProjectExplorer::Target *target)
|
||||
{
|
||||
if (!target || !MaemoGlobal::hasMaemoDevice(target->profile()))
|
||||
if (!target || !MaemoGlobal::hasMaemoDevice(target->kit()))
|
||||
return;
|
||||
|
||||
// handle the Qt version changes the build configuration uses
|
||||
connect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
|
||||
connect(target, SIGNAL(profileChanged()), this, SLOT(systemChanged()));
|
||||
connect(target, SIGNAL(kitChanged()), this, SLOT(systemChanged()));
|
||||
|
||||
toggleStarterButton(target);
|
||||
}
|
||||
|
||||
void MaemoQemuManager::targetRemoved(ProjectExplorer::Target *target)
|
||||
{
|
||||
if (!target || !MaemoGlobal::hasMaemoDevice(target->profile()))
|
||||
if (!target || !MaemoGlobal::hasMaemoDevice(target->kit()))
|
||||
return;
|
||||
|
||||
disconnect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
|
||||
disconnect(target, SIGNAL(profileChanged()), this, SLOT(systemChanged()));
|
||||
disconnect(target, SIGNAL(kitChanged()), this, SLOT(systemChanged()));
|
||||
|
||||
showOrHideQemuButton();
|
||||
}
|
||||
@@ -459,7 +459,7 @@ void MaemoQemuManager::toggleStarterButton(Target *target)
|
||||
{
|
||||
int uniqueId = -1;
|
||||
if (target) {
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
|
||||
if (version)
|
||||
uniqueId = version->uniqueId();
|
||||
}
|
||||
@@ -474,7 +474,7 @@ void MaemoQemuManager::toggleStarterButton(Target *target)
|
||||
const Project * const p
|
||||
= ProjectExplorerPlugin::instance()->session()->startupProject();
|
||||
const bool qemuButtonEnabled
|
||||
= p && p->activeTarget() && MaemoGlobal::hasMaemoDevice(target->profile())
|
||||
= p && p->activeTarget() && MaemoGlobal::hasMaemoDevice(target->kit())
|
||||
&& m_runtimes.value(uniqueId, MaemoQemuRuntime()).isValid()
|
||||
&& targetUsesMatchingRuntimeConfig(target) && !isRunning;
|
||||
m_qemuAction->setEnabled(qemuButtonEnabled);
|
||||
@@ -487,7 +487,7 @@ bool MaemoQemuManager::sessionHasMaemoTarget() const
|
||||
const QList<Project*> &projects = explorer->session()->projects();
|
||||
foreach (const Project *p, projects) {
|
||||
foreach (const Target * const target, p->targets()) {
|
||||
if (MaemoGlobal::hasMaemoDevice(target->profile()))
|
||||
if (MaemoGlobal::hasMaemoDevice(target->kit()))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -507,13 +507,13 @@ bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target,
|
||||
if (!mrc)
|
||||
return false;
|
||||
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target->profile());
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
|
||||
if (!version || !m_runtimes.value(version->uniqueId(), MaemoQemuRuntime()).isValid())
|
||||
return false;
|
||||
|
||||
if (qtVersion)
|
||||
*qtVersion = version;
|
||||
const IDevice::ConstPtr config = DeviceProfileInformation::device(target->profile());
|
||||
const IDevice::ConstPtr config = DeviceKitInformation::device(target->kit());
|
||||
return !config.isNull() && config->machineType() == IDevice::Emulator;
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#include "maemoconstants.h"
|
||||
#include "maemoglobal.h"
|
||||
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
@@ -163,13 +163,13 @@ QString MaemoQtVersion::platformDisplayName() const
|
||||
return QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM_TR);
|
||||
}
|
||||
|
||||
void MaemoQtVersion::addToEnvironment(const ProjectExplorer::Profile *p, Utils::Environment &env) const
|
||||
void MaemoQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
Q_UNUSED(k);
|
||||
const QString maddeRoot = MaemoGlobal::maddeRoot(qmakeCommand().toString());
|
||||
|
||||
// Needed to make pkg-config stuff work.
|
||||
Utils::FileName sysRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(p);
|
||||
Utils::FileName sysRoot = ProjectExplorer::SysRootKitInformation::sysRoot(k);
|
||||
env.prependOrSet(QLatin1String("SYSROOT_DIR"), sysRoot.toUserOutput());
|
||||
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madbin")
|
||||
.arg(maddeRoot)));
|
||||
|
@@ -49,7 +49,7 @@ public:
|
||||
bool isValid() const;
|
||||
|
||||
QList<ProjectExplorer::Abi> detectQtAbis() const;
|
||||
void addToEnvironment(const ProjectExplorer::Profile *p, Utils::Environment &env) const;
|
||||
void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const;
|
||||
|
||||
QString description() const;
|
||||
|
||||
|
@@ -36,7 +36,7 @@
|
||||
|
||||
#include <debugger/debuggerconstants.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
@@ -77,7 +77,7 @@ void MaemoRunConfiguration::init()
|
||||
SLOT(handleRemoteMountsChanged()));
|
||||
connect(m_remoteMounts, SIGNAL(modelReset()), SLOT(handleRemoteMountsChanged()));
|
||||
|
||||
if (DeviceTypeProfileInformation::deviceTypeId(target()->profile()) != HarmattanOsType)
|
||||
if (DeviceTypeKitInformation::deviceTypeId(target()->kit()) != HarmattanOsType)
|
||||
debuggerAspect()->suppressQmlDebuggingOptions();
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ QString MaemoRunConfiguration::environmentPreparationCommand() const
|
||||
|
||||
QString MaemoRunConfiguration::commandPrefix() const
|
||||
{
|
||||
IDevice::ConstPtr dev = DeviceProfileInformation::device(target()->profile());
|
||||
IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit());
|
||||
if (!dev)
|
||||
return QString();
|
||||
|
||||
@@ -130,13 +130,13 @@ QString MaemoRunConfiguration::commandPrefix() const
|
||||
|
||||
Utils::PortList MaemoRunConfiguration::freePorts() const
|
||||
{
|
||||
return MaemoGlobal::freePorts(target()->profile());
|
||||
return MaemoGlobal::freePorts(target()->kit());
|
||||
}
|
||||
|
||||
bool MaemoRunConfiguration::hasEnoughFreePorts(RunMode mode) const
|
||||
{
|
||||
const int freePortCount = freePorts().count();
|
||||
Core::Id typeId = DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
||||
Core::Id typeId = DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||
const bool remoteMountsAllowed = MaddeDevice::allowsRemoteMounts(typeId);
|
||||
const int mountDirCount = remoteMountsAllowed
|
||||
? remoteMounts()->validMountSpecificationCount() : 0;
|
||||
|
@@ -37,7 +37,7 @@
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <projectexplorer/environmentwidget.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <remotelinux/remotelinuxrunconfigurationwidget.h>
|
||||
@@ -82,12 +82,12 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
||||
QVBoxLayout *subLayout = new QVBoxLayout(m_subWidget);
|
||||
subLayout->setMargin(0);
|
||||
addMountWidgets(subLayout);
|
||||
connect(m_runConfiguration->target(), SIGNAL(profileChanged()), this, SLOT(updateMountWarning()));
|
||||
connect(m_runConfiguration->target(), SIGNAL(kitChanged()), this, SLOT(updateMountWarning()));
|
||||
connect(m_runConfiguration->debuggerAspect(), SIGNAL(debuggersChanged()),
|
||||
SLOT(updateMountWarning()));
|
||||
updateMountWarning();
|
||||
|
||||
Core::Id devId = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(runConfiguration->target()->profile());
|
||||
Core::Id devId = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(runConfiguration->target()->kit());
|
||||
m_mountDetailsContainer->setVisible(MaddeDevice::allowsRemoteMounts(devId));
|
||||
|
||||
connect(m_runConfiguration, SIGNAL(enabledChanged()),
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include <debugger/debuggerplugin.h>
|
||||
#include <debugger/debuggerrunner.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/profileinformation.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qt4projectmanager/qt4nodes.h>
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
@@ -69,9 +69,9 @@ QString pathFromId(Core::Id id)
|
||||
template<class Receiver> void setHelperActions(Receiver *receiver, MaemoRunConfiguration *runConfig,
|
||||
RunControl *runControl)
|
||||
{
|
||||
const Profile * const profile = runConfig->target()->profile();
|
||||
const Kit * const k = runConfig->target()->kit();
|
||||
MaemoPreRunAction * const preRunAction = new MaemoPreRunAction(
|
||||
DeviceProfileInformation::device(profile), MaemoGlobal::maddeRoot(profile),
|
||||
DeviceKitInformation::device(k), MaemoGlobal::maddeRoot(k),
|
||||
runConfig->remoteMounts()->mountSpecs(), runControl);
|
||||
MaemoPostRunAction * const postRunAction
|
||||
= new MaemoPostRunAction(preRunAction->mounter(), runControl);
|
||||
@@ -165,11 +165,11 @@ RunConfiguration *MaemoRunConfigurationFactory::clone(Target *parent, RunConfigu
|
||||
|
||||
bool MaemoRunConfigurationFactory::canHandle(Target *t) const
|
||||
{
|
||||
if (!t->project()->supportsProfile(t->profile()))
|
||||
if (!t->project()->supportsKit(t->kit()))
|
||||
return false;
|
||||
if (!qobject_cast<Qt4Project *>(t->project()))
|
||||
return false;
|
||||
Core::Id devType = DeviceTypeProfileInformation::deviceTypeId(t->profile());
|
||||
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(t->kit());
|
||||
return devType == Maemo5OsType || devType == HarmattanOsType;
|
||||
}
|
||||
|
||||
|
@@ -45,7 +45,7 @@
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qtsupport/qtprofileinformation.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
#include <remotelinux/deployablefile.h>
|
||||
#include <remotelinux/deployablefilesperprofile.h>
|
||||
@@ -121,7 +121,7 @@ DeploymentSettingsAssistant *Qt4MaemoDeployConfiguration::deploymentSettingsAssi
|
||||
|
||||
QString Qt4MaemoDeployConfiguration::qmakeScope() const
|
||||
{
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||
|
||||
if (deviceType == Maemo5OsType)
|
||||
return QLatin1String("maemo5");
|
||||
@@ -132,7 +132,7 @@ QString Qt4MaemoDeployConfiguration::qmakeScope() const
|
||||
|
||||
QString Qt4MaemoDeployConfiguration::installPrefix() const
|
||||
{
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||
|
||||
if (deviceType == Maemo5OsType)
|
||||
return QLatin1String("/opt");
|
||||
@@ -159,7 +159,7 @@ void Qt4MaemoDeployConfiguration::setupPackaging()
|
||||
void Qt4MaemoDeployConfiguration::setupDebianPackaging()
|
||||
{
|
||||
Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration());
|
||||
if (!bc || !target()->profile())
|
||||
if (!bc || !target()->kit())
|
||||
return;
|
||||
|
||||
Utils::FileName debianDir = DebianManager::debianDirectory(target());
|
||||
@@ -176,7 +176,7 @@ void Qt4MaemoDeployConfiguration::setupDebianPackaging()
|
||||
if (status == DebianManager::NoActionRequired)
|
||||
return;
|
||||
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||
QString projectName = target()->project()->displayName();
|
||||
|
||||
if (!DebianManager::hasPackageManagerIcon(debianDir)) {
|
||||
@@ -269,7 +269,7 @@ QList<Core::Id> Qt4MaemoDeployConfigurationFactory::availableCreationIds(Target
|
||||
if (!canHandle(parent))
|
||||
return ids;
|
||||
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->profile());
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit());
|
||||
if (deviceType == Maemo5OsType)
|
||||
ids << Qt4MaemoDeployConfiguration::fremantleWithPackagingId()
|
||||
<< Qt4MaemoDeployConfiguration::fremantleWithoutPackagingId();
|
||||
@@ -330,7 +330,7 @@ bool Qt4MaemoDeployConfigurationFactory::canRestore(Target *parent, const QVaria
|
||||
Core::Id id = idFromMap(map);
|
||||
return canHandle(parent)
|
||||
&& (availableCreationIds(parent).contains(id) || id == OldDeployConfigId)
|
||||
&& MaemoGlobal::supportsMaemoDevice(parent->profile());
|
||||
&& MaemoGlobal::supportsMaemoDevice(parent->kit());
|
||||
}
|
||||
|
||||
DeployConfiguration *Qt4MaemoDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map)
|
||||
@@ -338,7 +338,7 @@ DeployConfiguration *Qt4MaemoDeployConfigurationFactory::restore(Target *parent,
|
||||
if (!canRestore(parent, map))
|
||||
return 0;
|
||||
Core::Id id = idFromMap(map);
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->profile());
|
||||
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit());
|
||||
if (id == OldDeployConfigId) {
|
||||
if (deviceType == Maemo5OsType)
|
||||
id = Qt4MaemoDeployConfiguration::fremantleWithPackagingId();
|
||||
@@ -367,9 +367,9 @@ bool Qt4MaemoDeployConfigurationFactory::canHandle(Target *parent) const
|
||||
{
|
||||
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
|
||||
return false;
|
||||
if (!parent->project()->supportsProfile(parent->profile()))
|
||||
if (!parent->project()->supportsKit(parent->kit()))
|
||||
return false;
|
||||
return MaemoGlobal::supportsMaemoDevice(parent->profile());
|
||||
return MaemoGlobal::supportsMaemoDevice(parent->kit());
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include "buildsteplist.h"
|
||||
#include "projectexplorer.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "profilemanager.h"
|
||||
#include "kitmanager.h"
|
||||
#include "target.h"
|
||||
#include "project.h"
|
||||
|
||||
@@ -92,8 +92,8 @@ BuildConfiguration::BuildConfiguration(Target *target, const Core::Id id) :
|
||||
bsl->setDefaultDisplayName(tr("Clean"));
|
||||
m_stepLists.append(bsl);
|
||||
|
||||
connect(ProfileManager::instance(), SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
||||
this, SLOT(handleProfileUpdate(ProjectExplorer::Profile*)));
|
||||
connect(KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||
this, SLOT(handleKitUpdate(ProjectExplorer::Kit*)));
|
||||
}
|
||||
|
||||
BuildConfiguration::BuildConfiguration(Target *target, BuildConfiguration *source) :
|
||||
@@ -107,8 +107,8 @@ BuildConfiguration::BuildConfiguration(Target *target, BuildConfiguration *sourc
|
||||
// otherwise BuildStepFactories might reject to set up a BuildStep for us
|
||||
// since we are not yet the derived class!
|
||||
|
||||
connect(ProfileManager::instance(), SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
||||
this, SLOT(handleProfileUpdate(ProjectExplorer::Profile*)));
|
||||
connect(KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||
this, SLOT(handleKitUpdate(ProjectExplorer::Kit*)));
|
||||
}
|
||||
|
||||
BuildConfiguration::~BuildConfiguration()
|
||||
@@ -187,9 +187,9 @@ bool BuildConfiguration::fromMap(const QVariantMap &map)
|
||||
return ProjectConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
void BuildConfiguration::handleProfileUpdate(ProjectExplorer::Profile *p)
|
||||
void BuildConfiguration::handleKitUpdate(ProjectExplorer::Kit *p)
|
||||
{
|
||||
if (p != target()->profile())
|
||||
if (p != target()->kit())
|
||||
return;
|
||||
emit environmentChanged();
|
||||
}
|
||||
|
@@ -47,7 +47,7 @@ namespace ProjectExplorer {
|
||||
class BuildConfiguration;
|
||||
class BuildConfigWidget;
|
||||
class BuildStepList;
|
||||
class Profile;
|
||||
class Kit;
|
||||
class Target;
|
||||
class IOutputParser;
|
||||
|
||||
@@ -112,7 +112,7 @@ protected:
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
private slots:
|
||||
void handleProfileUpdate(ProjectExplorer::Profile *p);
|
||||
void handleKitUpdate(ProjectExplorer::Kit *p);
|
||||
|
||||
private:
|
||||
bool m_clearSystemEnvironment;
|
||||
|
@@ -173,7 +173,7 @@ BuildSettingsWidget::BuildSettingsWidget(Target *target) :
|
||||
connect(m_target, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
||||
this, SLOT(updateActiveConfiguration()));
|
||||
|
||||
connect(m_target, SIGNAL(profileChanged()), this, SLOT(updateAddButtonMenu()));
|
||||
connect(m_target, SIGNAL(kitChanged()), this, SLOT(updateAddButtonMenu()));
|
||||
}
|
||||
|
||||
void BuildSettingsWidget::addSubWidget(BuildConfigWidget *widget)
|
||||
|
@@ -48,7 +48,7 @@ QString CodeStyleSettingsPanelFactory::id() const
|
||||
|
||||
QString CodeStyleSettingsPanelFactory::displayName() const
|
||||
{
|
||||
return QCoreApplication::translate("CodeStyleSettingsPanelFactory", "Code Style Settings");
|
||||
return QCoreApplication::translate("CodeStyleSettingsPanelFactory", "Code Style");
|
||||
}
|
||||
|
||||
int CodeStyleSettingsPanelFactory::priority() const
|
||||
@@ -67,7 +67,7 @@ PropertiesPanel *CodeStyleSettingsPanelFactory::createPanel(Project *project)
|
||||
PropertiesPanel *panel = new PropertiesPanel;
|
||||
panel->setWidget(new CodeStyleSettingsWidget(project));
|
||||
panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/CodeStyleSettings.png")));
|
||||
panel->setDisplayName(QCoreApplication::translate("CodeStyleSettingsPanel", "Code Style Settings"));
|
||||
panel->setDisplayName(QCoreApplication::translate("CodeStyleSettingsPanel", "Code Style"));
|
||||
return panel;
|
||||
}
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include "buildmanager.h"
|
||||
#include "buildsteplist.h"
|
||||
#include "buildstepspage.h"
|
||||
#include "profileinformation.h"
|
||||
#include "kitinformation.h"
|
||||
#include "project.h"
|
||||
#include "projectexplorer.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
@@ -242,9 +242,9 @@ DeployConfigurationFactory *DeployConfigurationFactory::find(Target *parent)
|
||||
|
||||
bool DeployConfigurationFactory::canHandle(Target *parent) const
|
||||
{
|
||||
if (!parent->project()->supportsProfile(parent->profile()))
|
||||
if (!parent->project()->supportsKit(parent->kit()))
|
||||
return false;
|
||||
return DeviceTypeProfileInformation::deviceTypeId(parent->profile()) == Constants::DESKTOP_DEVICE_TYPE;
|
||||
return DeviceTypeKitInformation::deviceTypeId(parent->kit()) == Constants::DESKTOP_DEVICE_TYPE;
|
||||
}
|
||||
|
||||
///
|
||||
|
@@ -29,8 +29,8 @@
|
||||
|
||||
#include "devicesupport/deviceprocessesdialog.h"
|
||||
#include "devicesupport/deviceprocesslist.h"
|
||||
#include "profilechooser.h"
|
||||
#include "profileinformation.h"
|
||||
#include "kitchooser.h"
|
||||
#include "kitinformation.h"
|
||||
|
||||
#include <utils/filterlineedit.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
QWidget *q;
|
||||
DeviceProcessList *processList;
|
||||
ProcessListFilterModel proxyModel;
|
||||
ProfileChooser *profileChooser;
|
||||
KitChooser *kitChooser;
|
||||
|
||||
QTreeView *procView;
|
||||
QTextBrowser *errorText;
|
||||
@@ -133,7 +133,7 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(QWidget *parent)
|
||||
processFilterLineEdit->setPlaceholderText(DeviceProcessesDialog::tr("Filter"));
|
||||
processFilterLineEdit->setFocus(Qt::TabFocusReason);
|
||||
|
||||
profileChooser = new ProfileChooser(q);
|
||||
kitChooser = new KitChooser(q);
|
||||
|
||||
procView = new QTreeView(q);
|
||||
procView->setModel(&proxyModel);
|
||||
@@ -157,7 +157,7 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(QWidget *parent)
|
||||
|
||||
QFormLayout *leftColumn = new QFormLayout();
|
||||
leftColumn->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||
leftColumn->addRow(DeviceProcessesDialog::tr("Target:"), profileChooser);
|
||||
leftColumn->addRow(DeviceProcessesDialog::tr("Kit:"), kitChooser);
|
||||
leftColumn->addRow(DeviceProcessesDialog::tr("&Filter:"), processFilterLineEdit);
|
||||
|
||||
// QVBoxLayout *rightColumn = new QVBoxLayout();
|
||||
@@ -185,7 +185,7 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(QWidget *parent)
|
||||
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||
SLOT(updateButtons()));
|
||||
connect(updateListButton, SIGNAL(clicked()), SLOT(updateProcessList()));
|
||||
connect(profileChooser, SIGNAL(currentIndexChanged(int)), SLOT(updateDevice()));
|
||||
connect(kitChooser, SIGNAL(currentIndexChanged(int)), SLOT(updateDevice()));
|
||||
connect(killProcessButton, SIGNAL(clicked()), SLOT(killProcess()));
|
||||
connect(&proxyModel, SIGNAL(layoutChanged()), SLOT(handleProcessListUpdated()));
|
||||
connect(buttonBox, SIGNAL(accepted()), q, SLOT(accept()));
|
||||
@@ -246,7 +246,7 @@ void DeviceProcessesDialogPrivate::killProcess()
|
||||
|
||||
void DeviceProcessesDialogPrivate::updateDevice()
|
||||
{
|
||||
setDevice(DeviceProfileInformation::device(profileChooser->currentProfile()));
|
||||
setDevice(DeviceKitInformation::device(kitChooser->currentKit()));
|
||||
}
|
||||
|
||||
void DeviceProcessesDialogPrivate::handleProcessKilled()
|
||||
@@ -323,13 +323,13 @@ void DeviceProcessesDialog::addCloseButton()
|
||||
|
||||
void DeviceProcessesDialog::setDevice(const IDevice::ConstPtr &device)
|
||||
{
|
||||
d->profileChooser->hide();
|
||||
d->kitChooser->hide();
|
||||
d->setDevice(device);
|
||||
}
|
||||
|
||||
void DeviceProcessesDialog::showAllDevices()
|
||||
{
|
||||
d->profileChooser->show();
|
||||
d->kitChooser->show();
|
||||
d->updateDevice();
|
||||
}
|
||||
|
||||
@@ -338,9 +338,9 @@ DeviceProcess DeviceProcessesDialog::currentProcess() const
|
||||
return d->selectedProcess();
|
||||
}
|
||||
|
||||
ProfileChooser *DeviceProcessesDialog::profileChooser() const
|
||||
KitChooser *DeviceProcessesDialog::kitChooser() const
|
||||
{
|
||||
return d->profileChooser;
|
||||
return d->kitChooser;
|
||||
}
|
||||
|
||||
void DeviceProcessesDialog::logMessage(const QString &line)
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "../projectexplorer_export.h"
|
||||
|
||||
#include <projectexplorer/profile.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/devicesupport/idevice.h>
|
||||
#include <projectexplorer/devicesupport/deviceprocesslist.h>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class ProfileChooser;
|
||||
class KitChooser;
|
||||
|
||||
namespace Internal { class DeviceProcessesDialogPrivate; }
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
void setDevice(const IDevice::ConstPtr &device);
|
||||
void showAllDevices();
|
||||
DeviceProcess currentProcess() const;
|
||||
ProfileChooser *profileChooser() const;
|
||||
KitChooser *kitChooser() const;
|
||||
void logMessage(const QString &line);
|
||||
|
||||
private:
|
||||
|
@@ -44,7 +44,7 @@ QString EditorSettingsPanelFactory::id() const
|
||||
|
||||
QString EditorSettingsPanelFactory::displayName() const
|
||||
{
|
||||
return QCoreApplication::translate("EditorSettingsPanelFactory", "Editor Settings");
|
||||
return QCoreApplication::translate("EditorSettingsPanelFactory", "Editor");
|
||||
}
|
||||
|
||||
int EditorSettingsPanelFactory::priority() const
|
||||
@@ -61,7 +61,7 @@ bool EditorSettingsPanelFactory::supports(Project *project)
|
||||
PropertiesPanel *EditorSettingsPanelFactory::createPanel(Project *project)
|
||||
{
|
||||
PropertiesPanel *panel = new PropertiesPanel;
|
||||
panel->setDisplayName(QCoreApplication::translate("EditorSettingsPanel", "Editor Settings"));
|
||||
panel->setDisplayName(QCoreApplication::translate("EditorSettingsPanel", "Editor"));
|
||||
panel->setWidget(new EditorSettingsWidget(project)),
|
||||
panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/EditorSettings.png")));
|
||||
return panel;
|
||||
|
@@ -28,11 +28,11 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "profile.h"
|
||||
#include "kit.h"
|
||||
|
||||
#include "devicesupport/devicemanager.h"
|
||||
#include "profileinformation.h"
|
||||
#include "profilemanager.h"
|
||||
#include "kitinformation.h"
|
||||
#include "kitmanager.h"
|
||||
#include "project.h"
|
||||
#include "toolchainmanager.h"
|
||||
|
||||
@@ -55,15 +55,15 @@ const char ICON_KEY[] = "PE.Profile.Icon";
|
||||
namespace ProjectExplorer {
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// ProfilePrivate
|
||||
// KitPrivate
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class ProfilePrivate
|
||||
class KitPrivate
|
||||
{
|
||||
public:
|
||||
ProfilePrivate() :
|
||||
KitPrivate() :
|
||||
m_id(QUuid::createUuid().toString().toLatin1().constData()),
|
||||
m_autodetected(false),
|
||||
m_isValid(true)
|
||||
@@ -82,32 +82,32 @@ public:
|
||||
} // namespace Internal
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Profile:
|
||||
// Kit:
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
Profile::Profile() :
|
||||
d(new Internal::ProfilePrivate)
|
||||
Kit::Kit() :
|
||||
d(new Internal::KitPrivate)
|
||||
{
|
||||
ProfileManager *stm = ProfileManager::instance();
|
||||
foreach (ProfileInformation *sti, stm->profileInformation())
|
||||
KitManager *stm = KitManager::instance();
|
||||
foreach (KitInformation *sti, stm->kitInformation())
|
||||
d->m_data.insert(sti->dataId(), sti->defaultValue(this));
|
||||
|
||||
setDisplayName(QCoreApplication::translate("ProjectExplorer::Profile", "Unnamed"));
|
||||
setDisplayName(QCoreApplication::translate("ProjectExplorer::Kit", "Unnamed"));
|
||||
setIconPath(QLatin1String(":///DESKTOP///"));
|
||||
}
|
||||
|
||||
Profile::~Profile()
|
||||
Kit::~Kit()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
Profile *Profile::clone(bool keepName) const
|
||||
Kit *Kit::clone(bool keepName) const
|
||||
{
|
||||
Profile *p = new Profile;
|
||||
Kit *p = new Kit;
|
||||
if (keepName)
|
||||
p->d->m_displayName = d->m_displayName;
|
||||
else
|
||||
p->d->m_displayName = QCoreApplication::translate("ProjectExplorer::Profile", "Clone of %1")
|
||||
p->d->m_displayName = QCoreApplication::translate("ProjectExplorer::Kit", "Clone of %1")
|
||||
.arg(d->m_displayName);
|
||||
p->d->m_autodetected = false;
|
||||
p->d->m_data = d->m_data;
|
||||
@@ -117,21 +117,21 @@ Profile *Profile::clone(bool keepName) const
|
||||
return p;
|
||||
}
|
||||
|
||||
bool Profile::isValid() const
|
||||
bool Kit::isValid() const
|
||||
{
|
||||
return d->m_id.isValid() && d->m_isValid;
|
||||
}
|
||||
|
||||
QList<Task> Profile::validate()
|
||||
QList<Task> Kit::validate()
|
||||
{
|
||||
QList<Task> result;
|
||||
QList<ProfileInformation *> infoList = ProfileManager::instance()->profileInformation();
|
||||
foreach (ProfileInformation *i, infoList)
|
||||
QList<KitInformation *> infoList = KitManager::instance()->kitInformation();
|
||||
foreach (KitInformation *i, infoList)
|
||||
result.append(i->validate(this));
|
||||
return result;
|
||||
}
|
||||
|
||||
QString Profile::displayName() const
|
||||
QString Kit::displayName() const
|
||||
{
|
||||
return d->m_displayName;
|
||||
}
|
||||
@@ -143,16 +143,16 @@ static QString candidateName(const QString &name, const QString &postfix)
|
||||
return name + QLatin1Char('-') + postfix;
|
||||
}
|
||||
|
||||
void Profile::setDisplayName(const QString &name)
|
||||
void Kit::setDisplayName(const QString &name)
|
||||
{
|
||||
ProfileManager *pm = ProfileManager::instance();
|
||||
QList<ProfileInformation *> profileInfo = pm->profileInformation();
|
||||
KitManager *pm = KitManager::instance();
|
||||
QList<KitInformation *> kitInfo = pm->kitInformation();
|
||||
|
||||
QStringList nameList;
|
||||
foreach (Profile *p, pm->profiles()) {
|
||||
foreach (Kit *p, pm->kits()) {
|
||||
nameList << p->displayName();
|
||||
foreach (ProfileInformation *pi, profileInfo) {
|
||||
const QString postfix = pi->displayNamePostfix(p);
|
||||
foreach (KitInformation *ki, kitInfo) {
|
||||
const QString postfix = ki->displayNamePostfix(p);
|
||||
if (!postfix.isEmpty())
|
||||
nameList << candidateName(p->displayName(), postfix);
|
||||
}
|
||||
@@ -161,8 +161,8 @@ void Profile::setDisplayName(const QString &name)
|
||||
QStringList candidateNames;
|
||||
candidateNames << name;
|
||||
|
||||
foreach (ProfileInformation *pi, profileInfo) {
|
||||
const QString postfix = pi->displayNamePostfix(this);
|
||||
foreach (KitInformation *ki, kitInfo) {
|
||||
const QString postfix = ki->displayNamePostfix(this);
|
||||
if (!postfix.isEmpty())
|
||||
candidateNames << candidateName(name, postfix);
|
||||
}
|
||||
@@ -181,30 +181,30 @@ void Profile::setDisplayName(const QString &name)
|
||||
if (d->m_displayName == uniqueName)
|
||||
return;
|
||||
d->m_displayName = uniqueName;
|
||||
profileUpdated();
|
||||
kitUpdated();
|
||||
}
|
||||
|
||||
bool Profile::isAutoDetected() const
|
||||
bool Kit::isAutoDetected() const
|
||||
{
|
||||
return d->m_autodetected;
|
||||
}
|
||||
|
||||
Core::Id Profile::id() const
|
||||
Core::Id Kit::id() const
|
||||
{
|
||||
return d->m_id;
|
||||
}
|
||||
|
||||
QIcon Profile::icon() const
|
||||
QIcon Kit::icon() const
|
||||
{
|
||||
return d->m_icon;
|
||||
}
|
||||
|
||||
QString Profile::iconPath() const
|
||||
QString Kit::iconPath() const
|
||||
{
|
||||
return d->m_iconPath;
|
||||
}
|
||||
|
||||
void Profile::setIconPath(const QString &path)
|
||||
void Kit::setIconPath(const QString &path)
|
||||
{
|
||||
if (d->m_iconPath == path)
|
||||
return;
|
||||
@@ -215,36 +215,36 @@ void Profile::setIconPath(const QString &path)
|
||||
d->m_icon = qApp->style()->standardIcon(QStyle::SP_ComputerIcon);
|
||||
else
|
||||
d->m_icon = QIcon(path);
|
||||
profileUpdated();
|
||||
kitUpdated();
|
||||
}
|
||||
|
||||
QVariant Profile::value(const Core::Id &key, const QVariant &unset) const
|
||||
QVariant Kit::value(const Core::Id &key, const QVariant &unset) const
|
||||
{
|
||||
return d->m_data.value(key, unset);
|
||||
}
|
||||
|
||||
bool Profile::hasValue(const Core::Id &key) const
|
||||
bool Kit::hasValue(const Core::Id &key) const
|
||||
{
|
||||
return d->m_data.contains(key);
|
||||
}
|
||||
|
||||
void Profile::setValue(const Core::Id &key, const QVariant &value)
|
||||
void Kit::setValue(const Core::Id &key, const QVariant &value)
|
||||
{
|
||||
if (d->m_data.value(key) == value)
|
||||
return;
|
||||
d->m_data.insert(key, value);
|
||||
profileUpdated();
|
||||
kitUpdated();
|
||||
}
|
||||
|
||||
void Profile::removeKey(const Core::Id &key)
|
||||
void Kit::removeKey(const Core::Id &key)
|
||||
{
|
||||
if (!d->m_data.contains(key))
|
||||
return;
|
||||
d->m_data.remove(key);
|
||||
profileUpdated();
|
||||
kitUpdated();
|
||||
}
|
||||
|
||||
QVariantMap Profile::toMap() const
|
||||
QVariantMap Kit::toMap() const
|
||||
{
|
||||
QVariantMap data;
|
||||
data.insert(QLatin1String(ID_KEY), QString::fromLatin1(d->m_id.name()));
|
||||
@@ -260,19 +260,19 @@ QVariantMap Profile::toMap() const
|
||||
return data;
|
||||
}
|
||||
|
||||
bool Profile::operator==(const Profile &other) const
|
||||
bool Kit::operator==(const Kit &other) const
|
||||
{
|
||||
return d->m_data == other.d->m_data;
|
||||
}
|
||||
|
||||
void Profile::addToEnvironment(Utils::Environment &env) const
|
||||
void Kit::addToEnvironment(Utils::Environment &env) const
|
||||
{
|
||||
QList<ProfileInformation *> infoList = ProfileManager::instance()->profileInformation();
|
||||
foreach (ProfileInformation *si, infoList)
|
||||
si->addToEnvironment(this, env);
|
||||
QList<KitInformation *> infoList = KitManager::instance()->kitInformation();
|
||||
foreach (KitInformation *ki, infoList)
|
||||
ki->addToEnvironment(this, env);
|
||||
}
|
||||
|
||||
QString Profile::toHtml()
|
||||
QString Kit::toHtml()
|
||||
{
|
||||
QString rc;
|
||||
QTextStream str(&rc);
|
||||
@@ -287,10 +287,10 @@ QString Profile::toHtml()
|
||||
str << "<b>";
|
||||
switch (t.type) {
|
||||
case Task::Error:
|
||||
QCoreApplication::translate("ProjectExplorer::Profile", "Error:");
|
||||
QCoreApplication::translate("ProjectExplorer::Kit", "Error:");
|
||||
break;
|
||||
case Task::Warning:
|
||||
QCoreApplication::translate("ProjectExplorer::Profile", "Warning:");
|
||||
QCoreApplication::translate("ProjectExplorer::Kit", "Warning:");
|
||||
break;
|
||||
case Task::Unknown:
|
||||
default:
|
||||
@@ -301,17 +301,17 @@ QString Profile::toHtml()
|
||||
str << "</p>";
|
||||
}
|
||||
|
||||
QList<ProfileInformation *> infoList = ProfileManager::instance()->profileInformation();
|
||||
foreach (ProfileInformation *i, infoList) {
|
||||
ProfileInformation::ItemList list = i->toUserOutput(this);
|
||||
foreach (const ProfileInformation::Item &j, list)
|
||||
QList<KitInformation *> infoList = KitManager::instance()->kitInformation();
|
||||
foreach (KitInformation *ki, infoList) {
|
||||
KitInformation::ItemList list = ki->toUserOutput(this);
|
||||
foreach (const KitInformation::Item &j, list)
|
||||
str << "<tr><td><b>" << j.first << ":</b></td><td>" << j.second << "</td></tr>";
|
||||
}
|
||||
str << "</table></body></html>";
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool Profile::fromMap(const QVariantMap &data)
|
||||
bool Kit::fromMap(const QVariantMap &data)
|
||||
{
|
||||
const QString id = data.value(QLatin1String(ID_KEY)).toString();
|
||||
if (id.isEmpty())
|
||||
@@ -328,19 +328,19 @@ bool Profile::fromMap(const QVariantMap &data)
|
||||
return true;
|
||||
}
|
||||
|
||||
void Profile::setAutoDetected(bool detected)
|
||||
void Kit::setAutoDetected(bool detected)
|
||||
{
|
||||
d->m_autodetected = detected;
|
||||
}
|
||||
|
||||
void Profile::setValid(bool valid)
|
||||
void Kit::setValid(bool valid)
|
||||
{
|
||||
d->m_isValid = valid;
|
||||
}
|
||||
|
||||
void Profile::profileUpdated()
|
||||
void Kit::kitUpdated()
|
||||
{
|
||||
ProfileManager::instance()->notifyAboutUpdate(this);
|
||||
KitManager::instance()->notifyAboutUpdate(this);
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
@@ -28,8 +28,8 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PROFILE_H
|
||||
#define PROFILE_H
|
||||
#ifndef KIT_H
|
||||
#define KIT_H
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
#include "task.h"
|
||||
@@ -43,21 +43,21 @@ namespace Utils { class Environment; }
|
||||
namespace ProjectExplorer {
|
||||
|
||||
namespace Internal {
|
||||
class ProfileManagerPrivate;
|
||||
class ProfilePrivate;
|
||||
class KitManagerPrivate;
|
||||
class KitPrivate;
|
||||
} // namespace Internal
|
||||
|
||||
/**
|
||||
* @brief The Profile class
|
||||
* @brief The Kit class
|
||||
*
|
||||
* The profile holds a set of values defining a system targeted by the software
|
||||
* The kit holds a set of values defining a system targeted by the software
|
||||
* under development.
|
||||
*/
|
||||
class PROJECTEXPLORER_EXPORT Profile
|
||||
class PROJECTEXPLORER_EXPORT Kit
|
||||
{
|
||||
public:
|
||||
Profile();
|
||||
~Profile();
|
||||
Kit();
|
||||
~Kit();
|
||||
|
||||
bool isValid() const;
|
||||
QList<Task> validate();
|
||||
@@ -77,34 +77,34 @@ public:
|
||||
void setValue(const Core::Id &key, const QVariant &value);
|
||||
void removeKey(const Core::Id &key);
|
||||
|
||||
bool operator==(const Profile &other) const;
|
||||
bool operator==(const Kit &other) const;
|
||||
|
||||
void addToEnvironment(Utils::Environment &env) const;
|
||||
|
||||
QString toHtml();
|
||||
Profile *clone(bool keepName = false) const;
|
||||
Kit *clone(bool keepName = false) const;
|
||||
|
||||
private:
|
||||
// Unimplemented.
|
||||
Profile(const Profile &other);
|
||||
void operator=(const Profile &other);
|
||||
Kit(const Kit &other);
|
||||
void operator=(const Kit &other);
|
||||
|
||||
void setAutoDetected(bool detected);
|
||||
void setValid(bool valid);
|
||||
|
||||
void profileUpdated();
|
||||
void kitUpdated();
|
||||
|
||||
QVariantMap toMap() const;
|
||||
bool fromMap(const QVariantMap &value);
|
||||
|
||||
Internal::ProfilePrivate *d;
|
||||
Internal::KitPrivate *d;
|
||||
|
||||
friend class ProfileManager;
|
||||
friend class Internal::ProfileManagerPrivate;
|
||||
friend class KitManager;
|
||||
friend class Internal::KitManagerPrivate;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
Q_DECLARE_METATYPE(ProjectExplorer::Profile *)
|
||||
Q_DECLARE_METATYPE(ProjectExplorer::Kit *)
|
||||
|
||||
#endif // PROFILE_H
|
||||
#endif // KIT_H
|
@@ -28,17 +28,17 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "profilechooser.h"
|
||||
#include "kitchooser.h"
|
||||
|
||||
#include "profileinformation.h"
|
||||
#include "profilemanager.h"
|
||||
#include "kitinformation.h"
|
||||
#include "kitmanager.h"
|
||||
#include "abi.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
ProfileChooser::ProfileChooser(QWidget *parent, unsigned flags) :
|
||||
KitChooser::KitChooser(QWidget *parent, unsigned flags) :
|
||||
QComboBox(parent)
|
||||
{
|
||||
populate(flags);
|
||||
@@ -46,64 +46,64 @@ ProfileChooser::ProfileChooser(QWidget *parent, unsigned flags) :
|
||||
connect(this, SIGNAL(currentIndexChanged(int)), SLOT(onCurrentIndexChanged(int)));
|
||||
}
|
||||
|
||||
void ProfileChooser::onCurrentIndexChanged(int index)
|
||||
void KitChooser::onCurrentIndexChanged(int index)
|
||||
{
|
||||
if (Profile *profile = profileAt(index))
|
||||
setToolTip(profile->toHtml());
|
||||
if (Kit *kit = kitAt(index))
|
||||
setToolTip(kit->toHtml());
|
||||
else
|
||||
setToolTip(QString());
|
||||
}
|
||||
|
||||
void ProfileChooser::populate(unsigned flags)
|
||||
void KitChooser::populate(unsigned flags)
|
||||
{
|
||||
clear();
|
||||
const Abi hostAbi = Abi::hostAbi();
|
||||
foreach (Profile *profile, ProfileManager::instance()->profiles()) {
|
||||
if (!profile->isValid() && !(flags & IncludeInvalidProfiles))
|
||||
foreach (Kit *kit, KitManager::instance()->kits()) {
|
||||
if (!kit->isValid() && !(flags & IncludeInvalidKits))
|
||||
continue;
|
||||
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
||||
ToolChain *tc = ToolChainKitInformation::toolChain(kit);
|
||||
if (!tc)
|
||||
continue;
|
||||
const Abi abi = tc->targetAbi();
|
||||
if ((flags & HostAbiOnly) && hostAbi.os() != abi.os())
|
||||
continue;
|
||||
const QString debuggerCommand = profile->value(Core::Id("Debugger.Information")).toString();
|
||||
const QString debuggerCommand = kit->value(Core::Id("Debugger.Information")).toString();
|
||||
if ((flags & HasDebugger) && debuggerCommand.isEmpty())
|
||||
continue;
|
||||
const QString completeBase = QFileInfo(debuggerCommand).completeBaseName();
|
||||
const QString name = tr("%1 (%2)").arg(profile->displayName(), completeBase);
|
||||
addItem(name, qVariantFromValue(profile->id()));
|
||||
setItemData(count() - 1, profile->toHtml(), Qt::ToolTipRole);
|
||||
const QString name = tr("%1 (%2)").arg(kit->displayName(), completeBase);
|
||||
addItem(name, qVariantFromValue(kit->id()));
|
||||
setItemData(count() - 1, kit->toHtml(), Qt::ToolTipRole);
|
||||
}
|
||||
setEnabled(count() > 1);
|
||||
}
|
||||
|
||||
Profile *ProfileChooser::currentProfile() const
|
||||
Kit *KitChooser::currentKit() const
|
||||
{
|
||||
const int index = currentIndex();
|
||||
return index == -1 ? 0 : profileAt(index);
|
||||
return index == -1 ? 0 : kitAt(index);
|
||||
}
|
||||
|
||||
void ProfileChooser::setCurrentProfileId(Core::Id id)
|
||||
void KitChooser::setCurrentKitId(Core::Id id)
|
||||
{
|
||||
for (int i = 0, n = count(); i != n; ++i) {
|
||||
if (profileAt(i)->id() == id) {
|
||||
if (kitAt(i)->id() == id) {
|
||||
setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Core::Id ProfileChooser::currentProfileId() const
|
||||
Core::Id KitChooser::currentKitId() const
|
||||
{
|
||||
Profile *profile = currentProfile();
|
||||
return profile ? profile->id() : Core::Id();
|
||||
Kit *kit = currentKit();
|
||||
return kit ? kit->id() : Core::Id();
|
||||
}
|
||||
|
||||
Profile *ProfileChooser::profileAt(int index) const
|
||||
Kit *KitChooser::kitAt(int index) const
|
||||
{
|
||||
Core::Id id = qvariant_cast<Core::Id>(itemData(index));
|
||||
return ProfileManager::instance()->find(id);
|
||||
return KitManager::instance()->find(id);
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
@@ -28,8 +28,8 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PROJECTEXPLORER_PROFILECHOOSER_H
|
||||
#define PROJECTEXPLORER_PROFILECHOOSER_H
|
||||
#ifndef PROJECTEXPLORER_KITCHOOSER_H
|
||||
#define PROJECTEXPLORER_KITCHOOSER_H
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
@@ -39,35 +39,35 @@ namespace Core { class Id; }
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class Profile;
|
||||
class Kit;
|
||||
|
||||
// Let the user pick a profile.
|
||||
class PROJECTEXPLORER_EXPORT ProfileChooser : public QComboBox
|
||||
// Let the user pick a kit.
|
||||
class PROJECTEXPLORER_EXPORT KitChooser : public QComboBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Flags {
|
||||
HostAbiOnly = 0x1,
|
||||
IncludeInvalidProfiles = 0x2,
|
||||
IncludeInvalidKits = 0x2,
|
||||
HasDebugger = 0x4,
|
||||
RemoteDebugging = IncludeInvalidProfiles | HasDebugger,
|
||||
RemoteDebugging = IncludeInvalidKits | HasDebugger,
|
||||
LocalDebugging = RemoteDebugging | HostAbiOnly
|
||||
};
|
||||
|
||||
explicit ProfileChooser(QWidget *parent, unsigned flags = 0);
|
||||
explicit KitChooser(QWidget *parent, unsigned flags = 0);
|
||||
|
||||
void setCurrentProfileId(Core::Id id);
|
||||
Core::Id currentProfileId() const;
|
||||
void setCurrentKitId(Core::Id id);
|
||||
Core::Id currentKitId() const;
|
||||
|
||||
Profile *currentProfile() const;
|
||||
Kit *currentKit() const;
|
||||
|
||||
private:
|
||||
Q_SLOT void onCurrentIndexChanged(int index);
|
||||
void populate(unsigned flags);
|
||||
Profile *profileAt(int index) const;
|
||||
Kit *kitAt(int index) const;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // PROJECTEXPLORER_PROFILECHOOSER_H
|
||||
#endif // PROJECTEXPLORER_KITCHOOSER_H
|
@@ -28,8 +28,8 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PROFILECONFIGWIDGET_H
|
||||
#define PROFILECONFIGWIDGET_H
|
||||
#ifndef KITCONFIGWIDGET_H
|
||||
#define KITCONFIGWIDGET_H
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
@@ -38,15 +38,15 @@
|
||||
namespace ProjectExplorer {
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ProfileConfigWidget
|
||||
// KitConfigWidget
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ProfileConfigWidget : public QWidget
|
||||
class PROJECTEXPLORER_EXPORT KitConfigWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ProfileConfigWidget(QWidget *parent = 0) : QWidget(parent)
|
||||
KitConfigWidget(QWidget *parent = 0) : QWidget(parent)
|
||||
{ }
|
||||
|
||||
virtual QString displayName() const = 0;
|
||||
@@ -63,4 +63,4 @@ signals:
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // PROFILECONFIGWIDGET_H
|
||||
#endif // KITCONFIGWIDGET_H
|
@@ -28,13 +28,13 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "profileinformation.h"
|
||||
#include "kitinformation.h"
|
||||
|
||||
#include "devicesupport/desktopdevice.h"
|
||||
#include "devicesupport/devicemanager.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "profile.h"
|
||||
#include "profileinformationconfigwidget.h"
|
||||
#include "kit.h"
|
||||
#include "kitinformationconfigwidget.h"
|
||||
#include "toolchain.h"
|
||||
#include "toolchainmanager.h"
|
||||
|
||||
@@ -55,67 +55,67 @@ namespace ProjectExplorer {
|
||||
|
||||
static const char SYSROOT_INFORMATION[] = "PE.Profile.SysRoot";
|
||||
|
||||
SysRootProfileInformation::SysRootProfileInformation()
|
||||
SysRootKitInformation::SysRootKitInformation()
|
||||
{
|
||||
setObjectName(QLatin1String("SysRootInformation"));
|
||||
}
|
||||
|
||||
Core::Id SysRootProfileInformation::dataId() const
|
||||
Core::Id SysRootKitInformation::dataId() const
|
||||
{
|
||||
static const Core::Id id(SYSROOT_INFORMATION);
|
||||
return id;
|
||||
}
|
||||
|
||||
unsigned int SysRootProfileInformation::priority() const
|
||||
unsigned int SysRootKitInformation::priority() const
|
||||
{
|
||||
return 32000;
|
||||
}
|
||||
|
||||
QVariant SysRootProfileInformation::defaultValue(Profile *p) const
|
||||
QVariant SysRootKitInformation::defaultValue(Kit *k) const
|
||||
{
|
||||
Q_UNUSED(p)
|
||||
Q_UNUSED(k)
|
||||
return QString();
|
||||
}
|
||||
|
||||
QList<Task> SysRootProfileInformation::validate(Profile *p) const
|
||||
QList<Task> SysRootKitInformation::validate(Kit *k) const
|
||||
{
|
||||
QList<Task> result;
|
||||
const Utils::FileName dir = SysRootProfileInformation::sysRoot(p);
|
||||
if (!dir.toFileInfo().isDir() && SysRootProfileInformation::hasSysRoot(p)) {
|
||||
const Utils::FileName dir = SysRootKitInformation::sysRoot(k);
|
||||
if (!dir.toFileInfo().isDir() && SysRootKitInformation::hasSysRoot(k)) {
|
||||
result << Task(Task::Error, tr("Sys Root \"%1\" is not a directory.").arg(dir.toUserOutput()),
|
||||
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
ProfileConfigWidget *SysRootProfileInformation::createConfigWidget(Profile *p) const
|
||||
KitConfigWidget *SysRootKitInformation::createConfigWidget(Kit *k) const
|
||||
{
|
||||
Q_ASSERT(p);
|
||||
return new Internal::SysRootInformationConfigWidget(p);
|
||||
Q_ASSERT(k);
|
||||
return new Internal::SysRootInformationConfigWidget(k);
|
||||
}
|
||||
|
||||
ProfileInformation::ItemList SysRootProfileInformation::toUserOutput(Profile *p) const
|
||||
KitInformation::ItemList SysRootKitInformation::toUserOutput(Kit *k) const
|
||||
{
|
||||
return ItemList() << qMakePair(tr("Sys Root"), sysRoot(p).toUserOutput());
|
||||
return ItemList() << qMakePair(tr("Sys Root"), sysRoot(k).toUserOutput());
|
||||
}
|
||||
|
||||
bool SysRootProfileInformation::hasSysRoot(const Profile *p)
|
||||
bool SysRootKitInformation::hasSysRoot(const Kit *k)
|
||||
{
|
||||
if (p)
|
||||
return !p->value(Core::Id(SYSROOT_INFORMATION)).toString().isEmpty();
|
||||
if (k)
|
||||
return !k->value(Core::Id(SYSROOT_INFORMATION)).toString().isEmpty();
|
||||
return false;
|
||||
}
|
||||
|
||||
Utils::FileName SysRootProfileInformation::sysRoot(const Profile *p)
|
||||
Utils::FileName SysRootKitInformation::sysRoot(const Kit *k)
|
||||
{
|
||||
if (!p)
|
||||
if (!k)
|
||||
return Utils::FileName();
|
||||
return Utils::FileName::fromString(p->value(Core::Id(SYSROOT_INFORMATION)).toString());
|
||||
return Utils::FileName::fromString(k->value(Core::Id(SYSROOT_INFORMATION)).toString());
|
||||
}
|
||||
|
||||
void SysRootProfileInformation::setSysRoot(Profile *p, const Utils::FileName &v)
|
||||
void SysRootKitInformation::setSysRoot(Kit *k, const Utils::FileName &v)
|
||||
{
|
||||
p->setValue(Core::Id(SYSROOT_INFORMATION), v.toString());
|
||||
k->setValue(Core::Id(SYSROOT_INFORMATION), v.toString());
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -124,7 +124,7 @@ void SysRootProfileInformation::setSysRoot(Profile *p, const Utils::FileName &v)
|
||||
|
||||
static const char TOOLCHAIN_INFORMATION[] = "PE.Profile.ToolChain";
|
||||
|
||||
ToolChainProfileInformation::ToolChainProfileInformation()
|
||||
ToolChainKitInformation::ToolChainKitInformation()
|
||||
{
|
||||
setObjectName(QLatin1String("ToolChainInformation"));
|
||||
connect(ToolChainManager::instance(), SIGNAL(toolChainRemoved(ProjectExplorer::ToolChain*)),
|
||||
@@ -133,20 +133,20 @@ ToolChainProfileInformation::ToolChainProfileInformation()
|
||||
this, SIGNAL(validationNeeded()));
|
||||
}
|
||||
|
||||
Core::Id ToolChainProfileInformation::dataId() const
|
||||
Core::Id ToolChainKitInformation::dataId() const
|
||||
{
|
||||
static const Core::Id id(TOOLCHAIN_INFORMATION);
|
||||
return id;
|
||||
}
|
||||
|
||||
unsigned int ToolChainProfileInformation::priority() const
|
||||
unsigned int ToolChainKitInformation::priority() const
|
||||
{
|
||||
return 30000;
|
||||
}
|
||||
|
||||
QVariant ToolChainProfileInformation::defaultValue(Profile *p) const
|
||||
QVariant ToolChainKitInformation::defaultValue(Kit *k) const
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
Q_UNUSED(k);
|
||||
QList<ToolChain *> tcList = ToolChainManager::instance()->toolChains();
|
||||
if (tcList.isEmpty())
|
||||
return QString();
|
||||
@@ -161,58 +161,58 @@ QVariant ToolChainProfileInformation::defaultValue(Profile *p) const
|
||||
return tcList.at(0)->id();
|
||||
}
|
||||
|
||||
QList<Task> ToolChainProfileInformation::validate(Profile *p) const
|
||||
QList<Task> ToolChainKitInformation::validate(Kit *k) const
|
||||
{
|
||||
QList<Task> result;
|
||||
if (!toolChain(p)) {
|
||||
setToolChain(p, 0); // make sure to clear out no longer known tool chains
|
||||
result << Task(Task::Error, ToolChainProfileInformation::msgNoToolChainInTarget(),
|
||||
if (!toolChain(k)) {
|
||||
setToolChain(k, 0); // make sure to clear out no longer known tool chains
|
||||
result << Task(Task::Error, ToolChainKitInformation::msgNoToolChainInTarget(),
|
||||
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
ProfileConfigWidget *ToolChainProfileInformation::createConfigWidget(Profile *p) const
|
||||
KitConfigWidget *ToolChainKitInformation::createConfigWidget(Kit *k) const
|
||||
{
|
||||
Q_ASSERT(p);
|
||||
return new Internal::ToolChainInformationConfigWidget(p);
|
||||
Q_ASSERT(k);
|
||||
return new Internal::ToolChainInformationConfigWidget(k);
|
||||
}
|
||||
|
||||
QString ToolChainProfileInformation::displayNamePostfix(const Profile *p) const
|
||||
QString ToolChainKitInformation::displayNamePostfix(const Kit *k) const
|
||||
{
|
||||
ToolChain *tc = toolChain(p);
|
||||
ToolChain *tc = toolChain(k);
|
||||
return tc ? tc->displayName() : QString();
|
||||
}
|
||||
|
||||
ProfileInformation::ItemList ToolChainProfileInformation::toUserOutput(Profile *p) const
|
||||
KitInformation::ItemList ToolChainKitInformation::toUserOutput(Kit *k) const
|
||||
{
|
||||
ToolChain *tc = toolChain(p);
|
||||
ToolChain *tc = toolChain(k);
|
||||
return ItemList() << qMakePair(tr("Compiler"), tc ? tc->displayName() : tr("None"));
|
||||
}
|
||||
|
||||
void ToolChainProfileInformation::addToEnvironment(const Profile *p, Utils::Environment &env) const
|
||||
void ToolChainKitInformation::addToEnvironment(const Kit *k, Utils::Environment &env) const
|
||||
{
|
||||
ToolChain *tc = toolChain(p);
|
||||
ToolChain *tc = toolChain(k);
|
||||
if (tc)
|
||||
tc->addToEnvironment(env);
|
||||
}
|
||||
|
||||
ToolChain *ToolChainProfileInformation::toolChain(const Profile *p)
|
||||
ToolChain *ToolChainKitInformation::toolChain(const Kit *k)
|
||||
{
|
||||
if (!p)
|
||||
if (!k)
|
||||
return 0;
|
||||
const QString id = p->value(Core::Id(TOOLCHAIN_INFORMATION)).toString();
|
||||
const QString id = k->value(Core::Id(TOOLCHAIN_INFORMATION)).toString();
|
||||
return ToolChainManager::instance()->findToolChain(id);
|
||||
}
|
||||
|
||||
void ToolChainProfileInformation::setToolChain(Profile *p, ToolChain *tc)
|
||||
void ToolChainKitInformation::setToolChain(Kit *k, ToolChain *tc)
|
||||
{
|
||||
p->setValue(Core::Id(TOOLCHAIN_INFORMATION), tc ? tc->id() : QString());
|
||||
k->setValue(Core::Id(TOOLCHAIN_INFORMATION), tc ? tc->id() : QString());
|
||||
}
|
||||
|
||||
QString ToolChainProfileInformation::msgNoToolChainInTarget()
|
||||
QString ToolChainKitInformation::msgNoToolChainInTarget()
|
||||
{
|
||||
return tr("No compiler set in target.");
|
||||
return tr("No compiler set in kit.");
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -221,47 +221,47 @@ QString ToolChainProfileInformation::msgNoToolChainInTarget()
|
||||
|
||||
static const char DEVICETYPE_INFORMATION[] = "PE.Profile.DeviceType";
|
||||
|
||||
DeviceTypeProfileInformation::DeviceTypeProfileInformation()
|
||||
DeviceTypeKitInformation::DeviceTypeKitInformation()
|
||||
{
|
||||
setObjectName(QLatin1String("DeviceTypeInformation"));
|
||||
}
|
||||
|
||||
Core::Id DeviceTypeProfileInformation::dataId() const
|
||||
Core::Id DeviceTypeKitInformation::dataId() const
|
||||
{
|
||||
static const Core::Id id(DEVICETYPE_INFORMATION);
|
||||
return id;
|
||||
}
|
||||
|
||||
unsigned int DeviceTypeProfileInformation::priority() const
|
||||
unsigned int DeviceTypeKitInformation::priority() const
|
||||
{
|
||||
return 33000;
|
||||
}
|
||||
|
||||
QVariant DeviceTypeProfileInformation::defaultValue(Profile *p) const
|
||||
QVariant DeviceTypeKitInformation::defaultValue(Kit *k) const
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
Q_UNUSED(k);
|
||||
return QByteArray(Constants::DESKTOP_DEVICE_TYPE);
|
||||
}
|
||||
|
||||
QList<Task> DeviceTypeProfileInformation::validate(Profile *p) const
|
||||
QList<Task> DeviceTypeKitInformation::validate(Kit *k) const
|
||||
{
|
||||
IDevice::ConstPtr dev = DeviceProfileInformation::device(p);
|
||||
IDevice::ConstPtr dev = DeviceKitInformation::device(k);
|
||||
QList<Task> result;
|
||||
if (!dev.isNull() && dev->type() != DeviceTypeProfileInformation::deviceTypeId(p))
|
||||
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;
|
||||
}
|
||||
|
||||
ProfileConfigWidget *DeviceTypeProfileInformation::createConfigWidget(Profile *p) const
|
||||
KitConfigWidget *DeviceTypeKitInformation::createConfigWidget(Kit *k) const
|
||||
{
|
||||
Q_ASSERT(p);
|
||||
return new Internal::DeviceTypeInformationConfigWidget(p);
|
||||
Q_ASSERT(k);
|
||||
return new Internal::DeviceTypeInformationConfigWidget(k);
|
||||
}
|
||||
|
||||
ProfileInformation::ItemList DeviceTypeProfileInformation::toUserOutput(Profile *p) const
|
||||
KitInformation::ItemList DeviceTypeKitInformation::toUserOutput(Kit *k) const
|
||||
{
|
||||
Core::Id type = deviceTypeId(p);
|
||||
Core::Id type = deviceTypeId(k);
|
||||
QString typeDisplayName = tr("Unknown device type");
|
||||
if (type.isValid()) {
|
||||
QList<IDeviceFactory *> factories
|
||||
@@ -276,16 +276,16 @@ ProfileInformation::ItemList DeviceTypeProfileInformation::toUserOutput(Profile
|
||||
return ItemList() << qMakePair(tr("Device type"), typeDisplayName);
|
||||
}
|
||||
|
||||
const Core::Id DeviceTypeProfileInformation::deviceTypeId(const Profile *p)
|
||||
const Core::Id DeviceTypeKitInformation::deviceTypeId(const Kit *k)
|
||||
{
|
||||
if (!p)
|
||||
if (!k)
|
||||
return Core::Id();
|
||||
return Core::Id(p->value(Core::Id(DEVICETYPE_INFORMATION)).toByteArray().constData());
|
||||
return Core::Id(k->value(Core::Id(DEVICETYPE_INFORMATION)).toByteArray().constData());
|
||||
}
|
||||
|
||||
void DeviceTypeProfileInformation::setDeviceTypeId(Profile *p, Core::Id type)
|
||||
void DeviceTypeKitInformation::setDeviceTypeId(Kit *k, Core::Id type)
|
||||
{
|
||||
p->setValue(Core::Id(DEVICETYPE_INFORMATION), type.name());
|
||||
k->setValue(Core::Id(DEVICETYPE_INFORMATION), type.name());
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -294,7 +294,7 @@ void DeviceTypeProfileInformation::setDeviceTypeId(Profile *p, Core::Id type)
|
||||
|
||||
static const char DEVICE_INFORMATION[] = "PE.Profile.Device";
|
||||
|
||||
DeviceProfileInformation::DeviceProfileInformation()
|
||||
DeviceKitInformation::DeviceKitInformation()
|
||||
{
|
||||
setObjectName(QLatin1String("DeviceInformation"));
|
||||
connect(DeviceManager::instance(), SIGNAL(deviceRemoved(Core::Id)),
|
||||
@@ -303,71 +303,71 @@ DeviceProfileInformation::DeviceProfileInformation()
|
||||
this, SIGNAL(validationNeeded()));
|
||||
}
|
||||
|
||||
Core::Id DeviceProfileInformation::dataId() const
|
||||
Core::Id DeviceKitInformation::dataId() const
|
||||
{
|
||||
static const Core::Id id(DEVICE_INFORMATION);
|
||||
return id;
|
||||
}
|
||||
|
||||
unsigned int DeviceProfileInformation::priority() const
|
||||
unsigned int DeviceKitInformation::priority() const
|
||||
{
|
||||
return 32000;
|
||||
}
|
||||
|
||||
QVariant DeviceProfileInformation::defaultValue(Profile *p) const
|
||||
QVariant DeviceKitInformation::defaultValue(Kit *k) const
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
Q_UNUSED(k);
|
||||
return QByteArray(Constants::DESKTOP_DEVICE_ID);
|
||||
}
|
||||
|
||||
QList<Task> DeviceProfileInformation::validate(Profile *p) const
|
||||
QList<Task> DeviceKitInformation::validate(Kit *k) const
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
Q_UNUSED(k);
|
||||
QList<Task> result;
|
||||
return result;
|
||||
}
|
||||
|
||||
ProfileConfigWidget *DeviceProfileInformation::createConfigWidget(Profile *p) const
|
||||
KitConfigWidget *DeviceKitInformation::createConfigWidget(Kit *k) const
|
||||
{
|
||||
Q_ASSERT(p);
|
||||
return new Internal::DeviceInformationConfigWidget(p);
|
||||
Q_ASSERT(k);
|
||||
return new Internal::DeviceInformationConfigWidget(k);
|
||||
}
|
||||
|
||||
QString DeviceProfileInformation::displayNamePostfix(const Profile *p) const
|
||||
QString DeviceKitInformation::displayNamePostfix(const Kit *k) const
|
||||
{
|
||||
IDevice::ConstPtr dev = device(p);
|
||||
IDevice::ConstPtr dev = device(k);
|
||||
return dev.isNull() ? QString() : dev->displayName();
|
||||
}
|
||||
|
||||
ProfileInformation::ItemList DeviceProfileInformation::toUserOutput(Profile *p) const
|
||||
KitInformation::ItemList DeviceKitInformation::toUserOutput(Kit *k) const
|
||||
{
|
||||
IDevice::ConstPtr dev = device(p);
|
||||
IDevice::ConstPtr dev = device(k);
|
||||
return ItemList() << qMakePair(tr("Device"), dev.isNull() ? tr("Unconfigured") : dev->displayName());
|
||||
}
|
||||
|
||||
IDevice::ConstPtr DeviceProfileInformation::device(const Profile *p)
|
||||
IDevice::ConstPtr DeviceKitInformation::device(const Kit *k)
|
||||
{
|
||||
DeviceManager *dm = DeviceManager::instance();
|
||||
return dm ? dm->find(deviceId(p)) : IDevice::ConstPtr();
|
||||
return dm ? dm->find(deviceId(k)) : IDevice::ConstPtr();
|
||||
}
|
||||
|
||||
Core::Id DeviceProfileInformation::deviceId(const Profile *p)
|
||||
Core::Id DeviceKitInformation::deviceId(const Kit *k)
|
||||
{
|
||||
if (p) {
|
||||
QString idname = p->value(Core::Id(DEVICE_INFORMATION)).toString();
|
||||
if (k) {
|
||||
QString idname = k->value(Core::Id(DEVICE_INFORMATION)).toString();
|
||||
return idname.isEmpty() ? IDevice::invalidId() : Core::Id(idname);
|
||||
}
|
||||
return IDevice::invalidId();
|
||||
}
|
||||
|
||||
void DeviceProfileInformation::setDevice(Profile *p, IDevice::ConstPtr dev)
|
||||
void DeviceKitInformation::setDevice(Kit *k, IDevice::ConstPtr dev)
|
||||
{
|
||||
setDeviceId(p, dev ? dev->id() : IDevice::invalidId());
|
||||
setDeviceId(k, dev ? dev->id() : IDevice::invalidId());
|
||||
}
|
||||
|
||||
void DeviceProfileInformation::setDeviceId(Profile *p, const Core::Id id)
|
||||
void DeviceKitInformation::setDeviceId(Kit *k, const Core::Id id)
|
||||
{
|
||||
p->setValue(Core::Id(DEVICE_INFORMATION), id.toString());
|
||||
k->setValue(Core::Id(DEVICE_INFORMATION), id.toString());
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
@@ -28,11 +28,11 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PROFILEINFORMATION_H
|
||||
#define PROFILEINFORMATION_H
|
||||
#ifndef KITINFORMATION_H
|
||||
#define KITINFORMATION_H
|
||||
|
||||
#include "profilemanager.h"
|
||||
#include "profile.h"
|
||||
#include "kitmanager.h"
|
||||
#include "kit.h"
|
||||
|
||||
#include "devicesupport/idevice.h"
|
||||
#include "toolchain.h"
|
||||
@@ -43,44 +43,44 @@
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class ProfileConfigWidget;
|
||||
class KitConfigWidget;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// SysRootInformation:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class PROJECTEXPLORER_EXPORT SysRootProfileInformation : public ProfileInformation
|
||||
class PROJECTEXPLORER_EXPORT SysRootKitInformation : public KitInformation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SysRootProfileInformation();
|
||||
SysRootKitInformation();
|
||||
|
||||
Core::Id dataId() const;
|
||||
unsigned int priority() const;
|
||||
|
||||
QVariant defaultValue(Profile *p) const;
|
||||
QVariant defaultValue(Kit *k) const;
|
||||
|
||||
QList<Task> validate(Profile *p) const;
|
||||
QList<Task> validate(Kit *k) const;
|
||||
|
||||
ProfileConfigWidget *createConfigWidget(Profile *p) const;
|
||||
KitConfigWidget *createConfigWidget(Kit *k) const;
|
||||
|
||||
ItemList toUserOutput(Profile *p) const;
|
||||
ItemList toUserOutput(Kit *k) const;
|
||||
|
||||
static bool hasSysRoot(const Profile *p);
|
||||
static Utils::FileName sysRoot(const Profile *p);
|
||||
static void setSysRoot(Profile *p, const Utils::FileName &v);
|
||||
static bool hasSysRoot(const Kit *k);
|
||||
static Utils::FileName sysRoot(const Kit *k);
|
||||
static void setSysRoot(Kit *k, const Utils::FileName &v);
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT SysRootMatcher : public ProfileMatcher
|
||||
class PROJECTEXPLORER_EXPORT SysRootMatcher : public KitMatcher
|
||||
{
|
||||
public:
|
||||
SysRootMatcher(const Utils::FileName &fn) : m_sysroot(fn)
|
||||
{ }
|
||||
|
||||
bool matches(const Profile *p) const
|
||||
bool matches(const Kit *p) const
|
||||
{
|
||||
return SysRootProfileInformation::sysRoot(p) == m_sysroot;
|
||||
return SysRootKitInformation::sysRoot(p) == m_sysroot;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -91,43 +91,43 @@ private:
|
||||
// ToolChainInformation:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ToolChainProfileInformation : public ProfileInformation
|
||||
class PROJECTEXPLORER_EXPORT ToolChainKitInformation : public KitInformation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ToolChainProfileInformation();
|
||||
ToolChainKitInformation();
|
||||
|
||||
Core::Id dataId() const;
|
||||
unsigned int priority() const;
|
||||
|
||||
QVariant defaultValue(Profile *p) const;
|
||||
QVariant defaultValue(Kit *k) const;
|
||||
|
||||
QList<Task> validate(Profile *p) const;
|
||||
QList<Task> validate(Kit *k) const;
|
||||
|
||||
ProfileConfigWidget *createConfigWidget(Profile *p) const;
|
||||
KitConfigWidget *createConfigWidget(Kit *k) const;
|
||||
|
||||
QString displayNamePostfix(const Profile *p) const;
|
||||
QString displayNamePostfix(const Kit *k) const;
|
||||
|
||||
ItemList toUserOutput(Profile *p) const;
|
||||
ItemList toUserOutput(Kit *k) const;
|
||||
|
||||
void addToEnvironment(const Profile *p, Utils::Environment &env) const;
|
||||
void addToEnvironment(const Kit *k, Utils::Environment &env) const;
|
||||
|
||||
static ToolChain *toolChain(const Profile *p);
|
||||
static void setToolChain(Profile *p, ToolChain *tc);
|
||||
static ToolChain *toolChain(const Kit *k);
|
||||
static void setToolChain(Kit *k, ToolChain *tc);
|
||||
|
||||
static QString msgNoToolChainInTarget();
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ToolChainMatcher : public ProfileMatcher
|
||||
class PROJECTEXPLORER_EXPORT ToolChainMatcher : public KitMatcher
|
||||
{
|
||||
public:
|
||||
ToolChainMatcher(const ToolChain *tc) : m_tc(tc)
|
||||
{ }
|
||||
|
||||
bool matches(const Profile *p) const
|
||||
bool matches(const Kit *p) const
|
||||
{
|
||||
return ToolChainProfileInformation::toolChain(p) == m_tc;
|
||||
return ToolChainKitInformation::toolChain(p) == m_tc;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -138,37 +138,37 @@ private:
|
||||
// DeviceTypeInformation:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class PROJECTEXPLORER_EXPORT DeviceTypeProfileInformation : public ProfileInformation
|
||||
class PROJECTEXPLORER_EXPORT DeviceTypeKitInformation : public KitInformation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DeviceTypeProfileInformation();
|
||||
DeviceTypeKitInformation();
|
||||
|
||||
Core::Id dataId() const;
|
||||
unsigned int priority() const;
|
||||
|
||||
QVariant defaultValue(Profile *p) const;
|
||||
QVariant defaultValue(Kit *k) const;
|
||||
|
||||
QList<Task> validate(Profile *p) const;
|
||||
QList<Task> validate(Kit *k) const;
|
||||
|
||||
ProfileConfigWidget *createConfigWidget(Profile *p) const;
|
||||
KitConfigWidget *createConfigWidget(Kit *k) const;
|
||||
|
||||
ItemList toUserOutput(Profile *p) const;
|
||||
ItemList toUserOutput(Kit *k) const;
|
||||
|
||||
static const Core::Id deviceTypeId(const Profile *p);
|
||||
static void setDeviceTypeId(Profile *p, Core::Id type);
|
||||
static const Core::Id deviceTypeId(const Kit *k);
|
||||
static void setDeviceTypeId(Kit *k, Core::Id type);
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT DeviceTypeMatcher : public ProfileMatcher
|
||||
class PROJECTEXPLORER_EXPORT DeviceTypeMatcher : public KitMatcher
|
||||
{
|
||||
public:
|
||||
DeviceTypeMatcher(const Core::Id t) : m_type(t)
|
||||
{ }
|
||||
|
||||
bool matches(const Profile *p) const
|
||||
bool matches(const Kit *p) const
|
||||
{
|
||||
Core::Id deviceType = DeviceTypeProfileInformation::deviceTypeId(p);
|
||||
Core::Id deviceType = DeviceTypeKitInformation::deviceTypeId(p);
|
||||
if (!deviceType.isValid())
|
||||
return false;
|
||||
return deviceType == m_type;
|
||||
@@ -182,41 +182,41 @@ private:
|
||||
// DeviceInformation:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class PROJECTEXPLORER_EXPORT DeviceProfileInformation : public ProfileInformation
|
||||
class PROJECTEXPLORER_EXPORT DeviceKitInformation : public KitInformation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DeviceProfileInformation();
|
||||
DeviceKitInformation();
|
||||
|
||||
Core::Id dataId() const;
|
||||
unsigned int priority() const;
|
||||
|
||||
QVariant defaultValue(Profile *p) const;
|
||||
QVariant defaultValue(Kit *k) const;
|
||||
|
||||
QList<Task> validate(Profile *p) const;
|
||||
QList<Task> validate(Kit *k) const;
|
||||
|
||||
ProfileConfigWidget *createConfigWidget(Profile *p) const;
|
||||
KitConfigWidget *createConfigWidget(Kit *k) const;
|
||||
|
||||
QString displayNamePostfix(const Profile *p) const;
|
||||
QString displayNamePostfix(const Kit *k) const;
|
||||
|
||||
ItemList toUserOutput(Profile *p) const;
|
||||
ItemList toUserOutput(Kit *k) const;
|
||||
|
||||
static IDevice::ConstPtr device(const Profile *p);
|
||||
static Core::Id deviceId(const Profile *p);
|
||||
static void setDevice(Profile *p, IDevice::ConstPtr dev);
|
||||
static void setDeviceId(Profile *p, const Core::Id id);
|
||||
static IDevice::ConstPtr device(const Kit *k);
|
||||
static Core::Id deviceId(const Kit *k);
|
||||
static void setDevice(Kit *k, IDevice::ConstPtr dev);
|
||||
static void setDeviceId(Kit *k, const Core::Id id);
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT DeviceMatcher : public ProfileMatcher
|
||||
class PROJECTEXPLORER_EXPORT DeviceMatcher : public KitMatcher
|
||||
{
|
||||
public:
|
||||
DeviceMatcher(Core::Id id) : m_devId(id)
|
||||
{ }
|
||||
|
||||
bool matches(const Profile *p) const
|
||||
bool matches(const Kit *p) const
|
||||
{
|
||||
return DeviceProfileInformation::deviceId(p) == m_devId;
|
||||
return DeviceKitInformation::deviceId(p) == m_devId;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -225,4 +225,4 @@ private:
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // PROFILEINFORMATION_H
|
||||
#endif // KITINFORMATION_H
|
@@ -28,14 +28,14 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "profileinformationconfigwidget.h"
|
||||
#include "kitinformationconfigwidget.h"
|
||||
|
||||
#include "devicesupport/devicemanager.h"
|
||||
#include "devicesupport/devicemanagermodel.h"
|
||||
#include "devicesupport/idevicefactory.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "profile.h"
|
||||
#include "profileinformation.h"
|
||||
#include "kit.h"
|
||||
#include "kitinformation.h"
|
||||
#include "toolchain.h"
|
||||
#include "toolchainmanager.h"
|
||||
|
||||
@@ -55,9 +55,9 @@ namespace Internal {
|
||||
// SysRootInformationConfigWidget:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
SysRootInformationConfigWidget::SysRootInformationConfigWidget(Profile *p, QWidget *parent) :
|
||||
ProfileConfigWidget(parent),
|
||||
m_profile(p)
|
||||
SysRootInformationConfigWidget::SysRootInformationConfigWidget(Kit *k, QWidget *parent) :
|
||||
KitConfigWidget(parent),
|
||||
m_kit(k)
|
||||
{
|
||||
setToolTip(tr("The root directory of the system image to use.<br>"
|
||||
"Leave empty when building for the desktop."));
|
||||
@@ -68,7 +68,7 @@ SysRootInformationConfigWidget::SysRootInformationConfigWidget(Profile *p, QWidg
|
||||
layout->addWidget(m_chooser);
|
||||
m_chooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
|
||||
|
||||
m_chooser->setFileName(SysRootProfileInformation::sysRoot(p));
|
||||
m_chooser->setFileName(SysRootKitInformation::sysRoot(k));
|
||||
|
||||
connect(m_chooser, SIGNAL(changed(QString)), this, SIGNAL(dirty()));
|
||||
}
|
||||
@@ -80,17 +80,17 @@ QString SysRootInformationConfigWidget::displayName() const
|
||||
|
||||
void SysRootInformationConfigWidget::apply()
|
||||
{
|
||||
SysRootProfileInformation::setSysRoot(m_profile, m_chooser->fileName());
|
||||
SysRootKitInformation::setSysRoot(m_kit, m_chooser->fileName());
|
||||
}
|
||||
|
||||
void SysRootInformationConfigWidget::discard()
|
||||
{
|
||||
m_chooser->setFileName(SysRootProfileInformation::sysRoot(m_profile));
|
||||
m_chooser->setFileName(SysRootKitInformation::sysRoot(m_kit));
|
||||
}
|
||||
|
||||
bool SysRootInformationConfigWidget::isDirty() const
|
||||
{
|
||||
return SysRootProfileInformation::sysRoot(m_profile) != m_chooser->fileName();
|
||||
return SysRootKitInformation::sysRoot(m_kit) != m_chooser->fileName();
|
||||
}
|
||||
|
||||
void SysRootInformationConfigWidget::makeReadOnly()
|
||||
@@ -107,9 +107,9 @@ QWidget *SysRootInformationConfigWidget::buttonWidget() const
|
||||
// ToolChainInformationConfigWidget:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
ToolChainInformationConfigWidget::ToolChainInformationConfigWidget(Profile *p, QWidget *parent) :
|
||||
ProfileConfigWidget(parent),
|
||||
m_isReadOnly(false), m_profile(p),
|
||||
ToolChainInformationConfigWidget::ToolChainInformationConfigWidget(Kit *k, QWidget *parent) :
|
||||
KitConfigWidget(parent),
|
||||
m_isReadOnly(false), m_kit(k),
|
||||
m_comboBox(new QComboBox), m_manageButton(new QPushButton(this))
|
||||
{
|
||||
setToolTip(tr("The compiler to use for building.<br>"
|
||||
@@ -153,17 +153,17 @@ void ToolChainInformationConfigWidget::apply()
|
||||
{
|
||||
const QString id = m_comboBox->itemData(m_comboBox->currentIndex()).toString();
|
||||
ToolChain *tc = ToolChainManager::instance()->findToolChain(id);
|
||||
ToolChainProfileInformation::setToolChain(m_profile, tc);
|
||||
ToolChainKitInformation::setToolChain(m_kit, tc);
|
||||
}
|
||||
|
||||
void ToolChainInformationConfigWidget::discard()
|
||||
{
|
||||
m_comboBox->setCurrentIndex(indexOf(ToolChainProfileInformation::toolChain(m_profile)));
|
||||
m_comboBox->setCurrentIndex(indexOf(ToolChainKitInformation::toolChain(m_kit)));
|
||||
}
|
||||
|
||||
bool ToolChainInformationConfigWidget::isDirty() const
|
||||
{
|
||||
ToolChain *tc = ToolChainProfileInformation::toolChain(m_profile);
|
||||
ToolChain *tc = ToolChainKitInformation::toolChain(m_kit);
|
||||
return (m_comboBox->itemData(m_comboBox->currentIndex()).toString())
|
||||
== (tc ? tc->id() : QString());
|
||||
}
|
||||
@@ -235,9 +235,9 @@ int ToolChainInformationConfigWidget::indexOf(const ToolChain *tc)
|
||||
// DeviceTypeInformationConfigWidget:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
DeviceTypeInformationConfigWidget::DeviceTypeInformationConfigWidget(Profile *p, QWidget *parent) :
|
||||
ProfileConfigWidget(parent),
|
||||
m_isReadOnly(false), m_profile(p),
|
||||
DeviceTypeInformationConfigWidget::DeviceTypeInformationConfigWidget(Kit *k, QWidget *parent) :
|
||||
KitConfigWidget(parent),
|
||||
m_isReadOnly(false), m_kit(k),
|
||||
m_comboBox(new QComboBox)
|
||||
{
|
||||
setToolTip(tr("The type of device to run applications on."));
|
||||
@@ -269,12 +269,12 @@ void DeviceTypeInformationConfigWidget::apply()
|
||||
Core::Id devType;
|
||||
if (m_comboBox->currentIndex() >= 0)
|
||||
devType = m_comboBox->itemData(m_comboBox->currentIndex()).value<Core::Id>();
|
||||
DeviceTypeProfileInformation::setDeviceTypeId(m_profile, devType);
|
||||
DeviceTypeKitInformation::setDeviceTypeId(m_kit, devType);
|
||||
}
|
||||
|
||||
void DeviceTypeInformationConfigWidget::discard()
|
||||
{
|
||||
Core::Id devType = DeviceTypeProfileInformation::deviceTypeId(m_profile);
|
||||
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(m_kit);
|
||||
if (!devType.isValid())
|
||||
m_comboBox->setCurrentIndex(-1);
|
||||
for (int i = 0; i < m_comboBox->count(); ++i) {
|
||||
@@ -290,7 +290,7 @@ bool DeviceTypeInformationConfigWidget::isDirty() const
|
||||
Core::Id devType;
|
||||
if (m_comboBox->currentIndex() >= 0)
|
||||
devType = m_comboBox->itemData(m_comboBox->currentIndex()).value<Core::Id>();
|
||||
return DeviceTypeProfileInformation::deviceTypeId(m_profile) != devType;
|
||||
return DeviceTypeKitInformation::deviceTypeId(m_kit) != devType;
|
||||
}
|
||||
|
||||
void DeviceTypeInformationConfigWidget::makeReadOnly()
|
||||
@@ -302,9 +302,9 @@ void DeviceTypeInformationConfigWidget::makeReadOnly()
|
||||
// DeviceInformationConfigWidget:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
DeviceInformationConfigWidget::DeviceInformationConfigWidget(Profile *p, QWidget *parent) :
|
||||
ProfileConfigWidget(parent),
|
||||
m_isReadOnly(false), m_profile(p),
|
||||
DeviceInformationConfigWidget::DeviceInformationConfigWidget(Kit *k, QWidget *parent) :
|
||||
KitConfigWidget(parent),
|
||||
m_isReadOnly(false), m_kit(k),
|
||||
m_comboBox(new QComboBox), m_manageButton(new QPushButton(this)),
|
||||
m_model(new DeviceManagerModel(DeviceManager::instance()))
|
||||
{
|
||||
@@ -336,19 +336,19 @@ void DeviceInformationConfigWidget::apply()
|
||||
{
|
||||
int idx = m_comboBox->currentIndex();
|
||||
if (idx >= 0)
|
||||
DeviceProfileInformation::setDeviceId(m_profile, m_model->deviceId(idx));
|
||||
DeviceKitInformation::setDeviceId(m_kit, m_model->deviceId(idx));
|
||||
else
|
||||
DeviceProfileInformation::setDeviceId(m_profile, IDevice::invalidId());
|
||||
DeviceKitInformation::setDeviceId(m_kit, IDevice::invalidId());
|
||||
}
|
||||
|
||||
void DeviceInformationConfigWidget::discard()
|
||||
{
|
||||
m_comboBox->setCurrentIndex(m_model->indexOf(DeviceProfileInformation::device(m_profile)));
|
||||
m_comboBox->setCurrentIndex(m_model->indexOf(DeviceKitInformation::device(m_kit)));
|
||||
}
|
||||
|
||||
bool DeviceInformationConfigWidget::isDirty() const
|
||||
{
|
||||
Core::Id devId = DeviceProfileInformation::deviceId(m_profile);
|
||||
Core::Id devId = DeviceKitInformation::deviceId(m_kit);
|
||||
return devId != m_model->deviceId(m_comboBox->currentIndex());
|
||||
}
|
||||
|
@@ -28,10 +28,10 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PROFILEINFORMATIONCONFIGWIDGET_H
|
||||
#define PROFILEINFORMATIONCONFIGWIDGET_H
|
||||
#ifndef KITINFORMATIONCONFIGWIDGET_H
|
||||
#define KITINFORMATIONCONFIGWIDGET_H
|
||||
|
||||
#include "profileconfigwidget.h"
|
||||
#include "kitconfigwidget.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QComboBox;
|
||||
@@ -43,7 +43,7 @@ namespace Utils { class PathChooser; }
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class DeviceManagerModel;
|
||||
class Profile;
|
||||
class Kit;
|
||||
class ToolChain;
|
||||
|
||||
namespace Internal {
|
||||
@@ -52,12 +52,12 @@ namespace Internal {
|
||||
// SysRootInformationConfigWidget:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class SysRootInformationConfigWidget : public ProfileConfigWidget
|
||||
class SysRootInformationConfigWidget : public KitConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SysRootInformationConfigWidget(Profile *p, QWidget *parent = 0);
|
||||
explicit SysRootInformationConfigWidget(Kit *k, QWidget *parent = 0);
|
||||
|
||||
QString displayName() const;
|
||||
void apply();
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
QWidget *buttonWidget() const;
|
||||
|
||||
private:
|
||||
Profile *m_profile;
|
||||
Kit *m_kit;
|
||||
Utils::PathChooser *m_chooser;
|
||||
};
|
||||
|
||||
@@ -75,12 +75,12 @@ private:
|
||||
// ToolChainInformationConfigWidget:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class ToolChainInformationConfigWidget : public ProfileConfigWidget
|
||||
class ToolChainInformationConfigWidget : public KitConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ToolChainInformationConfigWidget(Profile *p, QWidget *parent = 0);
|
||||
explicit ToolChainInformationConfigWidget(Kit *k, QWidget *parent = 0);
|
||||
|
||||
QString displayName() const;
|
||||
void apply();
|
||||
@@ -100,7 +100,7 @@ private:
|
||||
int indexOf(const ToolChain *tc);
|
||||
|
||||
bool m_isReadOnly;
|
||||
Profile *m_profile;
|
||||
Kit *m_kit;
|
||||
QComboBox *m_comboBox;
|
||||
QPushButton *m_manageButton;
|
||||
};
|
||||
@@ -109,12 +109,12 @@ private:
|
||||
// DeviceTypeInformationConfigWidget:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class DeviceTypeInformationConfigWidget : public ProfileConfigWidget
|
||||
class DeviceTypeInformationConfigWidget : public KitConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DeviceTypeInformationConfigWidget(Profile *p, QWidget *parent = 0);
|
||||
explicit DeviceTypeInformationConfigWidget(Kit *k, QWidget *parent = 0);
|
||||
|
||||
QString displayName() const;
|
||||
void apply();
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
|
||||
private:
|
||||
bool m_isReadOnly;
|
||||
Profile *m_profile;
|
||||
Kit *m_kit;
|
||||
QComboBox *m_comboBox;
|
||||
};
|
||||
|
||||
@@ -132,12 +132,12 @@ private:
|
||||
// DeviceInformationConfigWidget:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class DeviceInformationConfigWidget : public ProfileConfigWidget
|
||||
class DeviceInformationConfigWidget : public KitConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DeviceInformationConfigWidget(Profile *p, QWidget *parent = 0);
|
||||
explicit DeviceInformationConfigWidget(Kit *k, QWidget *parent = 0);
|
||||
|
||||
QString displayName() const;
|
||||
void apply();
|
||||
@@ -151,7 +151,7 @@ private slots:
|
||||
|
||||
private:
|
||||
bool m_isReadOnly;
|
||||
Profile *m_profile;
|
||||
Kit *m_kit;
|
||||
QComboBox *m_comboBox;
|
||||
QPushButton *m_manageButton;
|
||||
DeviceManagerModel *m_model;
|
||||
@@ -160,4 +160,4 @@ private:
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // PROFILEINFORMATIONCONFIGWIDGET_H
|
||||
#endif // KITINFORMATIONCONFIGWIDGET_H
|
478
src/plugins/projectexplorer/kitmanager.cpp
Normal file
478
src/plugins/projectexplorer/kitmanager.cpp
Normal file
@@ -0,0 +1,478 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "kitmanager.h"
|
||||
|
||||
#include "kit.h"
|
||||
#include "kitconfigwidget.h"
|
||||
#include "kitinformation.h"
|
||||
#include "kitmanagerconfigwidget.h"
|
||||
#include "project.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <utils/persistentsettings.h>
|
||||
#include <utils/environment.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QSettings>
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
|
||||
static const char KIT_DATA_KEY[] = "Profile.";
|
||||
static const char KIT_COUNT_KEY[] = "Profile.Count";
|
||||
static const char KIT_FILE_VERSION_KEY[] = "Version";
|
||||
static const char KIT_DEFAULT_KEY[] = "Profile.Default";
|
||||
static const char KIT_FILENAME[] = "/qtcreator/profiles.xml";
|
||||
|
||||
using Utils::PersistentSettingsWriter;
|
||||
using Utils::PersistentSettingsReader;
|
||||
|
||||
static Utils::FileName settingsFileName()
|
||||
{
|
||||
QFileInfo settingsLocation(ExtensionSystem::PluginManager::settings()->fileName());
|
||||
return Utils::FileName::fromString(settingsLocation.absolutePath() + QLatin1String(KIT_FILENAME));
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
KitManager *KitManager::m_instance = 0;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// KitManagerPrivate:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class KitManagerPrivate
|
||||
{
|
||||
public:
|
||||
KitManagerPrivate();
|
||||
~KitManagerPrivate();
|
||||
QList<Task> validateKit(Kit *k) const;
|
||||
|
||||
Kit *m_defaultKit;
|
||||
bool m_initialized;
|
||||
QList<KitInformation *> m_informationList;
|
||||
QList<Kit *> m_kitList;
|
||||
Utils::PersistentSettingsWriter *m_writer;
|
||||
};
|
||||
|
||||
KitManagerPrivate::KitManagerPrivate()
|
||||
: m_defaultKit(0), m_initialized(false),
|
||||
m_writer(new Utils::PersistentSettingsWriter(settingsFileName(), QLatin1String("QtCreatorProfiles")))
|
||||
{ }
|
||||
|
||||
KitManagerPrivate::~KitManagerPrivate()
|
||||
{
|
||||
qDeleteAll(m_informationList);
|
||||
qDeleteAll(m_kitList);
|
||||
delete m_writer;
|
||||
}
|
||||
|
||||
QList<Task> KitManagerPrivate::validateKit(Kit *k) const
|
||||
{
|
||||
Q_ASSERT(k);
|
||||
QList<Task> result;
|
||||
bool hasError = false;
|
||||
foreach (KitInformation *ki, m_informationList) {
|
||||
QList<Task> tmp = ki->validate(k);
|
||||
foreach (const Task &t, tmp)
|
||||
if (t.type == Task::Error)
|
||||
hasError = true;
|
||||
result << tmp;
|
||||
}
|
||||
k->setValid(!hasError);
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// KitManager:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
KitManager *KitManager::instance()
|
||||
{
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
KitManager::KitManager(QObject *parent) :
|
||||
QObject(parent),
|
||||
d(new Internal::KitManagerPrivate())
|
||||
{
|
||||
Q_ASSERT(!m_instance);
|
||||
m_instance = this;
|
||||
|
||||
connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()),
|
||||
this, SLOT(saveKits()));
|
||||
|
||||
connect(this, SIGNAL(kitAdded(ProjectExplorer::Kit*)),
|
||||
this, SIGNAL(kitsChanged()));
|
||||
connect(this, SIGNAL(kitRemoved(ProjectExplorer::Kit*)),
|
||||
this, SIGNAL(kitsChanged()));
|
||||
connect(this, SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||
this, SIGNAL(kitsChanged()));
|
||||
}
|
||||
|
||||
void KitManager::restoreKits()
|
||||
{
|
||||
QList<Kit *> kitsToRegister;
|
||||
QList<Kit *> kitsToCheck;
|
||||
|
||||
// read all kits from SDK
|
||||
QFileInfo systemSettingsFile(Core::ICore::settings(QSettings::SystemScope)->fileName());
|
||||
KitList system = restoreKits(Utils::FileName::fromString(systemSettingsFile.absolutePath() + QLatin1String(KIT_FILENAME)));
|
||||
QList<Kit *> readKits = system.kits;
|
||||
// make sure we mark these as autodetected!
|
||||
foreach (Kit *p, readKits)
|
||||
p->setAutoDetected(true);
|
||||
|
||||
kitsToRegister = readKits; // SDK kits are always considered to be up-to-date, so no need to
|
||||
// recheck them.
|
||||
|
||||
// read all kit chains from user file
|
||||
KitList userKits = restoreKits(settingsFileName());
|
||||
readKits = userKits.kits;
|
||||
|
||||
foreach (Kit *p, readKits) {
|
||||
if (p->isAutoDetected())
|
||||
kitsToCheck.append(p);
|
||||
else
|
||||
kitsToRegister.append(p);
|
||||
}
|
||||
readKits.clear();
|
||||
|
||||
// Then auto create kits:
|
||||
QList<Kit *> detectedKits;
|
||||
|
||||
// Find/update autodetected kits:
|
||||
Kit *toStore = 0;
|
||||
foreach (Kit *currentDetected, detectedKits) {
|
||||
toStore = currentDetected;
|
||||
|
||||
// Check whether we had this kit stored and prefer the old one with the old id:
|
||||
for (int i = 0; i < kitsToCheck.count(); ++i) {
|
||||
if (*(kitsToCheck.at(i)) == *currentDetected) {
|
||||
toStore = kitsToCheck.at(i);
|
||||
kitsToCheck.removeAt(i);
|
||||
delete currentDetected;
|
||||
break;
|
||||
}
|
||||
}
|
||||
addKit(toStore);
|
||||
}
|
||||
|
||||
// Delete all loaded autodetected kits that were not rediscovered:
|
||||
qDeleteAll(kitsToCheck);
|
||||
|
||||
// Store manual kits
|
||||
foreach (Kit *p, kitsToRegister)
|
||||
addKit(p);
|
||||
|
||||
if (kits().isEmpty()) {
|
||||
Kit *defaultKit = new Kit; // One kit using default values
|
||||
defaultKit->setDisplayName(tr("Desktop"));
|
||||
defaultKit->setAutoDetected(false);
|
||||
defaultKit->setIconPath(QLatin1String(":///DESKTOP///"));
|
||||
|
||||
addKit(defaultKit);
|
||||
}
|
||||
|
||||
Kit *p = find(userKits.defaultKit);
|
||||
if (p)
|
||||
setDefaultKit(p);
|
||||
}
|
||||
|
||||
KitManager::~KitManager()
|
||||
{
|
||||
// Clean out kit information to avoid calling them during deregistration:
|
||||
delete d;
|
||||
m_instance = 0;
|
||||
}
|
||||
|
||||
void KitManager::saveKits()
|
||||
{
|
||||
if (!d->m_initialized) // ignore save requests while we are not initialized.
|
||||
return;
|
||||
|
||||
QVariantMap data;
|
||||
data.insert(QLatin1String(KIT_FILE_VERSION_KEY), 1);
|
||||
|
||||
int count = 0;
|
||||
foreach (Kit *p, kits()) {
|
||||
QVariantMap tmp = p->toMap();
|
||||
if (tmp.isEmpty())
|
||||
continue;
|
||||
data.insert(QString::fromLatin1(KIT_DATA_KEY) + QString::number(count), tmp);
|
||||
++count;
|
||||
}
|
||||
data.insert(QLatin1String(KIT_COUNT_KEY), count);
|
||||
data.insert(QLatin1String(KIT_DEFAULT_KEY),
|
||||
d->m_defaultKit ? QString::fromLatin1(d->m_defaultKit->id().name()) : QString());
|
||||
d->m_writer->save(data, Core::ICore::mainWindow());
|
||||
}
|
||||
|
||||
bool greaterPriority(KitInformation *a, KitInformation *b)
|
||||
{
|
||||
return a->priority() > b->priority();
|
||||
}
|
||||
|
||||
void KitManager::registerKitInformation(KitInformation *ki)
|
||||
{
|
||||
QList<KitInformation *>::iterator it
|
||||
= qLowerBound(d->m_informationList.begin(), d->m_informationList.end(), ki, greaterPriority);
|
||||
d->m_informationList.insert(it, ki);
|
||||
|
||||
connect(ki, SIGNAL(validationNeeded()), this, SLOT(validateKits()));
|
||||
|
||||
if (!d->m_initialized)
|
||||
return;
|
||||
|
||||
foreach (Kit *p, kits()) {
|
||||
if (!p->hasValue(ki->dataId()))
|
||||
p->setValue(ki->dataId(), ki->defaultValue(p));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void KitManager::deregisterKitInformation(KitInformation *ki)
|
||||
{
|
||||
Q_ASSERT(d->m_informationList.contains(ki));
|
||||
d->m_informationList.removeAll(ki);
|
||||
delete ki;
|
||||
}
|
||||
|
||||
KitManager::KitList KitManager::restoreKits(const Utils::FileName &fileName)
|
||||
{
|
||||
KitList result;
|
||||
|
||||
PersistentSettingsReader reader;
|
||||
if (!reader.load(fileName))
|
||||
return result;
|
||||
QVariantMap data = reader.restoreValues();
|
||||
|
||||
// Check version:
|
||||
int version = data.value(QLatin1String(KIT_FILE_VERSION_KEY), 0).toInt();
|
||||
if (version < 1)
|
||||
return result;
|
||||
|
||||
const int count = data.value(QLatin1String(KIT_COUNT_KEY), 0).toInt();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const QString key = QString::fromLatin1(KIT_DATA_KEY) + QString::number(i);
|
||||
if (!data.contains(key))
|
||||
break;
|
||||
|
||||
const QVariantMap stMap = data.value(key).toMap();
|
||||
|
||||
Kit *p = new Kit;
|
||||
if (p->fromMap(stMap)) {
|
||||
result.kits.append(p);
|
||||
} else {
|
||||
delete p;
|
||||
qWarning("Warning: Unable to restore kits stored in %s at position %d.",
|
||||
qPrintable(fileName.toUserOutput()), i);
|
||||
}
|
||||
}
|
||||
const QString defaultId = data.value(QLatin1String(KIT_DEFAULT_KEY)).toString();
|
||||
if (defaultId.isEmpty())
|
||||
return result;
|
||||
|
||||
const Core::Id id = Core::Id(defaultId);
|
||||
foreach (Kit *i, result.kits) {
|
||||
if (i->id() == id) {
|
||||
result.defaultKit = id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QList<Kit *> KitManager::kits(const KitMatcher *m) const
|
||||
{
|
||||
if (!d->m_initialized) {
|
||||
d->m_initialized = true;
|
||||
const_cast<KitManager *>(this)->restoreKits();
|
||||
}
|
||||
|
||||
QList<Kit *> result;
|
||||
foreach (Kit *p, d->m_kitList) {
|
||||
if (!m || m->matches(p))
|
||||
result.append(p);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Kit *KitManager::find(const Core::Id &id) const
|
||||
{
|
||||
if (!id.isValid())
|
||||
return 0;
|
||||
|
||||
foreach (Kit *p, kits()) {
|
||||
if (p->id() == id)
|
||||
return p;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Kit *KitManager::find(const KitMatcher *m) const
|
||||
{
|
||||
QList<Kit *> matched = kits(m);
|
||||
return matched.isEmpty() ? 0 : matched.first();
|
||||
}
|
||||
|
||||
Kit *KitManager::defaultKit()
|
||||
{
|
||||
if (!d->m_initialized) {
|
||||
d->m_initialized = true;
|
||||
restoreKits();
|
||||
}
|
||||
return d->m_defaultKit;
|
||||
}
|
||||
|
||||
QList<KitInformation *> KitManager::kitInformation() const
|
||||
{
|
||||
return d->m_informationList;
|
||||
}
|
||||
|
||||
KitConfigWidget *KitManager::createConfigWidget(Kit *k) const
|
||||
{
|
||||
if (!k)
|
||||
return 0;
|
||||
|
||||
Internal::KitManagerConfigWidget *result = new Internal::KitManagerConfigWidget(k);
|
||||
foreach (KitInformation *ki, d->m_informationList)
|
||||
result->addConfigWidget(ki->createConfigWidget(k));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void KitManager::notifyAboutUpdate(ProjectExplorer::Kit *p)
|
||||
{
|
||||
if (!p || !kits().contains(p))
|
||||
return;
|
||||
d->validateKit(p);
|
||||
emit kitUpdated(p);
|
||||
}
|
||||
|
||||
bool KitManager::registerKit(ProjectExplorer::Kit *k)
|
||||
{
|
||||
if (!k)
|
||||
return true;
|
||||
foreach (Kit *current, kits()) {
|
||||
if (k == current)
|
||||
return false;
|
||||
}
|
||||
|
||||
// make sure we have all the information in our kits:
|
||||
foreach (KitInformation *ki, d->m_informationList) {
|
||||
if (!k->hasValue(ki->dataId()))
|
||||
k->setValue(ki->dataId(), ki->defaultValue(k));
|
||||
}
|
||||
|
||||
addKit(k);
|
||||
emit kitAdded(k);
|
||||
return true;
|
||||
}
|
||||
|
||||
void KitManager::deregisterKit(Kit *k)
|
||||
{
|
||||
if (!k || !kits().contains(k))
|
||||
return;
|
||||
d->m_kitList.removeOne(k);
|
||||
if (d->m_defaultKit == k) {
|
||||
QList<Kit *> stList = kits();
|
||||
Kit *newDefault = 0;
|
||||
foreach (Kit *cur, stList) {
|
||||
if (cur->isValid()) {
|
||||
newDefault = cur;
|
||||
break;
|
||||
}
|
||||
}
|
||||
setDefaultKit(newDefault);
|
||||
}
|
||||
emit kitRemoved(k);
|
||||
delete k;
|
||||
}
|
||||
|
||||
QList<Task> KitManager::validateKit(Kit *k)
|
||||
{
|
||||
QList<Task> result = d->validateKit(k);
|
||||
qSort(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void KitManager::setDefaultKit(Kit *k)
|
||||
{
|
||||
if (d->m_defaultKit == k)
|
||||
return;
|
||||
if (k && !kits().contains(k))
|
||||
return;
|
||||
d->m_defaultKit = k;
|
||||
emit defaultkitChanged();
|
||||
}
|
||||
|
||||
void KitManager::validateKits()
|
||||
{
|
||||
foreach (Kit *p, kits())
|
||||
d->validateKit(p);
|
||||
}
|
||||
|
||||
void KitManager::addKit(Kit *k)
|
||||
{
|
||||
if (!k)
|
||||
return;
|
||||
k->setDisplayName(k->displayName()); // make name unique
|
||||
d->validateKit(k);
|
||||
d->m_kitList.append(k);
|
||||
if (!d->m_defaultKit ||
|
||||
(!d->m_defaultKit->isValid() && k->isValid()))
|
||||
setDefaultKit(k);
|
||||
}
|
||||
|
||||
|
||||
void KitInformation::addToEnvironment(const Kit *k, Utils::Environment &env) const
|
||||
{
|
||||
Q_UNUSED(k);
|
||||
Q_UNUSED(env);
|
||||
}
|
||||
|
||||
QString KitInformation::displayNamePostfix(const Kit *k) const
|
||||
{
|
||||
Q_UNUSED(k);
|
||||
return QString();
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
171
src/plugins/projectexplorer/kitmanager.h
Normal file
171
src/plugins/projectexplorer/kitmanager.h
Normal file
@@ -0,0 +1,171 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef KITMANAGER_H
|
||||
#define KITMANAGER_H
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
#include "task.h"
|
||||
|
||||
#include <coreplugin/id.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QPair>
|
||||
|
||||
namespace Utils { class Environment; }
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class Kit;
|
||||
class KitConfigWidget;
|
||||
|
||||
namespace Internal {
|
||||
class KitManagerPrivate;
|
||||
class KitModel;
|
||||
} // namespace Internal
|
||||
|
||||
/**
|
||||
* @brief The KitInformation class
|
||||
*
|
||||
* One piece of information stored in the kit.
|
||||
*
|
||||
* This needs to get registered with the \a KitManager.
|
||||
*/
|
||||
class PROJECTEXPLORER_EXPORT KitInformation : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
typedef QPair<QString, QString> Item;
|
||||
typedef QList<Item> ItemList;
|
||||
|
||||
virtual Core::Id dataId() const = 0;
|
||||
|
||||
virtual unsigned int priority() const = 0; // the higher the closer to the top.
|
||||
|
||||
virtual bool visibleIn(Kit *) { return true; }
|
||||
virtual QVariant defaultValue(Kit *) const = 0;
|
||||
|
||||
virtual QList<Task> validate(Kit *) const = 0;
|
||||
|
||||
virtual ItemList toUserOutput(Kit *) const = 0;
|
||||
|
||||
virtual KitConfigWidget *createConfigWidget(Kit *) const = 0;
|
||||
|
||||
virtual void addToEnvironment(const Kit *k, Utils::Environment &env) const;
|
||||
|
||||
virtual QString displayNamePostfix(const Kit *k) const;
|
||||
|
||||
signals:
|
||||
void validationNeeded();
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT KitMatcher
|
||||
{
|
||||
public:
|
||||
virtual ~KitMatcher() { }
|
||||
virtual bool matches(const Kit *k) const = 0;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT KitManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static KitManager *instance();
|
||||
~KitManager();
|
||||
|
||||
QList<Kit *> kits(const KitMatcher *m = 0) const;
|
||||
Kit *find(const Core::Id &id) const;
|
||||
Kit *find(const KitMatcher *m) const;
|
||||
Kit *defaultKit();
|
||||
|
||||
QList<KitInformation *> kitInformation() const;
|
||||
|
||||
KitConfigWidget *createConfigWidget(Kit *k) const;
|
||||
|
||||
public slots:
|
||||
bool registerKit(ProjectExplorer::Kit *k);
|
||||
void deregisterKit(ProjectExplorer::Kit *k);
|
||||
QList<Task> validateKit(ProjectExplorer::Kit *k);
|
||||
void setDefaultKit(ProjectExplorer::Kit *k);
|
||||
|
||||
void saveKits();
|
||||
|
||||
void registerKitInformation(ProjectExplorer::KitInformation *ki);
|
||||
void deregisterKitInformation(ProjectExplorer::KitInformation *ki);
|
||||
|
||||
signals:
|
||||
void kitAdded(ProjectExplorer::Kit *);
|
||||
// Kit is still valid when this call happens!
|
||||
void kitRemoved(ProjectExplorer::Kit *);
|
||||
// Kit was updated.
|
||||
void kitUpdated(ProjectExplorer::Kit *);
|
||||
// Default kit was changed.
|
||||
void defaultkitChanged();
|
||||
// Something changed.
|
||||
void kitsChanged();
|
||||
|
||||
private slots:
|
||||
void validateKits();
|
||||
|
||||
private:
|
||||
explicit KitManager(QObject *parent = 0);
|
||||
|
||||
// Make sure the this is only called after all
|
||||
// KitInformation are registered!
|
||||
void restoreKits();
|
||||
class KitList
|
||||
{
|
||||
public:
|
||||
KitList()
|
||||
{ }
|
||||
Core::Id defaultKit;
|
||||
QList<Kit *> kits;
|
||||
};
|
||||
KitList restoreKits(const Utils::FileName &fileName);
|
||||
|
||||
void notifyAboutUpdate(ProjectExplorer::Kit *p);
|
||||
void addKit(Kit *k);
|
||||
|
||||
Internal::KitManagerPrivate *const d;
|
||||
|
||||
static KitManager *m_instance;
|
||||
|
||||
friend class Internal::KitManagerPrivate; // for the restoreToolChains methods
|
||||
friend class ProjectExplorerPlugin; // for constructor
|
||||
friend class Kit;
|
||||
friend class Internal::KitModel;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // KITMANAGER_H
|
@@ -28,9 +28,9 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "profilemanagerconfigwidget.h"
|
||||
#include "kitmanagerconfigwidget.h"
|
||||
|
||||
#include "profile.h"
|
||||
#include "kit.h"
|
||||
|
||||
#include <utils/detailswidget.h>
|
||||
|
||||
@@ -46,11 +46,11 @@
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
ProfileManagerConfigWidget::ProfileManagerConfigWidget(Profile *p, QWidget *parent) :
|
||||
ProfileConfigWidget(parent),
|
||||
KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, QWidget *parent) :
|
||||
KitConfigWidget(parent),
|
||||
m_layout(new QGridLayout),
|
||||
m_iconButton(new QToolButton),
|
||||
m_profile(p)
|
||||
m_kit(k)
|
||||
{
|
||||
m_layout->setMargin(0);
|
||||
m_layout->setSpacing(6);
|
||||
@@ -88,35 +88,35 @@ ProfileManagerConfigWidget::ProfileManagerConfigWidget(Profile *p, QWidget *pare
|
||||
connect(m_iconButton, SIGNAL(clicked()), this, SLOT(setIcon()));
|
||||
}
|
||||
|
||||
QString ProfileManagerConfigWidget::displayName() const
|
||||
QString KitManagerConfigWidget::displayName() const
|
||||
{
|
||||
return tr("Targets");
|
||||
return tr("Kits");
|
||||
}
|
||||
|
||||
void ProfileManagerConfigWidget::apply()
|
||||
void KitManagerConfigWidget::apply()
|
||||
{
|
||||
foreach (ProfileConfigWidget *w, m_widgets)
|
||||
foreach (KitConfigWidget *w, m_widgets)
|
||||
w->apply();
|
||||
m_profile->setIconPath(m_iconPath);
|
||||
m_kit->setIconPath(m_iconPath);
|
||||
}
|
||||
|
||||
void ProfileManagerConfigWidget::discard()
|
||||
void KitManagerConfigWidget::discard()
|
||||
{
|
||||
foreach (ProfileConfigWidget *w, m_widgets)
|
||||
foreach (KitConfigWidget *w, m_widgets)
|
||||
w->discard();
|
||||
m_iconButton->setIcon(m_profile->icon());
|
||||
m_iconPath = m_profile->iconPath();
|
||||
m_iconButton->setIcon(m_kit->icon());
|
||||
m_iconPath = m_kit->iconPath();
|
||||
}
|
||||
|
||||
bool ProfileManagerConfigWidget::isDirty() const
|
||||
bool KitManagerConfigWidget::isDirty() const
|
||||
{
|
||||
foreach (ProfileConfigWidget *w, m_widgets)
|
||||
foreach (KitConfigWidget *w, m_widgets)
|
||||
if (w->isDirty())
|
||||
return true;
|
||||
return m_profile->iconPath() != m_iconPath;
|
||||
return m_kit->iconPath() != m_iconPath;
|
||||
}
|
||||
|
||||
void ProfileManagerConfigWidget::addConfigWidget(ProjectExplorer::ProfileConfigWidget *widget)
|
||||
void KitManagerConfigWidget::addConfigWidget(ProjectExplorer::KitConfigWidget *widget)
|
||||
{
|
||||
Q_ASSERT(widget);
|
||||
Q_ASSERT(!m_widgets.contains(widget));
|
||||
@@ -138,14 +138,14 @@ void ProfileManagerConfigWidget::addConfigWidget(ProjectExplorer::ProfileConfigW
|
||||
m_widgets.append(widget);
|
||||
}
|
||||
|
||||
void ProfileManagerConfigWidget::makeReadOnly()
|
||||
void KitManagerConfigWidget::makeReadOnly()
|
||||
{
|
||||
foreach (ProfileConfigWidget *w, m_widgets)
|
||||
foreach (KitConfigWidget *w, m_widgets)
|
||||
w->makeReadOnly();
|
||||
m_iconButton->setEnabled(false);
|
||||
}
|
||||
|
||||
void ProfileManagerConfigWidget::setIcon()
|
||||
void KitManagerConfigWidget::setIcon()
|
||||
{
|
||||
const QString path = QFileDialog::getOpenFileName(0, tr("Select Icon"), m_iconPath, tr("Images (*.png *.xpm *.jpg)"));
|
||||
if (path.isEmpty())
|
@@ -28,10 +28,10 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PROFILEMANAGERWIDGET_H
|
||||
#define PROFILEMANAGERWIDGET_H
|
||||
#ifndef KITMANAGERWIDGET_H
|
||||
#define KITMANAGERWIDGET_H
|
||||
|
||||
#include "profileconfigwidget.h"
|
||||
#include "kitconfigwidget.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QHBoxLayout;
|
||||
@@ -40,23 +40,23 @@ class QToolButton;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class Profile;
|
||||
class Kit;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class ProfileManagerConfigWidget : public ProjectExplorer::ProfileConfigWidget
|
||||
class KitManagerConfigWidget : public ProjectExplorer::KitConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ProfileManagerConfigWidget(Profile *p, QWidget *parent = 0);
|
||||
explicit KitManagerConfigWidget(Kit *k, QWidget *parent = 0);
|
||||
|
||||
QString displayName() const;
|
||||
|
||||
void apply();
|
||||
void discard();
|
||||
bool isDirty() const;
|
||||
void addConfigWidget(ProjectExplorer::ProfileConfigWidget *widget);
|
||||
void addConfigWidget(ProjectExplorer::KitConfigWidget *widget);
|
||||
void makeReadOnly();
|
||||
|
||||
private slots:
|
||||
@@ -65,12 +65,12 @@ private slots:
|
||||
private:
|
||||
QGridLayout *m_layout;
|
||||
QToolButton *m_iconButton;
|
||||
QList<ProfileConfigWidget *> m_widgets;
|
||||
Profile *m_profile;
|
||||
QList<KitConfigWidget *> m_widgets;
|
||||
Kit *m_kit;
|
||||
QString m_iconPath;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // PROFILEMANAGERCONFIGWIDGET_H
|
||||
#endif // KITMANAGERWIDGET_H
|
@@ -28,11 +28,11 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "profilemodel.h"
|
||||
#include "kitmodel.h"
|
||||
|
||||
#include "profile.h"
|
||||
#include "profileconfigwidget.h"
|
||||
#include "profilemanager.h"
|
||||
#include "kit.h"
|
||||
#include "kitconfigwidget.h"
|
||||
#include "kitmanager.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -43,128 +43,128 @@
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
class ProfileNode
|
||||
class KitNode
|
||||
{
|
||||
public:
|
||||
explicit ProfileNode(ProfileNode *pn, Profile *p = 0, bool c = false) :
|
||||
parent(pn), profile(p), changed(c)
|
||||
explicit KitNode(KitNode *pn, Kit *k = 0, bool c = false) :
|
||||
parent(pn), kit(k), changed(c)
|
||||
{
|
||||
if (pn)
|
||||
pn->childNodes.append(this);
|
||||
widget = ProfileManager::instance()->createConfigWidget(p);
|
||||
widget = KitManager::instance()->createConfigWidget(k);
|
||||
if (widget) {
|
||||
if (p && p->isAutoDetected())
|
||||
if (k && k->isAutoDetected())
|
||||
widget->makeReadOnly();
|
||||
widget->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
~ProfileNode()
|
||||
~KitNode()
|
||||
{
|
||||
if (parent)
|
||||
parent->childNodes.removeOne(this);
|
||||
|
||||
// deleting a child removes it from childNodes
|
||||
// so operate on a temporary list
|
||||
QList<ProfileNode *> tmp = childNodes;
|
||||
QList<KitNode *> tmp = childNodes;
|
||||
qDeleteAll(tmp);
|
||||
Q_ASSERT(childNodes.isEmpty());
|
||||
}
|
||||
|
||||
ProfileNode *parent;
|
||||
KitNode *parent;
|
||||
QString newName;
|
||||
QList<ProfileNode *> childNodes;
|
||||
Profile *profile;
|
||||
ProfileConfigWidget *widget;
|
||||
QList<KitNode *> childNodes;
|
||||
Kit *kit;
|
||||
KitConfigWidget *widget;
|
||||
bool changed;
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ProfileModel
|
||||
// KitModel
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
ProfileModel::ProfileModel(QBoxLayout *parentLayout, QObject *parent) :
|
||||
KitModel::KitModel(QBoxLayout *parentLayout, QObject *parent) :
|
||||
QAbstractItemModel(parent),
|
||||
m_parentLayout(parentLayout),
|
||||
m_defaultNode(0)
|
||||
{
|
||||
Q_ASSERT(m_parentLayout);
|
||||
|
||||
connect(ProfileManager::instance(), SIGNAL(profileAdded(ProjectExplorer::Profile*)),
|
||||
this, SLOT(addProfile(ProjectExplorer::Profile*)));
|
||||
connect(ProfileManager::instance(), SIGNAL(profileRemoved(ProjectExplorer::Profile*)),
|
||||
this, SLOT(removeProfile(ProjectExplorer::Profile*)));
|
||||
connect(ProfileManager::instance(), SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
||||
this, SLOT(updateProfile(ProjectExplorer::Profile*)));
|
||||
connect(ProfileManager::instance(), SIGNAL(defaultProfileChanged()),
|
||||
this, SLOT(changeDefaultProfile()));
|
||||
connect(KitManager::instance(), SIGNAL(kitAdded(ProjectExplorer::Kit*)),
|
||||
this, SLOT(addKit(ProjectExplorer::Kit*)));
|
||||
connect(KitManager::instance(), SIGNAL(kitRemoved(ProjectExplorer::Kit*)),
|
||||
this, SLOT(removeKit(ProjectExplorer::Kit*)));
|
||||
connect(KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||
this, SLOT(updateKit(ProjectExplorer::Kit*)));
|
||||
connect(KitManager::instance(), SIGNAL(defaultkitChanged()),
|
||||
this, SLOT(changeDefaultKit()));
|
||||
|
||||
m_root = new ProfileNode(0);
|
||||
m_autoRoot = new ProfileNode(m_root);
|
||||
m_manualRoot = new ProfileNode(m_root);
|
||||
m_root = new KitNode(0);
|
||||
m_autoRoot = new KitNode(m_root);
|
||||
m_manualRoot = new KitNode(m_root);
|
||||
|
||||
foreach (Profile *p, ProfileManager::instance()->profiles())
|
||||
addProfile(p);
|
||||
foreach (Kit *k, KitManager::instance()->kits())
|
||||
addKit(k);
|
||||
|
||||
changeDefaultProfile();
|
||||
changeDefaultKit();
|
||||
}
|
||||
|
||||
ProfileModel::~ProfileModel()
|
||||
KitModel::~KitModel()
|
||||
{
|
||||
delete m_root;
|
||||
}
|
||||
|
||||
QModelIndex ProfileModel::index(int row, int column, const QModelIndex &parent) const
|
||||
QModelIndex KitModel::index(int row, int column, const QModelIndex &parent) const
|
||||
{
|
||||
if (!parent.isValid()) {
|
||||
if (row >= 0 && row < m_root->childNodes.count())
|
||||
return createIndex(row, column, m_root->childNodes.at(row));
|
||||
}
|
||||
ProfileNode *node = static_cast<ProfileNode *>(parent.internalPointer());
|
||||
KitNode *node = static_cast<KitNode *>(parent.internalPointer());
|
||||
if (row < node->childNodes.count() && column == 0)
|
||||
return createIndex(row, column, node->childNodes.at(row));
|
||||
else
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
QModelIndex ProfileModel::parent(const QModelIndex &idx) const
|
||||
QModelIndex KitModel::parent(const QModelIndex &idx) const
|
||||
{
|
||||
if (!idx.isValid())
|
||||
return QModelIndex();
|
||||
ProfileNode *node = static_cast<ProfileNode *>(idx.internalPointer());
|
||||
KitNode *node = static_cast<KitNode *>(idx.internalPointer());
|
||||
if (node->parent == m_root)
|
||||
return QModelIndex();
|
||||
return index(node->parent);
|
||||
}
|
||||
|
||||
int ProfileModel::rowCount(const QModelIndex &parent) const
|
||||
int KitModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
if (!parent.isValid())
|
||||
return m_root->childNodes.count();
|
||||
ProfileNode *node = static_cast<ProfileNode *>(parent.internalPointer());
|
||||
KitNode *node = static_cast<KitNode *>(parent.internalPointer());
|
||||
return node->childNodes.count();
|
||||
}
|
||||
|
||||
int ProfileModel::columnCount(const QModelIndex &parent) const
|
||||
int KitModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
return 1;
|
||||
}
|
||||
|
||||
QVariant ProfileModel::data(const QModelIndex &index, int role) const
|
||||
QVariant KitModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
static QIcon warningIcon(":/projectexplorer/images/compile_warning.png");
|
||||
|
||||
if (!index.isValid() || index.column() != 0)
|
||||
return QVariant();
|
||||
|
||||
ProfileNode *node = static_cast<ProfileNode *>(index.internalPointer());
|
||||
KitNode *node = static_cast<KitNode *>(index.internalPointer());
|
||||
QTC_ASSERT(node, return QVariant());
|
||||
if (node == m_autoRoot && role == Qt::DisplayRole)
|
||||
return tr("Auto-detected");
|
||||
if (node == m_manualRoot && role == Qt::DisplayRole)
|
||||
return tr("Manual");
|
||||
if (node->profile) {
|
||||
if (node->kit) {
|
||||
if (role == Qt::FontRole) {
|
||||
QFont f = QApplication::font();
|
||||
if (node->changed)
|
||||
@@ -173,54 +173,54 @@ QVariant ProfileModel::data(const QModelIndex &index, int role) const
|
||||
f.setItalic(f.style() != QFont::StyleItalic);
|
||||
return f;
|
||||
} else if (role == Qt::DisplayRole) {
|
||||
QString baseName = node->newName.isEmpty() ? node->profile->displayName() : node->newName;
|
||||
QString baseName = node->newName.isEmpty() ? node->kit->displayName() : node->newName;
|
||||
if (node == m_defaultNode)
|
||||
//: Mark up a profile as the default one.
|
||||
//: Mark up a kit as the default one.
|
||||
baseName = tr("%1 (default)").arg(baseName);
|
||||
return baseName;
|
||||
} else if (role == Qt::EditRole) {
|
||||
return node->newName.isEmpty() ? node->profile->displayName() : node->newName;
|
||||
return node->newName.isEmpty() ? node->kit->displayName() : node->newName;
|
||||
} else if (role == Qt::DecorationRole) {
|
||||
return node->profile->isValid() ? QIcon() : warningIcon;
|
||||
return node->kit->isValid() ? QIcon() : warningIcon;
|
||||
} else if (role == Qt::ToolTipRole) {
|
||||
return node->profile->toHtml();
|
||||
return node->kit->toHtml();
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
bool ProfileModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||
bool KitModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||
{
|
||||
if (!index.isValid())
|
||||
return false;
|
||||
|
||||
ProfileNode *node = static_cast<ProfileNode *>(index.internalPointer());
|
||||
KitNode *node = static_cast<KitNode *>(index.internalPointer());
|
||||
Q_ASSERT(node);
|
||||
if (index.column() != 0 || !node->profile || role != Qt::EditRole)
|
||||
if (index.column() != 0 || !node->kit || role != Qt::EditRole)
|
||||
return false;
|
||||
node->newName = value.toString();
|
||||
if (!node->newName.isEmpty() && node->newName != node->profile->displayName())
|
||||
if (!node->newName.isEmpty() && node->newName != node->kit->displayName())
|
||||
node->changed = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
Qt::ItemFlags ProfileModel::flags(const QModelIndex &index) const
|
||||
Qt::ItemFlags KitModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
|
||||
ProfileNode *node = static_cast<ProfileNode *>(index.internalPointer());
|
||||
KitNode *node = static_cast<KitNode *>(index.internalPointer());
|
||||
Q_ASSERT(node);
|
||||
if (!node->profile)
|
||||
if (!node->kit)
|
||||
return Qt::ItemIsEnabled;
|
||||
|
||||
if (node->profile->isAutoDetected())
|
||||
if (node->kit->isAutoDetected())
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
|
||||
}
|
||||
|
||||
QVariant ProfileModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
QVariant KitModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
Q_UNUSED(section);
|
||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
||||
@@ -228,64 +228,64 @@ QVariant ProfileModel::headerData(int section, Qt::Orientation orientation, int
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
Profile *ProfileModel::profile(const QModelIndex &index)
|
||||
Kit *KitModel::kit(const QModelIndex &index)
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
ProfileNode *node = static_cast<ProfileNode *>(index.internalPointer());
|
||||
KitNode *node = static_cast<KitNode *>(index.internalPointer());
|
||||
Q_ASSERT(node);
|
||||
return node->profile;
|
||||
return node->kit;
|
||||
}
|
||||
|
||||
QModelIndex ProfileModel::indexOf(Profile *p) const
|
||||
QModelIndex KitModel::indexOf(Kit *k) const
|
||||
{
|
||||
ProfileNode *n = find(p);
|
||||
KitNode *n = find(k);
|
||||
return n ? index(n) : QModelIndex();
|
||||
}
|
||||
|
||||
void ProfileModel::setDefaultProfile(const QModelIndex &index)
|
||||
void KitModel::setDefaultKit(const QModelIndex &index)
|
||||
{
|
||||
if (!index.isValid())
|
||||
return;
|
||||
ProfileNode *node = static_cast<ProfileNode *>(index.internalPointer());
|
||||
KitNode *node = static_cast<KitNode *>(index.internalPointer());
|
||||
Q_ASSERT(node);
|
||||
if (node->profile)
|
||||
if (node->kit)
|
||||
setDefaultNode(node);
|
||||
}
|
||||
|
||||
bool ProfileModel::isDefaultProfile(const QModelIndex &index)
|
||||
bool KitModel::isDefaultKit(const QModelIndex &index)
|
||||
{
|
||||
return m_defaultNode == static_cast<ProfileNode *>(index.internalPointer());
|
||||
return m_defaultNode == static_cast<KitNode *>(index.internalPointer());
|
||||
}
|
||||
|
||||
ProfileConfigWidget *ProfileModel::widget(const QModelIndex &index)
|
||||
KitConfigWidget *KitModel::widget(const QModelIndex &index)
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
ProfileNode *node = static_cast<ProfileNode *>(index.internalPointer());
|
||||
KitNode *node = static_cast<KitNode *>(index.internalPointer());
|
||||
Q_ASSERT(node);
|
||||
return node->widget;
|
||||
}
|
||||
|
||||
bool ProfileModel::isDirty() const
|
||||
bool KitModel::isDirty() const
|
||||
{
|
||||
foreach (ProfileNode *n, m_manualRoot->childNodes) {
|
||||
foreach (KitNode *n, m_manualRoot->childNodes) {
|
||||
if (n->changed)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ProfileModel::isDirty(Profile *p) const
|
||||
bool KitModel::isDirty(Kit *k) const
|
||||
{
|
||||
ProfileNode *n = find(p);
|
||||
KitNode *n = find(k);
|
||||
return n ? !n->changed : false;
|
||||
}
|
||||
|
||||
void ProfileModel::setDirty()
|
||||
void KitModel::setDirty()
|
||||
{
|
||||
ProfileConfigWidget *w = qobject_cast<ProfileConfigWidget *>(sender());
|
||||
foreach (ProfileNode *n, m_manualRoot->childNodes) {
|
||||
KitConfigWidget *w = qobject_cast<KitConfigWidget *>(sender());
|
||||
foreach (KitNode *n, m_manualRoot->childNodes) {
|
||||
if (n->widget == w) {
|
||||
n->changed = true;
|
||||
emit dataChanged(index(n, 0), index(n, columnCount(QModelIndex())));
|
||||
@@ -293,76 +293,76 @@ void ProfileModel::setDirty()
|
||||
}
|
||||
}
|
||||
|
||||
void ProfileModel::apply()
|
||||
void KitModel::apply()
|
||||
{
|
||||
// Remove unused profiles:
|
||||
QList<ProfileNode *> nodes = m_toRemoveList;
|
||||
foreach (ProfileNode *n, nodes) {
|
||||
// Remove unused kits:
|
||||
QList<KitNode *> nodes = m_toRemoveList;
|
||||
foreach (KitNode *n, nodes) {
|
||||
Q_ASSERT(!n->parent);
|
||||
ProfileManager::instance()->deregisterProfile(n->profile);
|
||||
KitManager::instance()->deregisterKit(n->kit);
|
||||
}
|
||||
Q_ASSERT(m_toRemoveList.isEmpty());
|
||||
|
||||
// Update profiles:
|
||||
foreach (ProfileNode *n, m_manualRoot->childNodes) {
|
||||
// Update kits:
|
||||
foreach (KitNode *n, m_manualRoot->childNodes) {
|
||||
Q_ASSERT(n);
|
||||
Q_ASSERT(n->profile);
|
||||
Q_ASSERT(n->kit);
|
||||
if (n->changed) {
|
||||
ProfileManager::instance()->blockSignals(true);
|
||||
KitManager::instance()->blockSignals(true);
|
||||
if (!n->newName.isEmpty()) {
|
||||
n->profile->setDisplayName(n->newName);
|
||||
n->kit->setDisplayName(n->newName);
|
||||
n->newName.clear();
|
||||
}
|
||||
if (n->widget)
|
||||
n->widget->apply();
|
||||
n->changed = false;
|
||||
|
||||
ProfileManager::instance()->blockSignals(false);
|
||||
ProfileManager::instance()->notifyAboutUpdate(n->profile);
|
||||
KitManager::instance()->blockSignals(false);
|
||||
KitManager::instance()->notifyAboutUpdate(n->kit);
|
||||
emit dataChanged(index(n, 0), index(n, columnCount(QModelIndex())));
|
||||
}
|
||||
}
|
||||
|
||||
// Add new (and already updated) profiles
|
||||
// Add new (and already updated) kits
|
||||
QStringList removedSts;
|
||||
nodes = m_toAddList;
|
||||
foreach (ProfileNode *n, nodes) {
|
||||
if (!ProfileManager::instance()->registerProfile(n->profile))
|
||||
removedSts << n->profile->displayName();
|
||||
foreach (KitNode *n, nodes) {
|
||||
if (!KitManager::instance()->registerKit(n->kit))
|
||||
removedSts << n->kit->displayName();
|
||||
}
|
||||
|
||||
foreach (ProfileNode *n, m_toAddList)
|
||||
markForRemoval(n->profile);
|
||||
foreach (KitNode *n, m_toAddList)
|
||||
markForRemoval(n->kit);
|
||||
|
||||
if (removedSts.count() == 1) {
|
||||
QMessageBox::warning(0,
|
||||
tr("Duplicate Target Detected"),
|
||||
tr("The target<br> %1<br>"
|
||||
tr("Duplicate Kit Detected"),
|
||||
tr("The kit<br> %1<br>"
|
||||
" was already configured. It was not configured again.")
|
||||
.arg(removedSts.at(0)));
|
||||
|
||||
} else if (!removedSts.isEmpty()) {
|
||||
QMessageBox::warning(0,
|
||||
tr("Duplicate Targets Detected"),
|
||||
tr("The following targets were already configured:<br>"
|
||||
tr("Duplicate Kits Detected"),
|
||||
tr("The following kits were already configured:<br>"
|
||||
" %1<br>"
|
||||
"They were not configured again.")
|
||||
.arg(removedSts.join(QLatin1String(",<br> "))));
|
||||
}
|
||||
|
||||
// Set default profile:
|
||||
// Set default kit:
|
||||
if (m_defaultNode)
|
||||
ProfileManager::instance()->setDefaultProfile(m_defaultNode->profile);
|
||||
KitManager::instance()->setDefaultKit(m_defaultNode->kit);
|
||||
}
|
||||
|
||||
void ProfileModel::markForRemoval(Profile *p)
|
||||
void KitModel::markForRemoval(Kit *k)
|
||||
{
|
||||
ProfileNode *node = find(p);
|
||||
KitNode *node = find(k);
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
if (node == m_defaultNode) {
|
||||
ProfileNode *newDefault = 0;
|
||||
KitNode *newDefault = 0;
|
||||
if (!m_autoRoot->childNodes.isEmpty())
|
||||
newDefault = m_autoRoot->childNodes.at(0);
|
||||
else if (!m_manualRoot->childNodes.isEmpty())
|
||||
@@ -374,8 +374,8 @@ void ProfileModel::markForRemoval(Profile *p)
|
||||
m_manualRoot->childNodes.removeOne(node);
|
||||
node->parent = 0;
|
||||
if (m_toAddList.contains(node)) {
|
||||
delete node->profile;
|
||||
node->profile = 0;
|
||||
delete node->kit;
|
||||
node->kit = 0;
|
||||
m_toAddList.removeOne(node);
|
||||
delete node;
|
||||
} else {
|
||||
@@ -384,12 +384,12 @@ void ProfileModel::markForRemoval(Profile *p)
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
void ProfileModel::markForAddition(Profile *p)
|
||||
void KitModel::markForAddition(Kit *k)
|
||||
{
|
||||
int pos = m_manualRoot->childNodes.size();
|
||||
beginInsertRows(index(m_manualRoot), pos, pos);
|
||||
|
||||
ProfileNode *node = createNode(m_manualRoot, p, true);
|
||||
KitNode *node = createNode(m_manualRoot, k, true);
|
||||
m_toAddList.append(node);
|
||||
|
||||
if (!m_defaultNode)
|
||||
@@ -398,7 +398,7 @@ void ProfileModel::markForAddition(Profile *p)
|
||||
endInsertRows();
|
||||
}
|
||||
|
||||
QModelIndex ProfileModel::index(ProfileNode *node, int column) const
|
||||
QModelIndex KitModel::index(KitNode *node, int column) const
|
||||
{
|
||||
if (node->parent == 0) // is root (or was marked for deletion)
|
||||
return QModelIndex();
|
||||
@@ -408,22 +408,22 @@ QModelIndex ProfileModel::index(ProfileNode *node, int column) const
|
||||
return index(node->parent->childNodes.indexOf(node), column, index(node->parent));
|
||||
}
|
||||
|
||||
ProfileNode *ProfileModel::find(Profile *p) const
|
||||
KitNode *KitModel::find(Kit *k) const
|
||||
{
|
||||
foreach (ProfileNode *n, m_autoRoot->childNodes) {
|
||||
if (n->profile == p)
|
||||
foreach (KitNode *n, m_autoRoot->childNodes) {
|
||||
if (n->kit == k)
|
||||
return n;
|
||||
}
|
||||
foreach (ProfileNode *n, m_manualRoot->childNodes) {
|
||||
if (n->profile == p)
|
||||
foreach (KitNode *n, m_manualRoot->childNodes) {
|
||||
if (n->kit == k)
|
||||
return n;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
ProfileNode *ProfileModel::createNode(ProfileNode *parent, Profile *p, bool changed)
|
||||
KitNode *KitModel::createNode(KitNode *parent, Kit *k, bool changed)
|
||||
{
|
||||
ProfileNode *node = new ProfileNode(parent, p, changed);
|
||||
KitNode *node = new KitNode(parent, k, changed);
|
||||
if (node->widget) {
|
||||
node->widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
m_parentLayout->addWidget(node->widget, 10);
|
||||
@@ -433,7 +433,7 @@ ProfileNode *ProfileModel::createNode(ProfileNode *parent, Profile *p, bool chan
|
||||
return node;
|
||||
}
|
||||
|
||||
void ProfileModel::setDefaultNode(ProfileNode *node)
|
||||
void KitModel::setDefaultNode(KitNode *node)
|
||||
{
|
||||
if (m_defaultNode) {
|
||||
QModelIndex idx = index(m_defaultNode);
|
||||
@@ -448,47 +448,47 @@ void ProfileModel::setDefaultNode(ProfileNode *node)
|
||||
}
|
||||
}
|
||||
|
||||
void ProfileModel::addProfile(Profile *p)
|
||||
void KitModel::addKit(Kit *k)
|
||||
{
|
||||
QList<ProfileNode *> nodes = m_toAddList;
|
||||
foreach (ProfileNode *n, nodes) {
|
||||
if (n->profile == p) {
|
||||
QList<KitNode *> nodes = m_toAddList;
|
||||
foreach (KitNode *n, nodes) {
|
||||
if (n->kit == k) {
|
||||
m_toAddList.removeOne(n);
|
||||
// do not delete n: Still used elsewhere!
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ProfileNode *parent = m_manualRoot;
|
||||
if (p->isAutoDetected())
|
||||
KitNode *parent = m_manualRoot;
|
||||
if (k->isAutoDetected())
|
||||
parent = m_autoRoot;
|
||||
int row = parent->childNodes.count();
|
||||
|
||||
beginInsertRows(index(parent), row, row);
|
||||
createNode(parent, p, false);
|
||||
createNode(parent, k, false);
|
||||
endInsertRows();
|
||||
|
||||
emit profileStateChanged();
|
||||
emit kitStateChanged();
|
||||
}
|
||||
|
||||
void ProfileModel::removeProfile(Profile *p)
|
||||
void KitModel::removeKit(Kit *k)
|
||||
{
|
||||
QList<ProfileNode *> nodes = m_toRemoveList;
|
||||
foreach (ProfileNode *n, nodes) {
|
||||
if (n->profile == p) {
|
||||
QList<KitNode *> nodes = m_toRemoveList;
|
||||
foreach (KitNode *n, nodes) {
|
||||
if (n->kit == k) {
|
||||
m_toRemoveList.removeOne(n);
|
||||
delete n;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ProfileNode *parent = m_manualRoot;
|
||||
if (p->isAutoDetected())
|
||||
KitNode *parent = m_manualRoot;
|
||||
if (k->isAutoDetected())
|
||||
parent = m_autoRoot;
|
||||
int row = 0;
|
||||
ProfileNode *node = 0;
|
||||
foreach (ProfileNode *current, parent->childNodes) {
|
||||
if (current->profile == p) {
|
||||
KitNode *node = 0;
|
||||
foreach (KitNode *current, parent->childNodes) {
|
||||
if (current->kit == k) {
|
||||
node = current;
|
||||
break;
|
||||
}
|
||||
@@ -500,13 +500,13 @@ void ProfileModel::removeProfile(Profile *p)
|
||||
delete node;
|
||||
endRemoveRows();
|
||||
|
||||
emit profileStateChanged();
|
||||
emit kitStateChanged();
|
||||
}
|
||||
|
||||
void ProfileModel::updateProfile(Profile *p)
|
||||
void KitModel::updateKit(Kit *k)
|
||||
{
|
||||
ProfileNode *n = find(p);
|
||||
// This can happen if Qt Versions and Profiles are removed simultaneously.
|
||||
KitNode *n = find(k);
|
||||
// This can happen if Qt Versions and kits are removed simultaneously.
|
||||
if (!n)
|
||||
return;
|
||||
if (n->widget)
|
||||
@@ -515,9 +515,9 @@ void ProfileModel::updateProfile(Profile *p)
|
||||
emit dataChanged(idx, idx);
|
||||
}
|
||||
|
||||
void ProfileModel::changeDefaultProfile()
|
||||
void KitModel::changeDefaultKit()
|
||||
{
|
||||
setDefaultNode(find(ProfileManager::instance()->defaultProfile()));
|
||||
setDefaultNode(find(KitManager::instance()->defaultKit()));
|
||||
}
|
||||
|
||||
} // namespace Internal
|
@@ -28,8 +28,8 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PROFILEMODEL_H
|
||||
#define PROFILEMODEL_H
|
||||
#ifndef KITMODEL_H
|
||||
#define KITMODEL_H
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
@@ -42,26 +42,26 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class Profile;
|
||||
class ProfileConfigWidget;
|
||||
class ProfileFactory;
|
||||
class ProfileManager;
|
||||
class Kit;
|
||||
class KitConfigWidget;
|
||||
class KitFactory;
|
||||
class KitManager;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class ProfileNode;
|
||||
class KitNode;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ProfileModel:
|
||||
// KitModel:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class ProfileModel : public QAbstractItemModel
|
||||
class KitModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ProfileModel(QBoxLayout *parentLayout, QObject *parent = 0);
|
||||
~ProfileModel();
|
||||
explicit KitModel(QBoxLayout *parentLayout, QObject *parent = 0);
|
||||
~KitModel();
|
||||
|
||||
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
|
||||
QModelIndex parent(const QModelIndex &index) const;
|
||||
@@ -73,50 +73,50 @@ public:
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
Profile *profile(const QModelIndex &);
|
||||
QModelIndex indexOf(Profile *p) const;
|
||||
Kit *kit(const QModelIndex &);
|
||||
QModelIndex indexOf(Kit *k) const;
|
||||
|
||||
void setDefaultProfile(const QModelIndex &index);
|
||||
bool isDefaultProfile(const QModelIndex &index);
|
||||
void setDefaultKit(const QModelIndex &index);
|
||||
bool isDefaultKit(const QModelIndex &index);
|
||||
|
||||
ProfileConfigWidget *widget(const QModelIndex &);
|
||||
KitConfigWidget *widget(const QModelIndex &);
|
||||
|
||||
bool isDirty() const;
|
||||
bool isDirty(Profile *p) const;
|
||||
bool isDirty(Kit *k) const;
|
||||
|
||||
void apply();
|
||||
|
||||
void markForRemoval(Profile *p);
|
||||
void markForAddition(Profile *p);
|
||||
void markForRemoval(Kit *k);
|
||||
void markForAddition(Kit *k);
|
||||
|
||||
signals:
|
||||
void profileStateChanged();
|
||||
void kitStateChanged();
|
||||
|
||||
private slots:
|
||||
void addProfile(ProjectExplorer::Profile *p);
|
||||
void removeProfile(ProjectExplorer::Profile *p);
|
||||
void updateProfile(ProjectExplorer::Profile *p);
|
||||
void changeDefaultProfile();
|
||||
void addKit(ProjectExplorer::Kit *k);
|
||||
void removeKit(ProjectExplorer::Kit *k);
|
||||
void updateKit(ProjectExplorer::Kit *k);
|
||||
void changeDefaultKit();
|
||||
void setDirty();
|
||||
|
||||
private:
|
||||
QModelIndex index(ProfileNode *, int column = 0) const;
|
||||
ProfileNode *find(Profile *) const;
|
||||
ProfileNode *createNode(ProfileNode *parent, Profile *p, bool changed);
|
||||
void setDefaultNode(ProfileNode *node);
|
||||
QModelIndex index(KitNode *, int column = 0) const;
|
||||
KitNode *find(Kit *k) const;
|
||||
KitNode *createNode(KitNode *parent, Kit *k, bool changed);
|
||||
void setDefaultNode(KitNode *node);
|
||||
|
||||
ProfileNode *m_root;
|
||||
ProfileNode *m_autoRoot;
|
||||
ProfileNode *m_manualRoot;
|
||||
KitNode *m_root;
|
||||
KitNode *m_autoRoot;
|
||||
KitNode *m_manualRoot;
|
||||
|
||||
QList<ProfileNode *> m_toAddList;
|
||||
QList<ProfileNode *> m_toRemoveList;
|
||||
QList<KitNode *> m_toAddList;
|
||||
QList<KitNode *> m_toRemoveList;
|
||||
|
||||
QBoxLayout *m_parentLayout;
|
||||
ProfileNode *m_defaultNode;
|
||||
KitNode *m_defaultNode;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // PROFILEMODEL_H
|
||||
#endif // KITMODEL_H
|
@@ -28,13 +28,13 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "profileoptionspage.h"
|
||||
#include "kitoptionspage.h"
|
||||
|
||||
#include "profilemodel.h"
|
||||
#include "profile.h"
|
||||
#include "kitmodel.h"
|
||||
#include "kit.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "profileconfigwidget.h"
|
||||
#include "profilemanager.h"
|
||||
#include "kitconfigwidget.h"
|
||||
#include "kitmanager.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
@@ -50,28 +50,28 @@
|
||||
namespace ProjectExplorer {
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ProfileOptionsPage:
|
||||
// KitOptionsPage:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
ProfileOptionsPage::ProfileOptionsPage() :
|
||||
KitOptionsPage::KitOptionsPage() :
|
||||
m_model(0), m_selectionModel(0), m_currentWidget(0), m_toShow(0)
|
||||
{
|
||||
setId(Constants::PROFILE_SETTINGS_PAGE_ID);
|
||||
setDisplayName(tr("Targets"));
|
||||
setId(Constants::KITS_SETTINGS_PAGE_ID);
|
||||
setDisplayName(tr("Kits"));
|
||||
setCategory(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY));
|
||||
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
||||
Constants::PROJECTEXPLORER_SETTINGS_TR_CATEGORY));
|
||||
setCategoryIcon(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON));
|
||||
}
|
||||
|
||||
QWidget *ProfileOptionsPage::createPage(QWidget *parent)
|
||||
QWidget *KitOptionsPage::createPage(QWidget *parent)
|
||||
{
|
||||
m_configWidget = new QWidget(parent);
|
||||
|
||||
m_profilesView = new QTreeView(m_configWidget);
|
||||
m_profilesView->setUniformRowHeights(true);
|
||||
m_profilesView->header()->setStretchLastSection(true);
|
||||
m_profilesView->setSizePolicy(m_profilesView->sizePolicy().horizontalPolicy(),
|
||||
m_kitsView = new QTreeView(m_configWidget);
|
||||
m_kitsView->setUniformRowHeights(true);
|
||||
m_kitsView->header()->setStretchLastSection(true);
|
||||
m_kitsView->setSizePolicy(m_kitsView->sizePolicy().horizontalPolicy(),
|
||||
QSizePolicy::Ignored);
|
||||
|
||||
m_addButton = new QPushButton(tr("Add"), m_configWidget);
|
||||
@@ -89,37 +89,37 @@ QWidget *ProfileOptionsPage::createPage(QWidget *parent)
|
||||
buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||
|
||||
QHBoxLayout *horizontalLayout = new QHBoxLayout();
|
||||
horizontalLayout->addWidget(m_profilesView);
|
||||
horizontalLayout->addWidget(m_kitsView);
|
||||
horizontalLayout->addLayout(buttonLayout);
|
||||
|
||||
QVBoxLayout *verticalLayout = new QVBoxLayout(m_configWidget);
|
||||
verticalLayout->addLayout(horizontalLayout);
|
||||
|
||||
Q_ASSERT(!m_model);
|
||||
m_model = new Internal::ProfileModel(verticalLayout);
|
||||
connect(m_model, SIGNAL(profileStateChanged()), this, SLOT(updateState()));
|
||||
m_model = new Internal::KitModel(verticalLayout);
|
||||
connect(m_model, SIGNAL(kitStateChanged()), this, SLOT(updateState()));
|
||||
|
||||
m_profilesView->setModel(m_model);
|
||||
m_profilesView->header()->setResizeMode(0, QHeaderView::Stretch);
|
||||
m_profilesView->expandAll();
|
||||
m_kitsView->setModel(m_model);
|
||||
m_kitsView->header()->setResizeMode(0, QHeaderView::Stretch);
|
||||
m_kitsView->expandAll();
|
||||
|
||||
m_selectionModel = m_profilesView->selectionModel();
|
||||
m_selectionModel = m_kitsView->selectionModel();
|
||||
connect(m_selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||
this, SLOT(profileSelectionChanged()));
|
||||
connect(ProfileManager::instance(), SIGNAL(profileAdded(ProjectExplorer::Profile*)),
|
||||
this, SLOT(profileSelectionChanged()));
|
||||
connect(ProfileManager::instance(), SIGNAL(profileRemoved(ProjectExplorer::Profile*)),
|
||||
this, SLOT(profileSelectionChanged()));
|
||||
connect(ProfileManager::instance(), SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
||||
this, SLOT(profileSelectionChanged()));
|
||||
this, SLOT(kitSelectionChanged()));
|
||||
connect(KitManager::instance(), SIGNAL(kitAdded(ProjectExplorer::Kit*)),
|
||||
this, SLOT(kitSelectionChanged()));
|
||||
connect(KitManager::instance(), SIGNAL(kitRemoved(ProjectExplorer::Kit*)),
|
||||
this, SLOT(kitSelectionChanged()));
|
||||
connect(KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||
this, SLOT(kitSelectionChanged()));
|
||||
|
||||
// Set up add menu:
|
||||
connect(m_addButton, SIGNAL(clicked()), this, SLOT(addNewProfile()));
|
||||
connect(m_cloneButton, SIGNAL(clicked()), this, SLOT(cloneProfile()));
|
||||
connect(m_delButton, SIGNAL(clicked()), this, SLOT(removeProfile()));
|
||||
connect(m_makeDefaultButton, SIGNAL(clicked()), this, SLOT(makeDefaultProfile()));
|
||||
connect(m_addButton, SIGNAL(clicked()), this, SLOT(addNewKit()));
|
||||
connect(m_cloneButton, SIGNAL(clicked()), this, SLOT(cloneKit()));
|
||||
connect(m_delButton, SIGNAL(clicked()), this, SLOT(removeKit()));
|
||||
connect(m_makeDefaultButton, SIGNAL(clicked()), this, SLOT(makeDefaultKit()));
|
||||
|
||||
m_searchKeywords = tr("Targets");
|
||||
m_searchKeywords = tr("Kits");
|
||||
|
||||
updateState();
|
||||
|
||||
@@ -133,13 +133,13 @@ QWidget *ProfileOptionsPage::createPage(QWidget *parent)
|
||||
return m_configWidget;
|
||||
}
|
||||
|
||||
void ProfileOptionsPage::apply()
|
||||
void KitOptionsPage::apply()
|
||||
{
|
||||
if (m_model)
|
||||
m_model->apply();
|
||||
}
|
||||
|
||||
void ProfileOptionsPage::finish()
|
||||
void KitOptionsPage::finish()
|
||||
{
|
||||
if (m_model) {
|
||||
delete m_model;
|
||||
@@ -148,22 +148,22 @@ void ProfileOptionsPage::finish()
|
||||
|
||||
m_configWidget = 0; // deleted by settingsdialog
|
||||
m_selectionModel = 0; // child of m_configWidget
|
||||
m_profilesView = 0; // child of m_configWidget
|
||||
m_kitsView = 0; // child of m_configWidget
|
||||
m_currentWidget = 0; // deleted by the model
|
||||
m_toShow = 0;
|
||||
}
|
||||
|
||||
bool ProfileOptionsPage::matches(const QString &s) const
|
||||
bool KitOptionsPage::matches(const QString &s) const
|
||||
{
|
||||
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
void ProfileOptionsPage::showProfile(Profile *p)
|
||||
void KitOptionsPage::showKit(Kit *k)
|
||||
{
|
||||
m_toShow = p;
|
||||
m_toShow = k;
|
||||
}
|
||||
|
||||
void ProfileOptionsPage::profileSelectionChanged()
|
||||
void KitOptionsPage::kitSelectionChanged()
|
||||
{
|
||||
if (m_currentWidget)
|
||||
m_currentWidget->setVisible(false);
|
||||
@@ -176,63 +176,63 @@ void ProfileOptionsPage::profileSelectionChanged()
|
||||
updateState();
|
||||
}
|
||||
|
||||
void ProfileOptionsPage::addNewProfile()
|
||||
void KitOptionsPage::addNewKit()
|
||||
{
|
||||
Profile *p = new Profile;
|
||||
m_model->markForAddition(p);
|
||||
Kit *k = new Kit;
|
||||
m_model->markForAddition(k);
|
||||
|
||||
QModelIndex newIdx = m_model->indexOf(p);
|
||||
QModelIndex newIdx = m_model->indexOf(k);
|
||||
m_selectionModel->select(newIdx,
|
||||
QItemSelectionModel::Clear
|
||||
| QItemSelectionModel::SelectCurrent
|
||||
| QItemSelectionModel::Rows);
|
||||
}
|
||||
|
||||
void ProfileOptionsPage::cloneProfile()
|
||||
void KitOptionsPage::cloneKit()
|
||||
{
|
||||
Profile *current = m_model->profile(currentIndex());
|
||||
Kit *current = m_model->kit(currentIndex());
|
||||
if (!current)
|
||||
return;
|
||||
|
||||
Profile *p = current->clone();
|
||||
Kit *k = current->clone();
|
||||
|
||||
m_model->markForAddition(p);
|
||||
m_model->markForAddition(k);
|
||||
|
||||
QModelIndex newIdx = m_model->indexOf(p);
|
||||
QModelIndex newIdx = m_model->indexOf(k);
|
||||
m_selectionModel->select(newIdx,
|
||||
QItemSelectionModel::Clear
|
||||
| QItemSelectionModel::SelectCurrent
|
||||
| QItemSelectionModel::Rows);
|
||||
}
|
||||
|
||||
void ProfileOptionsPage::removeProfile()
|
||||
void KitOptionsPage::removeKit()
|
||||
{
|
||||
Profile *p = m_model->profile(currentIndex());
|
||||
if (!p)
|
||||
Kit *k = m_model->kit(currentIndex());
|
||||
if (!k)
|
||||
return;
|
||||
m_model->markForRemoval(p);
|
||||
m_model->markForRemoval(k);
|
||||
}
|
||||
|
||||
void ProfileOptionsPage::makeDefaultProfile()
|
||||
void KitOptionsPage::makeDefaultKit()
|
||||
{
|
||||
m_model->setDefaultProfile(currentIndex());
|
||||
m_model->setDefaultKit(currentIndex());
|
||||
updateState();
|
||||
}
|
||||
|
||||
void ProfileOptionsPage::updateState()
|
||||
void KitOptionsPage::updateState()
|
||||
{
|
||||
if (!m_profilesView)
|
||||
if (!m_kitsView)
|
||||
return;
|
||||
|
||||
bool canCopy = false;
|
||||
bool canDelete = false;
|
||||
bool canMakeDefault = false;
|
||||
QModelIndex index = currentIndex();
|
||||
Profile *p = m_model->profile(index);
|
||||
if (p) {
|
||||
canCopy = p->isValid();
|
||||
canDelete = !p->isAutoDetected();
|
||||
canMakeDefault = !m_model->isDefaultProfile(index);
|
||||
Kit *k = m_model->kit(index);
|
||||
if (k) {
|
||||
canCopy = k->isValid();
|
||||
canDelete = !k->isAutoDetected();
|
||||
canMakeDefault = !m_model->isDefaultKit(index);
|
||||
}
|
||||
|
||||
m_cloneButton->setEnabled(canCopy);
|
||||
@@ -240,7 +240,7 @@ void ProfileOptionsPage::updateState()
|
||||
m_makeDefaultButton->setEnabled(canMakeDefault);
|
||||
}
|
||||
|
||||
QModelIndex ProfileOptionsPage::currentIndex() const
|
||||
QModelIndex KitOptionsPage::currentIndex() const
|
||||
{
|
||||
if (!m_selectionModel)
|
||||
return QModelIndex();
|
@@ -28,8 +28,8 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PROFILEOPTIONSPAGE_H
|
||||
#define PROFILEOPTIONSPAGE_H
|
||||
#ifndef KITOPTIONSPAGE_H
|
||||
#define KITOPTIONSPAGE_H
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
@@ -45,43 +45,43 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
namespace Internal { class ProfileModel; }
|
||||
namespace Internal { class KitModel; }
|
||||
|
||||
class Profile;
|
||||
class ProfileConfigWidget;
|
||||
class ProfileFactory;
|
||||
class ProfileManager;
|
||||
class Kit;
|
||||
class KitConfigWidget;
|
||||
class KitFactory;
|
||||
class KitManager;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ProfileOptionsPage:
|
||||
// KitOptionsPage:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ProfileOptionsPage : public Core::IOptionsPage
|
||||
class PROJECTEXPLORER_EXPORT KitOptionsPage : public Core::IOptionsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ProfileOptionsPage();
|
||||
KitOptionsPage();
|
||||
|
||||
QWidget *createPage(QWidget *parent);
|
||||
void apply();
|
||||
void finish();
|
||||
bool matches(const QString &) const;
|
||||
|
||||
void showProfile(Profile *p);
|
||||
void showKit(Kit *k);
|
||||
|
||||
private slots:
|
||||
void profileSelectionChanged();
|
||||
void addNewProfile();
|
||||
void cloneProfile();
|
||||
void removeProfile();
|
||||
void makeDefaultProfile();
|
||||
void kitSelectionChanged();
|
||||
void addNewKit();
|
||||
void cloneKit();
|
||||
void removeKit();
|
||||
void makeDefaultKit();
|
||||
void updateState();
|
||||
|
||||
private:
|
||||
QModelIndex currentIndex() const;
|
||||
|
||||
QTreeView *m_profilesView;
|
||||
QTreeView *m_kitsView;
|
||||
QPushButton *m_addButton;
|
||||
QPushButton *m_cloneButton;
|
||||
QPushButton *m_delButton;
|
||||
@@ -90,13 +90,13 @@ private:
|
||||
QWidget *m_configWidget;
|
||||
QString m_searchKeywords;
|
||||
|
||||
Internal::ProfileModel *m_model;
|
||||
Internal::KitModel *m_model;
|
||||
QItemSelectionModel *m_selectionModel;
|
||||
QWidget *m_currentWidget;
|
||||
|
||||
Profile *m_toShow;
|
||||
Kit *m_toShow;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // PROFILEOPTIONSPAGE_H
|
||||
#endif // KITOPTIONSPAGE_H
|
@@ -45,7 +45,7 @@
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/deployconfiguration.h>
|
||||
#include <projectexplorer/profilemanager.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/projectmodels.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
@@ -559,7 +559,7 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
|
||||
grid->addWidget(m_separators[PROJECT], 2, 1);
|
||||
|
||||
QStringList titles;
|
||||
titles << tr("Target") << tr("Build")
|
||||
titles << tr("Kit") << tr("Build")
|
||||
<< tr("Deploy") << tr("Run");
|
||||
|
||||
for (int i = TARGET; i < LAST; ++i) {
|
||||
@@ -589,8 +589,8 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
|
||||
this, SLOT(updateActionAndSummary()));
|
||||
|
||||
// for icon changes:
|
||||
connect(ProjectExplorer::ProfileManager::instance(), SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
||||
this, SLOT(profileChanged(ProjectExplorer::Profile*)));
|
||||
connect(ProjectExplorer::KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||
this, SLOT(kitChanged(ProjectExplorer::Kit*)));
|
||||
|
||||
connect(m_listWidgets[TARGET], SIGNAL(changeActiveProjectConfiguration(ProjectExplorer::ProjectConfiguration*)),
|
||||
this, SLOT(setActiveTarget(ProjectExplorer::ProjectConfiguration*)));
|
||||
@@ -994,9 +994,9 @@ void MiniProjectTargetSelector::activeTargetChanged(ProjectExplorer::Target *tar
|
||||
updateActionAndSummary();
|
||||
}
|
||||
|
||||
void MiniProjectTargetSelector::profileChanged(Profile *profile)
|
||||
void MiniProjectTargetSelector::kitChanged(Kit *k)
|
||||
{
|
||||
if (m_target && m_target->profile() == profile)
|
||||
if (m_target && m_target->kit() == k)
|
||||
updateActionAndSummary();
|
||||
}
|
||||
|
||||
@@ -1250,7 +1250,7 @@ void MiniProjectTargetSelector::updateSummary()
|
||||
summary.append(tr("Project: <b>%1</b><br/>").arg(startupProject->displayName()));
|
||||
if (Target *activeTarget = m_sessionManager->startupProject()->activeTarget()) {
|
||||
if (!m_listWidgets[TARGET]->isVisibleTo(this))
|
||||
summary.append(tr("Target: <b>%1</b><br/>").arg( activeTarget->displayName()));
|
||||
summary.append(tr("Kit: <b>%1</b><br/>").arg( activeTarget->displayName()));
|
||||
if (!m_listWidgets[BUILD]->isVisibleTo(this) && activeTarget->activeBuildConfiguration())
|
||||
summary.append(tr("Build: <b>%1</b><br/>").arg(
|
||||
activeTarget->activeBuildConfiguration()->displayName()));
|
||||
|
@@ -41,7 +41,7 @@ class QStackedWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class Profile;
|
||||
class Kit;
|
||||
class Project;
|
||||
class Target;
|
||||
class BuildConfiguration;
|
||||
@@ -134,7 +134,7 @@ private slots:
|
||||
|
||||
void changeStartupProject(ProjectExplorer::Project *project);
|
||||
void activeTargetChanged(ProjectExplorer::Target *target);
|
||||
void profileChanged(ProjectExplorer::Profile *profile);
|
||||
void kitChanged(ProjectExplorer::Kit *k);
|
||||
void activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc);
|
||||
void activeDeployConfigurationChanged(ProjectExplorer::DeployConfiguration *dc);
|
||||
void activeRunConfigurationChanged(ProjectExplorer::RunConfiguration *rc);
|
||||
|
@@ -1,478 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "profilemanager.h"
|
||||
|
||||
#include "profile.h"
|
||||
#include "profileconfigwidget.h"
|
||||
#include "profileinformation.h"
|
||||
#include "profilemanagerconfigwidget.h"
|
||||
#include "project.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <utils/persistentsettings.h>
|
||||
#include <utils/environment.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QSettings>
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
|
||||
static const char PROFILE_DATA_KEY[] = "Profile.";
|
||||
static const char PROFILE_COUNT_KEY[] = "Profile.Count";
|
||||
static const char PROFILE_FILE_VERSION_KEY[] = "Version";
|
||||
static const char PROFILE_DEFAULT_KEY[] = "Profile.Default";
|
||||
static const char PROFILE_FILENAME[] = "/qtcreator/profiles.xml";
|
||||
|
||||
using Utils::PersistentSettingsWriter;
|
||||
using Utils::PersistentSettingsReader;
|
||||
|
||||
static Utils::FileName settingsFileName()
|
||||
{
|
||||
QFileInfo settingsLocation(ExtensionSystem::PluginManager::settings()->fileName());
|
||||
return Utils::FileName::fromString(settingsLocation.absolutePath() + QLatin1String(PROFILE_FILENAME));
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
ProfileManager *ProfileManager::m_instance = 0;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ProfileManagerPrivate:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class ProfileManagerPrivate
|
||||
{
|
||||
public:
|
||||
ProfileManagerPrivate();
|
||||
~ProfileManagerPrivate();
|
||||
QList<Task> validateProfile(Profile *p) const;
|
||||
|
||||
Profile *m_defaultProfile;
|
||||
bool m_initialized;
|
||||
QList<ProfileInformation *> m_informationList;
|
||||
QList<Profile *> m_profileList;
|
||||
Utils::PersistentSettingsWriter *m_writer;
|
||||
};
|
||||
|
||||
ProfileManagerPrivate::ProfileManagerPrivate()
|
||||
: m_defaultProfile(0), m_initialized(false),
|
||||
m_writer(new Utils::PersistentSettingsWriter(settingsFileName(), QLatin1String("QtCreatorProfiles")))
|
||||
{ }
|
||||
|
||||
ProfileManagerPrivate::~ProfileManagerPrivate()
|
||||
{
|
||||
qDeleteAll(m_informationList);
|
||||
qDeleteAll(m_profileList);
|
||||
delete m_writer;
|
||||
}
|
||||
|
||||
QList<Task> ProfileManagerPrivate::validateProfile(Profile *p) const
|
||||
{
|
||||
Q_ASSERT(p);
|
||||
QList<Task> result;
|
||||
bool hasError = false;
|
||||
foreach (ProfileInformation *pi, m_informationList) {
|
||||
QList<Task> tmp = pi->validate(p);
|
||||
foreach (const Task &t, tmp)
|
||||
if (t.type == Task::Error)
|
||||
hasError = true;
|
||||
result << tmp;
|
||||
}
|
||||
p->setValid(!hasError);
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ProfileManager:
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
ProfileManager *ProfileManager::instance()
|
||||
{
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
ProfileManager::ProfileManager(QObject *parent) :
|
||||
QObject(parent),
|
||||
d(new Internal::ProfileManagerPrivate())
|
||||
{
|
||||
Q_ASSERT(!m_instance);
|
||||
m_instance = this;
|
||||
|
||||
connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()),
|
||||
this, SLOT(saveProfiles()));
|
||||
|
||||
connect(this, SIGNAL(profileAdded(ProjectExplorer::Profile*)),
|
||||
this, SIGNAL(profilesChanged()));
|
||||
connect(this, SIGNAL(profileRemoved(ProjectExplorer::Profile*)),
|
||||
this, SIGNAL(profilesChanged()));
|
||||
connect(this, SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
||||
this, SIGNAL(profilesChanged()));
|
||||
}
|
||||
|
||||
void ProfileManager::restoreProfiles()
|
||||
{
|
||||
QList<Profile *> profilesToRegister;
|
||||
QList<Profile *> profilesToCheck;
|
||||
|
||||
// read all profiles from SDK
|
||||
QFileInfo systemSettingsFile(Core::ICore::settings(QSettings::SystemScope)->fileName());
|
||||
ProfileList system = restoreProfiles(Utils::FileName::fromString(systemSettingsFile.absolutePath() + QLatin1String(PROFILE_FILENAME)));
|
||||
QList<Profile *> readProfiles = system.profiles;
|
||||
// make sure we mark these as autodetected!
|
||||
foreach (Profile *p, readProfiles)
|
||||
p->setAutoDetected(true);
|
||||
|
||||
profilesToRegister = readProfiles; // SDK profiles are always considered to be up-to-date, so no need to
|
||||
// recheck them.
|
||||
|
||||
// read all profile chains from user file
|
||||
ProfileList userProfiles = restoreProfiles(settingsFileName());
|
||||
readProfiles = userProfiles.profiles;
|
||||
|
||||
foreach (Profile *p, readProfiles) {
|
||||
if (p->isAutoDetected())
|
||||
profilesToCheck.append(p);
|
||||
else
|
||||
profilesToRegister.append(p);
|
||||
}
|
||||
readProfiles.clear();
|
||||
|
||||
// Then auto create profiles:
|
||||
QList<Profile *> detectedProfiles;
|
||||
|
||||
// Find/update autodetected profiles:
|
||||
Profile *toStore = 0;
|
||||
foreach (Profile *currentDetected, detectedProfiles) {
|
||||
toStore = currentDetected;
|
||||
|
||||
// Check whether we had this profile stored and prefer the old one with the old id:
|
||||
for (int i = 0; i < profilesToCheck.count(); ++i) {
|
||||
if (*(profilesToCheck.at(i)) == *currentDetected) {
|
||||
toStore = profilesToCheck.at(i);
|
||||
profilesToCheck.removeAt(i);
|
||||
delete currentDetected;
|
||||
break;
|
||||
}
|
||||
}
|
||||
addProfile(toStore);
|
||||
}
|
||||
|
||||
// Delete all loaded autodetected profiles that were not rediscovered:
|
||||
qDeleteAll(profilesToCheck);
|
||||
|
||||
// Store manual profiles
|
||||
foreach (Profile *p, profilesToRegister)
|
||||
addProfile(p);
|
||||
|
||||
if (profiles().isEmpty()) {
|
||||
Profile *defaultProfile = new Profile; // One profile using default values
|
||||
defaultProfile->setDisplayName(tr("Desktop"));
|
||||
defaultProfile->setAutoDetected(false);
|
||||
defaultProfile->setIconPath(QLatin1String(":///DESKTOP///"));
|
||||
|
||||
addProfile(defaultProfile);
|
||||
}
|
||||
|
||||
Profile *p = find(userProfiles.defaultProfile);
|
||||
if (p)
|
||||
setDefaultProfile(p);
|
||||
}
|
||||
|
||||
ProfileManager::~ProfileManager()
|
||||
{
|
||||
// Clean out profile information to avoid calling them during deregistration:
|
||||
delete d;
|
||||
m_instance = 0;
|
||||
}
|
||||
|
||||
void ProfileManager::saveProfiles()
|
||||
{
|
||||
if (!d->m_initialized) // ignore save requests while we are not initialized.
|
||||
return;
|
||||
|
||||
QVariantMap data;
|
||||
data.insert(QLatin1String(PROFILE_FILE_VERSION_KEY), 1);
|
||||
|
||||
int count = 0;
|
||||
foreach (Profile *p, profiles()) {
|
||||
QVariantMap tmp = p->toMap();
|
||||
if (tmp.isEmpty())
|
||||
continue;
|
||||
data.insert(QString::fromLatin1(PROFILE_DATA_KEY) + QString::number(count), tmp);
|
||||
++count;
|
||||
}
|
||||
data.insert(QLatin1String(PROFILE_COUNT_KEY), count);
|
||||
data.insert(QLatin1String(PROFILE_DEFAULT_KEY),
|
||||
d->m_defaultProfile ? QString::fromLatin1(d->m_defaultProfile->id().name()) : QString());
|
||||
d->m_writer->save(data, Core::ICore::mainWindow());
|
||||
}
|
||||
|
||||
bool greaterPriority(ProfileInformation *a, ProfileInformation *b)
|
||||
{
|
||||
return a->priority() > b->priority();
|
||||
}
|
||||
|
||||
void ProfileManager::registerProfileInformation(ProfileInformation *pi)
|
||||
{
|
||||
QList<ProfileInformation *>::iterator it
|
||||
= qLowerBound(d->m_informationList.begin(), d->m_informationList.end(), pi, greaterPriority);
|
||||
d->m_informationList.insert(it, pi);
|
||||
|
||||
connect(pi, SIGNAL(validationNeeded()), this, SLOT(validateProfiles()));
|
||||
|
||||
if (!d->m_initialized)
|
||||
return;
|
||||
|
||||
foreach (Profile *p, profiles()) {
|
||||
if (!p->hasValue(pi->dataId()))
|
||||
p->setValue(pi->dataId(), pi->defaultValue(p));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void ProfileManager::deregisterProfileInformation(ProfileInformation *pi)
|
||||
{
|
||||
Q_ASSERT(d->m_informationList.contains(pi));
|
||||
d->m_informationList.removeAll(pi);
|
||||
delete pi;
|
||||
}
|
||||
|
||||
ProfileManager::ProfileList ProfileManager::restoreProfiles(const Utils::FileName &fileName)
|
||||
{
|
||||
ProfileList result;
|
||||
|
||||
PersistentSettingsReader reader;
|
||||
if (!reader.load(fileName))
|
||||
return result;
|
||||
QVariantMap data = reader.restoreValues();
|
||||
|
||||
// Check version:
|
||||
int version = data.value(QLatin1String(PROFILE_FILE_VERSION_KEY), 0).toInt();
|
||||
if (version < 1)
|
||||
return result;
|
||||
|
||||
const int count = data.value(QLatin1String(PROFILE_COUNT_KEY), 0).toInt();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const QString key = QString::fromLatin1(PROFILE_DATA_KEY) + QString::number(i);
|
||||
if (!data.contains(key))
|
||||
break;
|
||||
|
||||
const QVariantMap stMap = data.value(key).toMap();
|
||||
|
||||
Profile *p = new Profile;
|
||||
if (p->fromMap(stMap)) {
|
||||
result.profiles.append(p);
|
||||
} else {
|
||||
delete p;
|
||||
qWarning("Warning: Unable to restore profiles stored in %s at position %d.",
|
||||
qPrintable(fileName.toUserOutput()), i);
|
||||
}
|
||||
}
|
||||
const QString defaultId = data.value(QLatin1String(PROFILE_DEFAULT_KEY)).toString();
|
||||
if (defaultId.isEmpty())
|
||||
return result;
|
||||
|
||||
const Core::Id id = Core::Id(defaultId);
|
||||
foreach (Profile *i, result.profiles) {
|
||||
if (i->id() == id) {
|
||||
result.defaultProfile = id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QList<Profile *> ProfileManager::profiles(const ProfileMatcher *m) const
|
||||
{
|
||||
if (!d->m_initialized) {
|
||||
d->m_initialized = true;
|
||||
const_cast<ProfileManager *>(this)->restoreProfiles();
|
||||
}
|
||||
|
||||
QList<Profile *> result;
|
||||
foreach (Profile *p, d->m_profileList) {
|
||||
if (!m || m->matches(p))
|
||||
result.append(p);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Profile *ProfileManager::find(const Core::Id &id) const
|
||||
{
|
||||
if (!id.isValid())
|
||||
return 0;
|
||||
|
||||
foreach (Profile *p, profiles()) {
|
||||
if (p->id() == id)
|
||||
return p;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Profile *ProfileManager::find(const ProfileMatcher *m) const
|
||||
{
|
||||
QList<Profile *> matched = profiles(m);
|
||||
return matched.isEmpty() ? 0 : matched.first();
|
||||
}
|
||||
|
||||
Profile *ProfileManager::defaultProfile()
|
||||
{
|
||||
if (!d->m_initialized) {
|
||||
d->m_initialized = true;
|
||||
restoreProfiles();
|
||||
}
|
||||
return d->m_defaultProfile;
|
||||
}
|
||||
|
||||
QList<ProfileInformation *> ProfileManager::profileInformation() const
|
||||
{
|
||||
return d->m_informationList;
|
||||
}
|
||||
|
||||
ProfileConfigWidget *ProfileManager::createConfigWidget(Profile *p) const
|
||||
{
|
||||
if (!p)
|
||||
return 0;
|
||||
|
||||
Internal::ProfileManagerConfigWidget *result = new Internal::ProfileManagerConfigWidget(p);
|
||||
foreach (ProfileInformation *pi, d->m_informationList)
|
||||
result->addConfigWidget(pi->createConfigWidget(p));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void ProfileManager::notifyAboutUpdate(ProjectExplorer::Profile *p)
|
||||
{
|
||||
if (!p || !profiles().contains(p))
|
||||
return;
|
||||
d->validateProfile(p);
|
||||
emit profileUpdated(p);
|
||||
}
|
||||
|
||||
bool ProfileManager::registerProfile(ProjectExplorer::Profile *p)
|
||||
{
|
||||
if (!p)
|
||||
return true;
|
||||
foreach (Profile *current, profiles()) {
|
||||
if (p == current)
|
||||
return false;
|
||||
}
|
||||
|
||||
// make sure we have all the information in our profiles:
|
||||
foreach (ProfileInformation *pi, d->m_informationList) {
|
||||
if (!p->hasValue(pi->dataId()))
|
||||
p->setValue(pi->dataId(), pi->defaultValue(p));
|
||||
}
|
||||
|
||||
addProfile(p);
|
||||
emit profileAdded(p);
|
||||
return true;
|
||||
}
|
||||
|
||||
void ProfileManager::deregisterProfile(Profile *p)
|
||||
{
|
||||
if (!p || !profiles().contains(p))
|
||||
return;
|
||||
d->m_profileList.removeOne(p);
|
||||
if (d->m_defaultProfile == p) {
|
||||
QList<Profile *> stList = profiles();
|
||||
Profile *newDefault = 0;
|
||||
foreach (Profile *cur, stList) {
|
||||
if (cur->isValid()) {
|
||||
newDefault = cur;
|
||||
break;
|
||||
}
|
||||
}
|
||||
setDefaultProfile(newDefault);
|
||||
}
|
||||
emit profileRemoved(p);
|
||||
delete p;
|
||||
}
|
||||
|
||||
QList<Task> ProfileManager::validateProfile(Profile *p)
|
||||
{
|
||||
QList<Task> result = d->validateProfile(p);
|
||||
qSort(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void ProfileManager::setDefaultProfile(Profile *p)
|
||||
{
|
||||
if (d->m_defaultProfile == p)
|
||||
return;
|
||||
if (p && !profiles().contains(p))
|
||||
return;
|
||||
d->m_defaultProfile = p;
|
||||
emit defaultProfileChanged();
|
||||
}
|
||||
|
||||
void ProfileManager::validateProfiles()
|
||||
{
|
||||
foreach (Profile *p, profiles())
|
||||
d->validateProfile(p);
|
||||
}
|
||||
|
||||
void ProfileManager::addProfile(Profile *p)
|
||||
{
|
||||
if (!p)
|
||||
return;
|
||||
p->setDisplayName(p->displayName()); // make name unique
|
||||
d->validateProfile(p);
|
||||
d->m_profileList.append(p);
|
||||
if (!d->m_defaultProfile ||
|
||||
(!d->m_defaultProfile->isValid() && p->isValid()))
|
||||
setDefaultProfile(p);
|
||||
}
|
||||
|
||||
|
||||
void ProfileInformation::addToEnvironment(const Profile *p, Utils::Environment &env) const
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
Q_UNUSED(env);
|
||||
}
|
||||
|
||||
QString ProfileInformation::displayNamePostfix(const Profile *p) const
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
return QString();
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
@@ -1,171 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PROFILEMANAGER_H
|
||||
#define PROFILEMANAGER_H
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
#include "task.h"
|
||||
|
||||
#include <coreplugin/id.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QPair>
|
||||
|
||||
namespace Utils { class Environment; }
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class Profile;
|
||||
class ProfileConfigWidget;
|
||||
|
||||
namespace Internal {
|
||||
class ProfileManagerPrivate;
|
||||
class ProfileModel;
|
||||
} // namespace Internal
|
||||
|
||||
/**
|
||||
* @brief The ProfileInformation class
|
||||
*
|
||||
* One piece of information stored in the profile.
|
||||
*
|
||||
* This needs to get registered with the \a ProfileManager.
|
||||
*/
|
||||
class PROJECTEXPLORER_EXPORT ProfileInformation : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
typedef QPair<QString, QString> Item;
|
||||
typedef QList<Item> ItemList;
|
||||
|
||||
virtual Core::Id dataId() const = 0;
|
||||
|
||||
virtual unsigned int priority() const = 0; // the higher the closer to the top.
|
||||
|
||||
virtual bool visibleIn(Profile *) { return true; }
|
||||
virtual QVariant defaultValue(Profile *) const = 0;
|
||||
|
||||
virtual QList<Task> validate(Profile *) const = 0;
|
||||
|
||||
virtual ItemList toUserOutput(Profile *p) const = 0;
|
||||
|
||||
virtual ProfileConfigWidget *createConfigWidget(Profile *) const = 0;
|
||||
|
||||
virtual void addToEnvironment(const Profile *p, Utils::Environment &env) const;
|
||||
|
||||
virtual QString displayNamePostfix(const Profile *p) const;
|
||||
|
||||
signals:
|
||||
void validationNeeded();
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ProfileMatcher
|
||||
{
|
||||
public:
|
||||
virtual ~ProfileMatcher() { }
|
||||
virtual bool matches(const Profile *p) const = 0;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ProfileManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static ProfileManager *instance();
|
||||
~ProfileManager();
|
||||
|
||||
QList<Profile *> profiles(const ProfileMatcher *m = 0) const;
|
||||
Profile *find(const Core::Id &id) const;
|
||||
Profile *find(const ProfileMatcher *m) const;
|
||||
Profile *defaultProfile();
|
||||
|
||||
QList<ProfileInformation *> profileInformation() const;
|
||||
|
||||
ProfileConfigWidget *createConfigWidget(Profile *p) const;
|
||||
|
||||
public slots:
|
||||
bool registerProfile(ProjectExplorer::Profile *p);
|
||||
void deregisterProfile(ProjectExplorer::Profile *p);
|
||||
QList<Task> validateProfile(ProjectExplorer::Profile *p);
|
||||
void setDefaultProfile(ProjectExplorer::Profile *p);
|
||||
|
||||
void saveProfiles();
|
||||
|
||||
void registerProfileInformation(ProjectExplorer::ProfileInformation *pi);
|
||||
void deregisterProfileInformation(ProjectExplorer::ProfileInformation *pi);
|
||||
|
||||
signals:
|
||||
void profileAdded(ProjectExplorer::Profile *);
|
||||
// Profile is still valid when this call happens!
|
||||
void profileRemoved(ProjectExplorer::Profile *);
|
||||
// Profile was updated.
|
||||
void profileUpdated(ProjectExplorer::Profile *);
|
||||
// Default profile was changed.
|
||||
void defaultProfileChanged();
|
||||
// Something changed.
|
||||
void profilesChanged();
|
||||
|
||||
private slots:
|
||||
void validateProfiles();
|
||||
|
||||
private:
|
||||
explicit ProfileManager(QObject *parent = 0);
|
||||
|
||||
// Make sure the this is only called after all
|
||||
// ProfileInformation are registered!
|
||||
void restoreProfiles();
|
||||
class ProfileList
|
||||
{
|
||||
public:
|
||||
ProfileList()
|
||||
{ }
|
||||
Core::Id defaultProfile;
|
||||
QList<Profile *> profiles;
|
||||
};
|
||||
ProfileList restoreProfiles(const Utils::FileName &fileName);
|
||||
|
||||
void notifyAboutUpdate(ProjectExplorer::Profile *p);
|
||||
void addProfile(Profile *p);
|
||||
|
||||
Internal::ProfileManagerPrivate *const d;
|
||||
|
||||
static ProfileManager *m_instance;
|
||||
|
||||
friend class Internal::ProfileManagerPrivate; // for the restoreToolChains methods
|
||||
friend class ProjectExplorerPlugin; // for constructor
|
||||
friend class Profile;
|
||||
friend class Internal::ProfileModel;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // PROFILEMANAGER_H
|
@@ -45,8 +45,8 @@
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <projectexplorer/buildmanager.h>
|
||||
#include <projectexplorer/profile.h>
|
||||
#include <projectexplorer/profilemanager.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <limits>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -150,7 +150,7 @@ void Project::changeBuildConfigurationEnabled()
|
||||
void Project::addTarget(Target *t)
|
||||
{
|
||||
QTC_ASSERT(t && !d->m_targets.contains(t), return);
|
||||
QTC_ASSERT(!target(t->profile()), return);
|
||||
QTC_ASSERT(!target(t->kit()), return);
|
||||
Q_ASSERT(t->project() == this);
|
||||
|
||||
// Check that we don't have a configuration with the same displayName
|
||||
@@ -234,27 +234,27 @@ Target *Project::target(const Core::Id id) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
Target *Project::target(Profile *p) const
|
||||
Target *Project::target(Kit *k) const
|
||||
{
|
||||
foreach (Target *target, d->m_targets) {
|
||||
if (target->profile() == p)
|
||||
if (target->kit() == k)
|
||||
return target;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Project::supportsProfile(Profile *p) const
|
||||
bool Project::supportsKit(Kit *k) const
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
Q_UNUSED(k);
|
||||
return true;
|
||||
}
|
||||
|
||||
Target *Project::createTarget(Profile *p)
|
||||
Target *Project::createTarget(Kit *k)
|
||||
{
|
||||
if (!p || target(p))
|
||||
if (!k || target(k))
|
||||
return 0;
|
||||
|
||||
Target *t = new Target(this, p);
|
||||
Target *t = new Target(this, k);
|
||||
t->createDefaultSetup();
|
||||
|
||||
return t;
|
||||
@@ -269,13 +269,13 @@ Target *Project::restoreTarget(const QVariantMap &data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
Profile *p = ProfileManager::instance()->find(id);
|
||||
if (!p) {
|
||||
Kit *k = KitManager::instance()->find(id);
|
||||
if (!k) {
|
||||
qWarning("Warning: No profile '%s' found. Continuing.", qPrintable(id.toString()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
Target *t = new Target(this, p);
|
||||
Target *t = new Target(this, k);
|
||||
if (!t->fromMap(data)) {
|
||||
delete t;
|
||||
return 0;
|
||||
@@ -339,11 +339,11 @@ QString Project::projectDirectory() const
|
||||
return projectDirectory(document()->fileName());
|
||||
}
|
||||
|
||||
QString Project::projectDirectory(const QString &proFile)
|
||||
QString Project::projectDirectory(const QString &top)
|
||||
{
|
||||
if (proFile.isEmpty())
|
||||
if (top.isEmpty())
|
||||
return QString();
|
||||
QFileInfo info(proFile);
|
||||
QFileInfo info(top);
|
||||
return info.absoluteDir().path();
|
||||
}
|
||||
|
||||
|
@@ -50,7 +50,7 @@ class BuildConfigWidget;
|
||||
class IProjectManager;
|
||||
class EditorConfiguration;
|
||||
class ProjectNode;
|
||||
class Profile;
|
||||
class Kit;
|
||||
class Target;
|
||||
class ProjectPrivate;
|
||||
|
||||
@@ -89,10 +89,10 @@ public:
|
||||
Target *activeTarget() const;
|
||||
void setActiveTarget(Target *target);
|
||||
Target *target(const Core::Id id) const;
|
||||
Target *target(Profile *p) const;
|
||||
virtual bool supportsProfile(Profile *p) const;
|
||||
Target *target(Kit *k) const;
|
||||
virtual bool supportsKit(Kit *k) const;
|
||||
|
||||
Target *createTarget(Profile *p);
|
||||
Target *createTarget(Kit *k);
|
||||
Target *restoreTarget(const QVariantMap &data);
|
||||
|
||||
void saveSettings();
|
||||
@@ -111,9 +111,9 @@ public:
|
||||
|
||||
virtual QVariantMap toMap() const;
|
||||
|
||||
// The directory that holds the project file. This includes the absolute path.
|
||||
// The directory that holds the project. This includes the absolute path.
|
||||
QString projectDirectory() const;
|
||||
static QString projectDirectory(const QString &proFile);
|
||||
static QString projectDirectory(const QString &top);
|
||||
|
||||
virtual Core::Context projectContext() const;
|
||||
virtual Core::Context projectLanguage() const;
|
||||
|
@@ -36,8 +36,8 @@
|
||||
#include "gcctoolchainfactories.h"
|
||||
#include "project.h"
|
||||
#include "projectexplorersettings.h"
|
||||
#include "profilemanager.h"
|
||||
#include "profileoptionspage.h"
|
||||
#include "kitmanager.h"
|
||||
#include "kitoptionspage.h"
|
||||
#include "target.h"
|
||||
#include "targetsettingspanel.h"
|
||||
#include "toolchainmanager.h"
|
||||
@@ -64,7 +64,7 @@
|
||||
#include "processstep.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "customwizard.h"
|
||||
#include "profileinformation.h"
|
||||
#include "kitinformation.h"
|
||||
#include "projectfilewizardextension.h"
|
||||
#include "projecttreewidget.h"
|
||||
#include "projectwindow.h"
|
||||
@@ -244,7 +244,7 @@ struct ProjectExplorerPluginPrivate {
|
||||
Core::IMode *m_projectsMode;
|
||||
|
||||
TaskHub *m_taskHub;
|
||||
ProfileManager *m_profileManager;
|
||||
KitManager *m_kitManager;
|
||||
ToolChainManager *m_toolChainManager;
|
||||
bool m_shuttingDown;
|
||||
};
|
||||
@@ -255,7 +255,7 @@ ProjectExplorerPluginPrivate::ProjectExplorerPluginPrivate() :
|
||||
m_delayedRunConfiguration(0),
|
||||
m_runMode(NoRunMode),
|
||||
m_projectsMode(0),
|
||||
m_profileManager(0),
|
||||
m_kitManager(0),
|
||||
m_toolChainManager(0),
|
||||
m_shuttingDown(false)
|
||||
{
|
||||
@@ -297,7 +297,7 @@ ProjectExplorerPlugin::~ProjectExplorerPlugin()
|
||||
delete d->m_welcomePage;
|
||||
removeObject(this);
|
||||
// Force sequence of deletion:
|
||||
delete d->m_profileManager; // remove all the profile informations
|
||||
delete d->m_kitManager; // remove all the profile informations
|
||||
delete d->m_toolChainManager;
|
||||
|
||||
delete d;
|
||||
@@ -340,10 +340,10 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
|
||||
addAutoReleasedObject(new Internal::DesktopDeviceFactory);
|
||||
|
||||
d->m_profileManager = new ProfileManager; // register before ToolChainManager
|
||||
d->m_kitManager = new KitManager; // register before ToolChainManager
|
||||
d->m_toolChainManager = new ToolChainManager;
|
||||
addAutoReleasedObject(new Internal::ToolChainOptionsPage);
|
||||
addAutoReleasedObject(new ProfileOptionsPage);
|
||||
addAutoReleasedObject(new KitOptionsPage);
|
||||
|
||||
d->m_taskHub = new TaskHub;
|
||||
addAutoReleasedObject(d->m_taskHub);
|
||||
@@ -869,7 +869,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
|
||||
d->m_projectSelectorActionMenu = new QAction(this);
|
||||
d->m_projectSelectorActionMenu->setEnabled(false);
|
||||
d->m_projectSelectorActionMenu->setText(tr("Open Build/Run Target Selector..."));
|
||||
d->m_projectSelectorActionMenu->setText(tr("Open Build and Run Kit Selector..."));
|
||||
connect(d->m_projectSelectorActionMenu, SIGNAL(triggered()), d->m_targetSelector, SLOT(toggleVisible()));
|
||||
cmd = Core::ActionManager::registerAction(d->m_projectSelectorActionMenu, ProjectExplorer::Constants::SELECTTARGET,
|
||||
globalcontext);
|
||||
@@ -1104,10 +1104,10 @@ void ProjectExplorerPlugin::extensionsInitialized()
|
||||
|
||||
// Register ProfileInformation:
|
||||
// Only do this now to make sure all device factories were properly initialized.
|
||||
ProfileManager::instance()->registerProfileInformation(new SysRootProfileInformation);
|
||||
ProfileManager::instance()->registerProfileInformation(new DeviceProfileInformation);
|
||||
ProfileManager::instance()->registerProfileInformation(new DeviceTypeProfileInformation);
|
||||
ProfileManager::instance()->registerProfileInformation(new ToolChainProfileInformation);
|
||||
KitManager::instance()->registerKitInformation(new SysRootKitInformation);
|
||||
KitManager::instance()->registerKitInformation(new DeviceKitInformation);
|
||||
KitManager::instance()->registerKitInformation(new DeviceTypeKitInformation);
|
||||
KitManager::instance()->registerKitInformation(new ToolChainKitInformation);
|
||||
|
||||
DeviceManager *dm = DeviceManager::instance();
|
||||
if (dm->find(Core::Id(Constants::DESKTOP_DEVICE_ID)).isNull())
|
||||
|
@@ -20,15 +20,15 @@ HEADERS += projectexplorer.h \
|
||||
gcctoolchain.h \
|
||||
projectexplorer_export.h \
|
||||
projectwindow.h \
|
||||
profile.h \
|
||||
profilechooser.h \
|
||||
profileconfigwidget.h \
|
||||
profileinformation.h \
|
||||
profileinformationconfigwidget.h \
|
||||
profilemanager.h \
|
||||
profilemanagerconfigwidget.h \
|
||||
profilemodel.h \
|
||||
profileoptionspage.h \
|
||||
kit.h \
|
||||
kitchooser.h \
|
||||
kitconfigwidget.h \
|
||||
kitinformation.h \
|
||||
kitinformationconfigwidget.h \
|
||||
kitmanager.h \
|
||||
kitmanagerconfigwidget.h \
|
||||
kitmodel.h \
|
||||
kitoptionspage.h \
|
||||
buildmanager.h \
|
||||
buildsteplist.h \
|
||||
compileoutputwindow.h \
|
||||
@@ -139,14 +139,14 @@ SOURCES += projectexplorer.cpp \
|
||||
clangparser.cpp \
|
||||
gcctoolchain.cpp \
|
||||
projectwindow.cpp \
|
||||
profile.cpp \
|
||||
profilechooser.cpp \
|
||||
profileinformation.cpp \
|
||||
profileinformationconfigwidget.cpp \
|
||||
profilemanager.cpp \
|
||||
profilemanagerconfigwidget.cpp \
|
||||
profilemodel.cpp \
|
||||
profileoptionspage.cpp \
|
||||
kit.cpp \
|
||||
kitchooser.cpp \
|
||||
kitinformation.cpp \
|
||||
kitinformationconfigwidget.cpp \
|
||||
kitmanager.cpp \
|
||||
kitmanagerconfigwidget.cpp \
|
||||
kitmodel.cpp \
|
||||
kitoptionspage.cpp \
|
||||
buildmanager.cpp \
|
||||
buildsteplist.cpp \
|
||||
compileoutputwindow.cpp \
|
||||
|
@@ -107,23 +107,23 @@ QtcPlugin {
|
||||
"processparameters.h",
|
||||
"processstep.cpp",
|
||||
"processstep.h",
|
||||
"profile.cpp",
|
||||
"profile.h",
|
||||
"profilechooser.cpp",
|
||||
"profilechooser.h",
|
||||
"profileconfigwidget.h",
|
||||
"profileinformation.cpp",
|
||||
"profileinformation.h",
|
||||
"profileinformationconfigwidget.cpp",
|
||||
"profileinformationconfigwidget.h",
|
||||
"profilemanager.cpp",
|
||||
"profilemanager.h",
|
||||
"profilemanagerconfigwidget.cpp",
|
||||
"profilemanagerconfigwidget.h",
|
||||
"profilemodel.cpp",
|
||||
"profilemodel.h",
|
||||
"profileoptionspage.cpp",
|
||||
"profileoptionspage.h",
|
||||
"kit.cpp",
|
||||
"kit.h",
|
||||
"kitchooser.cpp",
|
||||
"kitchooser.h",
|
||||
"kitconfigwidget.h",
|
||||
"kitinformation.cpp",
|
||||
"kitinformation.h",
|
||||
"kitinformationconfigwidget.cpp",
|
||||
"kitinformationconfigwidget.h",
|
||||
"kitmanager.cpp",
|
||||
"kitmanager.h",
|
||||
"kitmanagerconfigwidget.cpp",
|
||||
"kitmanagerconfigwidget.h",
|
||||
"kitmodel.cpp",
|
||||
"kitmodel.h",
|
||||
"kitoptionspage.cpp",
|
||||
"kitoptionspage.h",
|
||||
"project.cpp",
|
||||
"project.h",
|
||||
"projectconfiguration.cpp",
|
||||
|
@@ -180,7 +180,7 @@ const char PROJECTEXPLORER_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("ProjectEx
|
||||
const char PROJECTEXPLORER_SETTINGS_CATEGORY_ICON[] = ":/core/images/category_buildrun.png";
|
||||
const char PROJECTEXPLORER_SETTINGS_ID[] = "A.ProjectExplorer.ProjectExplorer";
|
||||
const char TOOLCHAIN_SETTINGS_PAGE_ID[] = "M.ProjectExplorer.ToolChainOptions";
|
||||
const char PROFILE_SETTINGS_PAGE_ID[] = "D.ProjectExplorer.ProfileOptions";
|
||||
const char KITS_SETTINGS_PAGE_ID[] = "D.ProjectExplorer.KitsOptions";
|
||||
|
||||
// Device settings page
|
||||
const char DEVICE_SETTINGS_CATEGORY[] = "X.Devices";
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "doubletabwidget.h"
|
||||
|
||||
#include "profilemanager.h"
|
||||
#include "kitmanager.h"
|
||||
#include "project.h"
|
||||
#include "projectexplorer.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
@@ -261,7 +261,7 @@ ProjectWindow::~ProjectWindow()
|
||||
|
||||
void ProjectWindow::extensionsInitialized()
|
||||
{
|
||||
connect(ProfileManager::instance(), SIGNAL(profilesChanged()), this, SLOT(handleProfilesChanges()));
|
||||
connect(KitManager::instance(), SIGNAL(kitsChanged()), this, SLOT(handleKitChanges()));
|
||||
}
|
||||
|
||||
void ProjectWindow::aboutToShutdown()
|
||||
@@ -288,7 +288,7 @@ void ProjectWindow::projectUpdated(Project *p)
|
||||
m_tabWidget->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
void ProjectWindow::handleProfilesChanges()
|
||||
void ProjectWindow::handleKitChanges()
|
||||
{
|
||||
bool changed = false;
|
||||
int index = m_tabWidget->currentIndex();
|
||||
@@ -330,7 +330,7 @@ void ProjectWindow::registerProject(ProjectExplorer::Project *project)
|
||||
m_hasTarget.insert(project, projectHasTarget);
|
||||
|
||||
if (projectHasTarget) // Use the Targets page
|
||||
subtabs << QCoreApplication::translate("TargetSettingsPanelFactory", "Targets");
|
||||
subtabs << QCoreApplication::translate("TargetSettingsPanelFactory", "Build & Run");
|
||||
|
||||
// Add the project specific pages
|
||||
QList<IProjectPanelFactory *> factories = ExtensionSystem::PluginManager::getObjects<IProjectPanelFactory>();
|
||||
|
@@ -85,7 +85,7 @@ public slots:
|
||||
void projectUpdated(ProjectExplorer::Project *p);
|
||||
|
||||
private slots:
|
||||
void handleProfilesChanges();
|
||||
void handleKitChanges();
|
||||
void showProperties(int index, int subIndex);
|
||||
void registerProject(ProjectExplorer::Project*);
|
||||
void deregisterProject(ProjectExplorer::Project*);
|
||||
|
@@ -36,7 +36,7 @@
|
||||
#include "abi.h"
|
||||
#include "buildconfiguration.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "profileinformation.h"
|
||||
#include "kitinformation.h"
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -357,7 +357,7 @@ ProjectExplorer::Abi RunConfiguration::abi() const
|
||||
BuildConfiguration *bc = target()->activeBuildConfiguration();
|
||||
if (!bc)
|
||||
return Abi::hostAbi();
|
||||
ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile());
|
||||
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
|
||||
if (!tc)
|
||||
return Abi::hostAbi();
|
||||
return tc->targetAbi();
|
||||
|
@@ -37,8 +37,8 @@
|
||||
#include "projectexplorersettings.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "target.h"
|
||||
#include "profile.h"
|
||||
#include "profilemanager.h"
|
||||
#include "kit.h"
|
||||
#include "kitmanager.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
@@ -361,10 +361,10 @@ public:
|
||||
QVariantMap update(Project *project, const QVariantMap &map);
|
||||
|
||||
private:
|
||||
Profile *uniqueProfile(Profile *p);
|
||||
void addBuildConfiguration(Profile *p, const QVariantMap &bc, int bcPos, int bcCount);
|
||||
void addDeployConfiguration(Profile *p, const QVariantMap &dc, int dcPos, int dcActive);
|
||||
void addRunConfigurations(Profile *p,
|
||||
Kit *uniqueProfile(Kit *p);
|
||||
void addBuildConfiguration(Kit *p, const QVariantMap &bc, int bcPos, int bcCount);
|
||||
void addDeployConfiguration(Kit *p, const QVariantMap &dc, int dcPos, int dcActive);
|
||||
void addRunConfigurations(Kit *p,
|
||||
const QMap<int, QVariantMap> &rcs, int activeRc, const QString &projectDir);
|
||||
|
||||
void parseQtversionFile();
|
||||
@@ -383,7 +383,7 @@ private:
|
||||
QHash<QString, ToolChainExtraData> m_toolChainExtras;
|
||||
QHash<int, QString> m_qtVersionExtras;
|
||||
|
||||
QHash<Profile *, QVariantMap> m_targets;
|
||||
QHash<Kit *, QVariantMap> m_targets;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@@ -2225,11 +2225,11 @@ Version11Handler::Version11Handler()
|
||||
|
||||
Version11Handler::~Version11Handler()
|
||||
{
|
||||
ProfileManager *pm = ProfileManager::instance();
|
||||
KitManager *pm = KitManager::instance();
|
||||
if (!pm) // Can happen during teardown!
|
||||
return;
|
||||
QList<Profile *> knownProfiles = pm->profiles();
|
||||
foreach (Profile *p, m_targets.keys()) {
|
||||
QList<Kit *> knownProfiles = pm->kits();
|
||||
foreach (Kit *p, m_targets.keys()) {
|
||||
if (!knownProfiles.contains(p))
|
||||
delete p;
|
||||
}
|
||||
@@ -2248,8 +2248,8 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
||||
parseToolChainFile();
|
||||
|
||||
QVariantMap result;
|
||||
ProfileManager *pm = ProfileManager::instance();
|
||||
foreach (Profile *p, pm->profiles())
|
||||
KitManager *pm = KitManager::instance();
|
||||
foreach (Kit *p, pm->kits())
|
||||
m_targets.insert(p, QVariantMap());
|
||||
|
||||
QMapIterator<QString, QVariant> globalIt(map);
|
||||
@@ -2317,13 +2317,13 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
||||
const QString oldTargetId = extraTargetData.value(QLatin1String("ProjectExplorer.ProjectConfiguration.Id")).toString();
|
||||
|
||||
// Check each BCs/DCs and create profiles as needed
|
||||
static Profile rawProfile; // Do not needlessly use Core::Ids
|
||||
static Kit rawProfile; // Do not needlessly use Core::Ids
|
||||
QMapIterator<int, QVariantMap> buildIt(bcs);
|
||||
while (buildIt.hasNext()) {
|
||||
buildIt.next();
|
||||
int bcPos = buildIt.key();
|
||||
const QVariantMap &bc = buildIt.value();
|
||||
Profile *tmpProfile = &rawProfile;
|
||||
Kit *tmpProfile = &rawProfile;
|
||||
|
||||
if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.AndroidDeviceTarget")) {
|
||||
tmpProfile->setIconPath(QLatin1String(":/android/images/QtAndroid.png"));
|
||||
@@ -2404,7 +2404,7 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
||||
// Set display name last:
|
||||
tmpProfile->setDisplayName(extraTargetData.value(QLatin1String("ProjectExplorer.ProjectConfiguration.DisplayName")).toString());
|
||||
|
||||
Profile *p = uniqueProfile(tmpProfile);
|
||||
Kit *p = uniqueProfile(tmpProfile);
|
||||
|
||||
addBuildConfiguration(p, bc, bcPos, activeBc);
|
||||
addDeployConfiguration(p, dc, dcPos, activeDc);
|
||||
@@ -2417,12 +2417,12 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
||||
|
||||
int newPos = 0;
|
||||
// Generate new target data:
|
||||
foreach (Profile *p, m_targets.keys()) {
|
||||
foreach (Kit *p, m_targets.keys()) {
|
||||
QVariantMap data = m_targets.value(p);
|
||||
if (data.isEmpty())
|
||||
continue;
|
||||
|
||||
pm->registerProfile(p);
|
||||
pm->registerKit(p);
|
||||
|
||||
data.insert(QLatin1String("ProjectExplorer.ProjectConfiguration.Id"), p->id().name());
|
||||
data.insert(QLatin1String("ProjectExplorer.Target.Profile"), p->id().name());
|
||||
@@ -2439,7 +2439,7 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
||||
return result;
|
||||
}
|
||||
|
||||
Profile *Version11Handler::uniqueProfile(Profile *p)
|
||||
Kit *Version11Handler::uniqueProfile(Kit *p)
|
||||
{
|
||||
const QString tc = p->value(Core::Id("PE.Profile.ToolChain")).toString();
|
||||
const int qt = p->value(Core::Id("QtSupport.QtInformation")).toInt();
|
||||
@@ -2449,7 +2449,7 @@ Profile *Version11Handler::uniqueProfile(Profile *p)
|
||||
const QString device = p->value(Core::Id("PE.Profile.Device")).toString();
|
||||
const QString sysroot = p->value(Core::Id("PE.Profile.SysRoot")).toString();
|
||||
|
||||
foreach (Profile *i, m_targets.keys()) {
|
||||
foreach (Kit *i, m_targets.keys()) {
|
||||
const QString currentTc = i->value(Core::Id("PE.Profile.ToolChain")).toString();
|
||||
const int currentQt = i->value(Core::Id("QtSupport.QtInformation")).toInt();
|
||||
const QString currentDebugger = i->value(Core::Id("Debugger.Information")).toString();
|
||||
@@ -2472,7 +2472,7 @@ Profile *Version11Handler::uniqueProfile(Profile *p)
|
||||
return p->clone(true);
|
||||
}
|
||||
|
||||
void Version11Handler::addBuildConfiguration(Profile *p, const QVariantMap &bc, int bcPos, int bcActive)
|
||||
void Version11Handler::addBuildConfiguration(Kit *p, const QVariantMap &bc, int bcPos, int bcActive)
|
||||
{
|
||||
QVariantMap merged = m_targets.value(p);
|
||||
int internalCount = merged.value(QLatin1String("ProjectExplorer.Target.BuildConfigurationCount"), 0).toInt();
|
||||
@@ -2493,7 +2493,7 @@ void Version11Handler::addBuildConfiguration(Profile *p, const QVariantMap &bc,
|
||||
m_targets.insert(p, merged);
|
||||
}
|
||||
|
||||
void Version11Handler::addDeployConfiguration(Profile *p, const QVariantMap &dc, int dcPos, int dcActive)
|
||||
void Version11Handler::addDeployConfiguration(Kit *p, const QVariantMap &dc, int dcPos, int dcActive)
|
||||
{
|
||||
QVariantMap merged = m_targets.value(p);
|
||||
int internalCount = merged.value(QLatin1String("ProjectExplorer.Target.DeployConfigurationCount"), 0).toInt();
|
||||
@@ -2514,7 +2514,7 @@ void Version11Handler::addDeployConfiguration(Profile *p, const QVariantMap &dc,
|
||||
m_targets.insert(p, merged);
|
||||
}
|
||||
|
||||
void Version11Handler::addRunConfigurations(Profile *p,
|
||||
void Version11Handler::addRunConfigurations(Kit *p,
|
||||
const QMap<int, QVariantMap> &rcs, int activeRc,
|
||||
const QString &projectDir)
|
||||
{
|
||||
|
@@ -32,9 +32,9 @@
|
||||
|
||||
#include "buildtargetinfo.h"
|
||||
#include "deploymentdata.h"
|
||||
#include "profile.h"
|
||||
#include "profileinformation.h"
|
||||
#include "profilemanager.h"
|
||||
#include "kit.h"
|
||||
#include "kitinformation.h"
|
||||
#include "kitmanager.h"
|
||||
#include "buildconfiguration.h"
|
||||
#include "deployconfiguration.h"
|
||||
#include "project.h"
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
QPixmap m_readyToUsePixmap;
|
||||
QPixmap m_disconnectedPixmap;
|
||||
|
||||
Profile *m_profile;
|
||||
Kit *m_profile;
|
||||
};
|
||||
|
||||
TargetPrivate::TargetPrivate() :
|
||||
@@ -119,7 +119,7 @@ QList<DeployConfigurationFactory *> TargetPrivate::deployFactories() const
|
||||
return ExtensionSystem::PluginManager::getObjects<DeployConfigurationFactory>();
|
||||
}
|
||||
|
||||
Target::Target(Project *project, Profile *p) :
|
||||
Target::Target(Project *project, Kit *p) :
|
||||
ProjectConfiguration(project, p->id()),
|
||||
d(new TargetPrivate)
|
||||
{
|
||||
@@ -130,11 +130,11 @@ Target::Target(Project *project, Profile *p) :
|
||||
setDisplayName(d->m_profile->displayName());
|
||||
setIcon(d->m_profile->icon());
|
||||
|
||||
ProfileManager *pm = ProfileManager::instance();
|
||||
connect(pm, SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
||||
this, SLOT(handleProfileUpdates(ProjectExplorer::Profile*)));
|
||||
connect(pm, SIGNAL(profileRemoved(ProjectExplorer::Profile*)),
|
||||
this, SLOT(handleProfileRemoval(ProjectExplorer::Profile*)));
|
||||
KitManager *pm = KitManager::instance();
|
||||
connect(pm, SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||
this, SLOT(handleKitUpdates(ProjectExplorer::Kit*)));
|
||||
connect(pm, SIGNAL(kitRemoved(ProjectExplorer::Kit*)),
|
||||
this, SLOT(handleKitRemoval(ProjectExplorer::Kit*)));
|
||||
}
|
||||
|
||||
Target::~Target()
|
||||
@@ -180,7 +180,7 @@ void Target::onBuildDirectoryChanged()
|
||||
emit buildDirectoryChanged();
|
||||
}
|
||||
|
||||
void Target::handleProfileUpdates(Profile *p)
|
||||
void Target::handleKitUpdates(Kit *p)
|
||||
{
|
||||
if (p != d->m_profile)
|
||||
return;
|
||||
@@ -188,10 +188,10 @@ void Target::handleProfileUpdates(Profile *p)
|
||||
setDisplayName(p->displayName());
|
||||
setIcon(p->icon());
|
||||
updateDefaultDeployConfigurations();
|
||||
emit profileChanged();
|
||||
emit kitChanged();
|
||||
}
|
||||
|
||||
void Target::handleProfileRemoval(Profile *p)
|
||||
void Target::handleKitRemoval(Kit *p)
|
||||
{
|
||||
if (p != d->m_profile)
|
||||
return;
|
||||
@@ -204,7 +204,7 @@ Project *Target::project() const
|
||||
return static_cast<Project *>(parent());
|
||||
}
|
||||
|
||||
Profile *Target::profile() const
|
||||
Kit *Target::kit() const
|
||||
{
|
||||
return d->m_profile;
|
||||
}
|
||||
@@ -674,7 +674,7 @@ static QString formatToolTip(const IDevice::DeviceInfo &input)
|
||||
|
||||
void Target::updateDeviceState()
|
||||
{
|
||||
IDevice::ConstPtr current = DeviceProfileInformation::device(profile());
|
||||
IDevice::ConstPtr current = DeviceKitInformation::device(kit());
|
||||
|
||||
QPixmap overlay;
|
||||
if (current.isNull()) {
|
||||
@@ -728,7 +728,7 @@ bool Target::fromMap(const QVariantMap &map)
|
||||
if (!ProjectConfiguration::fromMap(map))
|
||||
return false;
|
||||
|
||||
d->m_profile = ProfileManager::instance()->find(id());
|
||||
d->m_profile = KitManager::instance()->find(id());
|
||||
if (!d->m_profile)
|
||||
return false;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user