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/icore.h>
|
||||||
#include <coreplugin/id.h>
|
#include <coreplugin/id.h>
|
||||||
#include <projectexplorer/profilechooser.h>
|
#include <projectexplorer/kitchooser.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ namespace Internal {
|
|||||||
class StartRemoteDialogPrivate
|
class StartRemoteDialogPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ProfileChooser *profileChooser;
|
KitChooser *kitChooser;
|
||||||
QLineEdit *executable;
|
QLineEdit *executable;
|
||||||
QLineEdit *arguments;
|
QLineEdit *arguments;
|
||||||
QLineEdit *workingDirectory;
|
QLineEdit *workingDirectory;
|
||||||
@@ -69,7 +69,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
|
|||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
setWindowTitle(tr("Start Remote Analysis"));
|
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->executable = new QLineEdit(this);
|
||||||
d->arguments = new QLineEdit(this);
|
d->arguments = new QLineEdit(this);
|
||||||
d->workingDirectory = new QLineEdit(this);
|
d->workingDirectory = new QLineEdit(this);
|
||||||
@@ -80,7 +80,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
|
|||||||
|
|
||||||
QFormLayout *formLayout = new QFormLayout;
|
QFormLayout *formLayout = new QFormLayout;
|
||||||
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
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("Executable:"), d->executable);
|
||||||
formLayout->addRow(tr("Arguments:"), d->arguments);
|
formLayout->addRow(tr("Arguments:"), d->arguments);
|
||||||
formLayout->addRow(tr("Working directory:"), d->workingDirectory);
|
formLayout->addRow(tr("Working directory:"), d->workingDirectory);
|
||||||
@@ -91,14 +91,14 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
|
|||||||
|
|
||||||
QSettings *settings = Core::ICore::settings();
|
QSettings *settings = Core::ICore::settings();
|
||||||
settings->beginGroup(QLatin1String("AnalyzerStartRemoteDialog"));
|
settings->beginGroup(QLatin1String("AnalyzerStartRemoteDialog"));
|
||||||
QString profile = settings->value(QLatin1String("profile")).toString();
|
QString kit = settings->value(QLatin1String("profile")).toString();
|
||||||
d->profileChooser->setCurrentProfileId(Core::Id(profile));
|
d->kitChooser->setCurrentKitId(Core::Id(kit));
|
||||||
d->executable->setText(settings->value(QLatin1String("executable")).toString());
|
d->executable->setText(settings->value(QLatin1String("executable")).toString());
|
||||||
d->workingDirectory->setText(settings->value(QLatin1String("workingDirectory")).toString());
|
d->workingDirectory->setText(settings->value(QLatin1String("workingDirectory")).toString());
|
||||||
d->arguments->setText(settings->value(QLatin1String("arguments")).toString());
|
d->arguments->setText(settings->value(QLatin1String("arguments")).toString());
|
||||||
settings->endGroup();
|
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->executable, SIGNAL(textChanged(QString)), SLOT(validate()));
|
||||||
connect(d->workingDirectory, SIGNAL(textChanged(QString)), SLOT(validate()));
|
connect(d->workingDirectory, SIGNAL(textChanged(QString)), SLOT(validate()));
|
||||||
connect(d->arguments, 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();
|
QSettings *settings = Core::ICore::settings();
|
||||||
settings->beginGroup(QLatin1String("AnalyzerStartRemoteDialog"));
|
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("executable"), d->executable->text());
|
||||||
settings->setValue(QLatin1String("workingDirectory"), d->workingDirectory->text());
|
settings->setValue(QLatin1String("workingDirectory"), d->workingDirectory->text());
|
||||||
settings->setValue(QLatin1String("arguments"), d->arguments->text());
|
settings->setValue(QLatin1String("arguments"), d->arguments->text());
|
||||||
@@ -134,8 +134,8 @@ void StartRemoteDialog::validate()
|
|||||||
|
|
||||||
QSsh::SshConnectionParameters StartRemoteDialog::sshParams() const
|
QSsh::SshConnectionParameters StartRemoteDialog::sshParams() const
|
||||||
{
|
{
|
||||||
Profile *profile = d->profileChooser->currentProfile();
|
Kit *kit = d->kitChooser->currentKit();
|
||||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
|
||||||
return device->sshParameters();
|
return device->sshParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Target:</string>
|
<string>Kit:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#include <debugger/debuggerengine.h>
|
#include <debugger/debuggerengine.h>
|
||||||
#include <debugger/debuggerplugin.h>
|
#include <debugger/debuggerplugin.h>
|
||||||
#include <debugger/debuggerprofileinformation.h>
|
#include <debugger/debuggerkitinformation.h>
|
||||||
#include <debugger/debuggerrunner.h>
|
#include <debugger/debuggerrunner.h>
|
||||||
#include <debugger/debuggerstartparameters.h>
|
#include <debugger/debuggerstartparameters.h>
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <qt4projectmanager/qt4nodes.h>
|
#include <qt4projectmanager/qt4nodes.h>
|
||||||
#include <qt4projectmanager/qt4project.h>
|
#include <qt4projectmanager/qt4project.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
@@ -93,10 +93,10 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
|
|||||||
|
|
||||||
if (runConfig->debuggerAspect()->useCppDebugger()) {
|
if (runConfig->debuggerAspect()->useCppDebugger()) {
|
||||||
params.languages |= CppLanguage;
|
params.languages |= CppLanguage;
|
||||||
Profile *profile = target->profile();
|
Kit *kit = target->kit();
|
||||||
params.sysRoot = SysRootProfileInformation::sysRoot(profile).toString();
|
params.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
|
||||||
params.debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
params.debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString();
|
||||||
if (ToolChain *tc = ToolChainProfileInformation::toolChain(profile))
|
if (ToolChain *tc = ToolChainKitInformation::toolChain(kit))
|
||||||
params.toolChainAbi = tc->targetAbi();
|
params.toolChainAbi = tc->targetAbi();
|
||||||
params.executable = project->rootQt4ProjectNode()->buildDir() + QLatin1String("/app_process");
|
params.executable = project->rootQt4ProjectNode()->buildDir() + QLatin1String("/app_process");
|
||||||
params.remoteChannel = runConfig->remoteChannel();
|
params.remoteChannel = runConfig->remoteChannel();
|
||||||
@@ -105,7 +105,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
|
|||||||
foreach (Qt4ProFileNode *node, nodes)
|
foreach (Qt4ProFileNode *node, nodes)
|
||||||
if (node->projectType() == ApplicationTemplate)
|
if (node->projectType() == ApplicationTemplate)
|
||||||
params.solibSearchPath.append(node->targetInformation().buildDir);
|
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));
|
params.solibSearchPath.append(qtSoPaths(version));
|
||||||
}
|
}
|
||||||
if (runConfig->debuggerAspect()->useQmlDebugger()) {
|
if (runConfig->debuggerAspect()->useQmlDebugger()) {
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
#include <qt4projectmanager/qt4project.h>
|
#include <qt4projectmanager/qt4project.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -119,15 +119,15 @@ QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(Target *
|
|||||||
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
|
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
|
||||||
return ids;
|
return ids;
|
||||||
|
|
||||||
if (!parent->project()->supportsProfile(parent->profile()))
|
if (!parent->project()->supportsKit(parent->kit()))
|
||||||
return ids;
|
return ids;
|
||||||
|
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(parent->profile());
|
ToolChain *tc = ToolChainKitInformation::toolChain(parent->kit());
|
||||||
|
|
||||||
if (!tc || tc->targetAbi().osFlavor() != Abi::AndroidLinuxFlavor)
|
if (!tc || tc->targetAbi().osFlavor() != Abi::AndroidLinuxFlavor)
|
||||||
return ids;
|
return ids;
|
||||||
|
|
||||||
if (QtSupport::QtProfileInformation::qtVersion(parent->profile())->type() != QLatin1String(Constants::ANDROIDQT))
|
if (QtSupport::QtKitInformation::qtVersion(parent->kit())->type() != QLatin1String(Constants::ANDROIDQT))
|
||||||
return ids;
|
return ids;
|
||||||
|
|
||||||
ids << Core::Id(ANDROID_DEPLOYCONFIGURATION_ID);
|
ids << Core::Id(ANDROID_DEPLOYCONFIGURATION_ID);
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
#include <qt4projectmanager/qt4project.h>
|
#include <qt4projectmanager/qt4project.h>
|
||||||
#include <qt4projectmanager/qt4nodes.h>
|
#include <qt4projectmanager/qt4nodes.h>
|
||||||
|
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ bool AndroidDeployStep::init()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
|
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||||
if (!version)
|
if (!version)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <qtsupport/customexecutablerunconfiguration.h>
|
#include <qtsupport/customexecutablerunconfiguration.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -81,7 +81,7 @@ bool AndroidManager::supportsAndroid(ProjectExplorer::Target *target)
|
|||||||
{
|
{
|
||||||
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(target->project()))
|
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(target->project()))
|
||||||
return false;
|
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);
|
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)
|
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());
|
Qt4ProjectManager::Qt4Project *qt4Project = qobject_cast<Qt4ProjectManager::Qt4Project*>(target->project());
|
||||||
if (!qt4Project || !qt4Project->rootProjectNode() || !version)
|
if (!qt4Project || !qt4Project->rootProjectNode() || !version)
|
||||||
return false;
|
return false;
|
||||||
@@ -555,7 +555,7 @@ void AndroidManager::updateTarget(ProjectExplorer::Target *target, const QString
|
|||||||
|
|
||||||
Utils::FileName AndroidManager::localLibsRulesFilePath(ProjectExplorer::Target *target)
|
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)
|
if (!version)
|
||||||
return Utils::FileName();
|
return Utils::FileName();
|
||||||
return Utils::FileName::fromString(version->qmakeProperty("QT_INSTALL_LIBS") + QLatin1String("/rules.xml"));
|
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)
|
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())
|
if (!target->activeRunConfiguration())
|
||||||
return QStringList();
|
return QStringList();
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
@@ -34,10 +34,10 @@
|
|||||||
#include "androidtoolchain.h"
|
#include "androidtoolchain.h"
|
||||||
#include "androidmanager.h"
|
#include "androidmanager.h"
|
||||||
|
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qtsupport/qtoutputformatter.h>
|
#include <qtsupport/qtoutputformatter.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ AndroidConfig AndroidRunConfiguration::config() const
|
|||||||
|
|
||||||
const Utils::FileName AndroidRunConfiguration::gdbCmd() const
|
const Utils::FileName AndroidRunConfiguration::gdbCmd() const
|
||||||
{
|
{
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(target()->profile());
|
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
||||||
if (!tc)
|
if (!tc)
|
||||||
return Utils::FileName();
|
return Utils::FileName();
|
||||||
return AndroidConfigurations::instance().gdbPath(tc->targetAbi().architecture());
|
return AndroidConfigurations::instance().gdbPath(tc->targetAbi().architecture());
|
||||||
@@ -110,7 +110,7 @@ const QString AndroidRunConfiguration::remoteChannel() const
|
|||||||
|
|
||||||
const QString AndroidRunConfiguration::dumperLib() const
|
const QString AndroidRunConfiguration::dumperLib() const
|
||||||
{
|
{
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
|
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||||
if (!version)
|
if (!version)
|
||||||
return QString();
|
return QString();
|
||||||
return version->gdbDebuggingHelperLibrary();
|
return version->gdbDebuggingHelperLibrary();
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
#include <qt4projectmanager/qt4project.h>
|
#include <qt4projectmanager/qt4project.h>
|
||||||
#include <qt4projectmanager/qt4nodes.h>
|
#include <qt4projectmanager/qt4nodes.h>
|
||||||
#include <qtsupport/customexecutablerunconfiguration.h>
|
#include <qtsupport/customexecutablerunconfiguration.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ RunConfiguration *AndroidRunConfigurationFactory::clone(Target *parent, RunConfi
|
|||||||
|
|
||||||
bool AndroidRunConfigurationFactory::canHandle(Target *t) const
|
bool AndroidRunConfigurationFactory::canHandle(Target *t) const
|
||||||
{
|
{
|
||||||
if (!t->project()->supportsProfile(t->profile()))
|
if (!t->project()->supportsKit(t->kit()))
|
||||||
return false;
|
return false;
|
||||||
return AndroidManager::supportsAndroid(t);
|
return AndroidManager::supportsAndroid(t);
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
#include <projectexplorer/toolchainmanager.h>
|
#include <projectexplorer/toolchainmanager.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <qt4projectmanager/qt4project.h>
|
#include <qt4projectmanager/qt4project.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtversionmanager.h>
|
#include <qtsupport/qtversionmanager.h>
|
||||||
|
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
@@ -93,7 +93,7 @@ void AndroidToolChain::addToEnvironment(Utils::Environment &env) const
|
|||||||
|
|
||||||
Qt4Project *qt4pro = qobject_cast<Qt4Project *>(ProjectExplorerPlugin::instance()->currentProject());
|
Qt4Project *qt4pro = qobject_cast<Qt4Project *>(ProjectExplorerPlugin::instance()->currentProject());
|
||||||
if (!qt4pro || !qt4pro->activeTarget()
|
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;
|
return;
|
||||||
|
|
||||||
QString ndk_host = QLatin1String(
|
QString ndk_host = QLatin1String(
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
#include "configurestep.h"
|
#include "configurestep.h"
|
||||||
|
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
@@ -117,7 +117,7 @@ void AutotoolsBuildConfiguration::setBuildDirectory(const QString &buildDirector
|
|||||||
|
|
||||||
IOutputParser *AutotoolsBuildConfiguration::createOutputParser() const
|
IOutputParser *AutotoolsBuildConfiguration::createOutputParser() const
|
||||||
{
|
{
|
||||||
ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile());
|
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
|
||||||
if (tc)
|
if (tc)
|
||||||
return tc->outputParser();
|
return tc->outputParser();
|
||||||
return 0;
|
return 0;
|
||||||
@@ -214,7 +214,7 @@ AutotoolsBuildConfiguration *AutotoolsBuildConfigurationFactory::createDefaultCo
|
|||||||
|
|
||||||
bool AutotoolsBuildConfigurationFactory::canHandle(const Target *t) const
|
bool AutotoolsBuildConfigurationFactory::canHandle(const Target *t) const
|
||||||
{
|
{
|
||||||
if (!t->project()->supportsProfile(t->profile()))
|
if (!t->project()->supportsKit(t->kit()))
|
||||||
return false;
|
return false;
|
||||||
return t->project()->id() == Constants::AUTOTOOLS_PROJECT_ID;
|
return t->project()->id() == Constants::AUTOTOOLS_PROJECT_ID;
|
||||||
}
|
}
|
||||||
|
@@ -44,8 +44,8 @@
|
|||||||
|
|
||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
#include <projectexplorer/buildenvironmentwidget.h>
|
#include <projectexplorer/buildenvironmentwidget.h>
|
||||||
#include <projectexplorer/profilemanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
@@ -158,9 +158,9 @@ bool AutotoolsProject::fromMap(const QVariantMap &map)
|
|||||||
// Load the project tree structure.
|
// Load the project tree structure.
|
||||||
loadProjectTree();
|
loadProjectTree();
|
||||||
|
|
||||||
Profile *defaultProfile = ProfileManager::instance()->defaultProfile();
|
Kit *defaultKit = KitManager::instance()->defaultKit();
|
||||||
if (!activeTarget() && defaultProfile)
|
if (!activeTarget() && defaultKit)
|
||||||
addTarget(createTarget(defaultProfile));
|
addTarget(createTarget(defaultKit));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -418,7 +418,7 @@ void AutotoolsProject::updateCppCodeModel()
|
|||||||
QByteArray macros;
|
QByteArray macros;
|
||||||
|
|
||||||
if (activeTarget()) {
|
if (activeTarget()) {
|
||||||
ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(activeTarget()->profile());
|
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(activeTarget()->kit());
|
||||||
if (tc) {
|
if (tc) {
|
||||||
const QList<HeaderPath> allHeaderPaths = tc->systemHeaderPaths();
|
const QList<HeaderPath> allHeaderPaths = tc->systemHeaderPaths();
|
||||||
foreach (const HeaderPath &headerPath, allHeaderPaths) {
|
foreach (const HeaderPath &headerPath, allHeaderPaths) {
|
||||||
|
@@ -41,7 +41,7 @@
|
|||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <projectexplorer/gnumakeparser.h>
|
#include <projectexplorer/gnumakeparser.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
@@ -174,7 +174,7 @@ bool MakeStep::init()
|
|||||||
|
|
||||||
setIgnoreReturnValue(m_clean);
|
setIgnoreReturnValue(m_clean);
|
||||||
|
|
||||||
ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(bc->target()->profile());
|
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
|
||||||
|
|
||||||
ProcessParameters *pp = processParameters();
|
ProcessParameters *pp = processParameters();
|
||||||
pp->setMacroExpander(bc->macroExpander());
|
pp->setMacroExpander(bc->macroExpander());
|
||||||
@@ -289,7 +289,7 @@ QString MakeStepConfigWidget::summaryText() const
|
|||||||
void MakeStepConfigWidget::updateDetails()
|
void MakeStepConfigWidget::updateDetails()
|
||||||
{
|
{
|
||||||
AutotoolsBuildConfiguration *bc = m_makeStep->autotoolsBuildConfiguration();
|
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) {
|
if (tc) {
|
||||||
QString arguments = Utils::QtcProcess::joinArgs(m_makeStep->m_buildTargets);
|
QString arguments = Utils::QtcProcess::joinArgs(m_makeStep->m_buildTargets);
|
||||||
@@ -303,7 +303,7 @@ void MakeStepConfigWidget::updateDetails()
|
|||||||
param.setArguments(arguments);
|
param.setArguments(arguments);
|
||||||
m_summaryText = param.summary(displayName());
|
m_summaryText = param.summary(displayName());
|
||||||
} else {
|
} else {
|
||||||
m_summaryText = QLatin1String("<b>") + ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget() + QLatin1String("</b>");
|
m_summaryText = QLatin1String("<b>") + ProjectExplorer::ToolChainKitInformation::msgNoToolChainInTarget() + QLatin1String("</b>");
|
||||||
}
|
}
|
||||||
|
|
||||||
emit updateSummary();
|
emit updateSummary();
|
||||||
|
@@ -36,12 +36,12 @@
|
|||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/gnumakeparser.h>
|
#include <projectexplorer/gnumakeparser.h>
|
||||||
#include <projectexplorer/ioutputparser.h>
|
#include <projectexplorer/ioutputparser.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
#include <qtsupport/qtparser.h>
|
#include <qtsupport/qtparser.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
@@ -113,11 +113,11 @@ ProjectExplorer::IOutputParser *CMakeBuildConfiguration::createOutputParser() co
|
|||||||
{
|
{
|
||||||
ProjectExplorer::IOutputParser *parserchain = new ProjectExplorer::GnuMakeParser;
|
ProjectExplorer::IOutputParser *parserchain = new ProjectExplorer::GnuMakeParser;
|
||||||
|
|
||||||
int versionId = QtSupport::QtProfileInformation::qtVersionId(target()->profile());
|
int versionId = QtSupport::QtKitInformation::qtVersionId(target()->kit());
|
||||||
if (versionId >= 0)
|
if (versionId >= 0)
|
||||||
parserchain->appendOutputParser(new QtSupport::QtParser);
|
parserchain->appendOutputParser(new QtSupport::QtParser);
|
||||||
|
|
||||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile());
|
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
|
||||||
if (tc)
|
if (tc)
|
||||||
parserchain->appendOutputParser(tc->outputParser());
|
parserchain->appendOutputParser(tc->outputParser());
|
||||||
return parserchain;
|
return parserchain;
|
||||||
@@ -126,7 +126,7 @@ ProjectExplorer::IOutputParser *CMakeBuildConfiguration::createOutputParser() co
|
|||||||
Utils::Environment CMakeBuildConfiguration::baseEnvironment() const
|
Utils::Environment CMakeBuildConfiguration::baseEnvironment() const
|
||||||
{
|
{
|
||||||
Utils::Environment env = BuildConfiguration::baseEnvironment();
|
Utils::Environment env = BuildConfiguration::baseEnvironment();
|
||||||
target()->profile()->addToEnvironment(env);
|
target()->kit()->addToEnvironment(env);
|
||||||
return env;
|
return env;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::restore(ProjectExplorer
|
|||||||
|
|
||||||
bool CMakeBuildConfigurationFactory::canHandle(const ProjectExplorer::Target *t) const
|
bool CMakeBuildConfigurationFactory::canHandle(const ProjectExplorer::Target *t) const
|
||||||
{
|
{
|
||||||
if (!t->project()->supportsProfile(t->profile()))
|
if (!t->project()->supportsKit(t->kit()))
|
||||||
return false;
|
return false;
|
||||||
return qobject_cast<CMakeProject *>(t->project());
|
return qobject_cast<CMakeProject *>(t->project());
|
||||||
}
|
}
|
||||||
|
@@ -34,8 +34,8 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/fancylineedit.h>
|
#include <utils/fancylineedit.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/profilemanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
@@ -405,13 +405,13 @@ void CMakeRunPage::initializePage()
|
|||||||
m_generatorComboBox->clear();
|
m_generatorComboBox->clear();
|
||||||
bool hasCodeBlocksGenerator = m_cmakeWizard->cmakeManager()->hasCodeBlocksMsvcGenerator();
|
bool hasCodeBlocksGenerator = m_cmakeWizard->cmakeManager()->hasCodeBlocksMsvcGenerator();
|
||||||
|
|
||||||
QList<ProjectExplorer::Profile *> profileList =
|
QList<ProjectExplorer::Kit *> kitList =
|
||||||
ProjectExplorer::ProfileManager::instance()->profiles();
|
ProjectExplorer::KitManager::instance()->kits();
|
||||||
|
|
||||||
foreach (ProjectExplorer::Profile *p, profileList) {
|
foreach (ProjectExplorer::Kit *k, kitList) {
|
||||||
QVariant profileVariant = qVariantFromValue(static_cast<void *>(p));
|
QVariant kitVariant = qVariantFromValue(static_cast<void *>(k));
|
||||||
|
|
||||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(p);
|
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
|
||||||
if (!tc)
|
if (!tc)
|
||||||
continue;
|
continue;
|
||||||
ProjectExplorer::Abi targetAbi = tc->targetAbi();
|
ProjectExplorer::Abi targetAbi = tc->targetAbi();
|
||||||
@@ -421,21 +421,21 @@ void CMakeRunPage::initializePage()
|
|||||||
|| targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2010Flavor
|
|| targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2010Flavor
|
||||||
|| targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2012Flavor) {
|
|| targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2012Flavor) {
|
||||||
if (hasCodeBlocksGenerator && (cachedGenerator.isEmpty() || cachedGenerator == "NMake Makefiles"))
|
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) {
|
} else if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor) {
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
if (cachedGenerator.isEmpty() || cachedGenerator == "MinGW Makefiles")
|
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
|
#else
|
||||||
if (cachedGenerator.isEmpty() || cachedGenerator == "Unix Makefiles")
|
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
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Non windows
|
// Non windows
|
||||||
if (cachedGenerator.isEmpty() || cachedGenerator == "Unix Makefiles")
|
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();
|
int index = m_generatorComboBox->currentIndex();
|
||||||
|
|
||||||
ProjectExplorer::Profile *p = 0;
|
ProjectExplorer::Kit *p = 0;
|
||||||
if (index >= 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) {
|
if (!p) {
|
||||||
m_output->appendPlainText(tr("No generator selected."));
|
m_output->appendPlainText(tr("No generator selected."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(p);
|
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(p);
|
||||||
|
|
||||||
m_runCMake->setEnabled(false);
|
m_runCMake->setEnabled(false);
|
||||||
m_argumentsLineEdit->setEnabled(false);
|
m_argumentsLineEdit->setEnabled(false);
|
||||||
|
@@ -45,8 +45,8 @@
|
|||||||
#include <projectexplorer/buildenvironmentwidget.h>
|
#include <projectexplorer/buildenvironmentwidget.h>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/buildmanager.h>
|
#include <projectexplorer/buildmanager.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/profilemanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qtsupport/customexecutablerunconfiguration.h>
|
#include <qtsupport/customexecutablerunconfiguration.h>
|
||||||
@@ -286,7 +286,7 @@ bool CMakeProject::parseCMakeLists()
|
|||||||
|
|
||||||
createUiCodeModelSupport();
|
createUiCodeModelSupport();
|
||||||
|
|
||||||
ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(activeTarget()->profile());
|
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(activeTarget()->kit());
|
||||||
if (!tc) {
|
if (!tc) {
|
||||||
emit buildTargetsChanged();
|
emit buildTargetsChanged();
|
||||||
emit fileListChanged();
|
emit fileListChanged();
|
||||||
@@ -530,9 +530,9 @@ bool CMakeProject::fromMap(const QVariantMap &map)
|
|||||||
if (!Project::fromMap(map))
|
if (!Project::fromMap(map))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Profile *defaultProfile = ProfileManager::instance()->defaultProfile();
|
Kit *defaultKit = KitManager::instance()->defaultKit();
|
||||||
if (!activeTarget() && defaultProfile)
|
if (!activeTarget() && defaultKit)
|
||||||
addTarget(createTarget(defaultProfile));
|
addTarget(createTarget(defaultKit));
|
||||||
|
|
||||||
// We have a user file, but we could still be missing the cbp file
|
// We have a user file, but we could still be missing the cbp file
|
||||||
// or simply run createXml with the saved settings
|
// 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
|
bool CMakeRunConfigurationFactory::canHandle(ProjectExplorer::Target *parent) const
|
||||||
{
|
{
|
||||||
if (!parent->project()->supportsProfile(parent->profile()))
|
if (!parent->project()->supportsKit(parent->kit()))
|
||||||
return false;
|
return false;
|
||||||
return qobject_cast<CMakeProject *>(parent->project());
|
return qobject_cast<CMakeProject *>(parent->project());
|
||||||
}
|
}
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/deployconfiguration.h>
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
#include <projectexplorer/gnumakeparser.h>
|
#include <projectexplorer/gnumakeparser.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
@@ -137,7 +137,7 @@ bool MakeStep::init()
|
|||||||
|
|
||||||
setIgnoreReturnValue(m_clean);
|
setIgnoreReturnValue(m_clean);
|
||||||
|
|
||||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile());
|
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
|
||||||
ProcessParameters *pp = processParameters();
|
ProcessParameters *pp = processParameters();
|
||||||
pp->setMacroExpander(bc->macroExpander());
|
pp->setMacroExpander(bc->macroExpander());
|
||||||
pp->setEnvironment(bc->environment());
|
pp->setEnvironment(bc->environment());
|
||||||
@@ -308,7 +308,7 @@ void MakeStepConfigWidget::updateDetails()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(m_makeStep->target()->profile());
|
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(m_makeStep->target()->kit());
|
||||||
if (tc) {
|
if (tc) {
|
||||||
QString arguments = Utils::QtcProcess::joinArgs(m_makeStep->buildTargets());
|
QString arguments = Utils::QtcProcess::joinArgs(m_makeStep->buildTargets());
|
||||||
Utils::QtcProcess::addArgs(&arguments, m_makeStep->additionalArguments());
|
Utils::QtcProcess::addArgs(&arguments, m_makeStep->additionalArguments());
|
||||||
@@ -321,7 +321,7 @@ void MakeStepConfigWidget::updateDetails()
|
|||||||
param.setArguments(arguments);
|
param.setArguments(arguments);
|
||||||
m_summaryText = param.summary(displayName());
|
m_summaryText = param.summary(displayName());
|
||||||
} else {
|
} else {
|
||||||
m_summaryText = QLatin1String("<b>") + ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget() + QLatin1String("</b>");
|
m_summaryText = QLatin1String("<b>") + ProjectExplorer::ToolChainKitInformation::msgNoToolChainInTarget() + QLatin1String("</b>");
|
||||||
}
|
}
|
||||||
emit updateSummary();
|
emit updateSummary();
|
||||||
}
|
}
|
||||||
|
@@ -38,8 +38,8 @@ HEADERS += \
|
|||||||
debuggerstartparameters.h \
|
debuggerstartparameters.h \
|
||||||
debuggerstreamops.h \
|
debuggerstreamops.h \
|
||||||
debuggerstringutils.h \
|
debuggerstringutils.h \
|
||||||
debuggerprofileconfigwidget.h \
|
debuggerkitconfigwidget.h \
|
||||||
debuggerprofileinformation.h \
|
debuggerkitinformation.h \
|
||||||
disassembleragent.h \
|
disassembleragent.h \
|
||||||
disassemblerlines.h \
|
disassemblerlines.h \
|
||||||
loadcoredialog.h \
|
loadcoredialog.h \
|
||||||
@@ -92,8 +92,8 @@ SOURCES += \
|
|||||||
debuggerplugin.cpp \
|
debuggerplugin.cpp \
|
||||||
debuggerrunner.cpp \
|
debuggerrunner.cpp \
|
||||||
debuggerstreamops.cpp \
|
debuggerstreamops.cpp \
|
||||||
debuggerprofileconfigwidget.cpp \
|
debuggerkitconfigwidget.cpp \
|
||||||
debuggerprofileinformation.cpp \
|
debuggerkitinformation.cpp \
|
||||||
disassembleragent.cpp \
|
disassembleragent.cpp \
|
||||||
disassemblerlines.cpp \
|
disassemblerlines.cpp \
|
||||||
loadcoredialog.cpp \
|
loadcoredialog.cpp \
|
||||||
|
@@ -33,10 +33,10 @@ QtcPlugin {
|
|||||||
|
|
||||||
files: [
|
files: [
|
||||||
"debugger.qrc",
|
"debugger.qrc",
|
||||||
"debuggerprofileconfigwidget.cpp",
|
"debuggerkitconfigwidget.cpp",
|
||||||
"debuggerprofileconfigwidget.h",
|
"debuggerkitconfigwidget.h",
|
||||||
"debuggerprofileinformation.cpp",
|
"debuggerkitinformation.cpp",
|
||||||
"debuggerprofileinformation.h",
|
"debuggerkitinformation.h",
|
||||||
"basewindow.cpp",
|
"basewindow.cpp",
|
||||||
"breakhandler.cpp",
|
"breakhandler.cpp",
|
||||||
"breakhandler.h",
|
"breakhandler.h",
|
||||||
|
@@ -32,15 +32,15 @@
|
|||||||
#include "debuggerstartparameters.h"
|
#include "debuggerstartparameters.h"
|
||||||
|
|
||||||
#include "debuggerconstants.h"
|
#include "debuggerconstants.h"
|
||||||
#include "debuggerprofileinformation.h"
|
#include "debuggerkitinformation.h"
|
||||||
#include "debuggerstringutils.h"
|
#include "debuggerstringutils.h"
|
||||||
#include "cdb/cdbengine.h"
|
#include "cdb/cdbengine.h"
|
||||||
#include "shared/hostutils.h"
|
#include "shared/hostutils.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
#include <projectexplorer/profilechooser.h>
|
#include <projectexplorer/kitchooser.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <utils/historycompleter.h>
|
#include <utils/historycompleter.h>
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -88,7 +88,7 @@ namespace Internal {
|
|||||||
class StartApplicationDialogPrivate
|
class StartApplicationDialogPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ProfileChooser *profileChooser;
|
KitChooser *kitChooser;
|
||||||
PathChooser *localExecutablePathChooser;
|
PathChooser *localExecutablePathChooser;
|
||||||
FancyLineEdit *arguments;
|
FancyLineEdit *arguments;
|
||||||
PathChooser *workingDirectory;
|
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); }
|
||||||
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 localExecutable;
|
||||||
QString processArgs;
|
QString processArgs;
|
||||||
QString workingDirectory;
|
QString workingDirectory;
|
||||||
@@ -150,7 +150,7 @@ bool StartApplicationParameters::equals(const StartApplicationParameters &rhs) c
|
|||||||
&& breakAtMain == rhs.breakAtMain
|
&& breakAtMain == rhs.breakAtMain
|
||||||
&& runInTerminal == rhs.runInTerminal
|
&& runInTerminal == rhs.runInTerminal
|
||||||
&& serverStartScript == rhs.serverStartScript
|
&& serverStartScript == rhs.serverStartScript
|
||||||
&& profileId == rhs.profileId
|
&& kitId == rhs.kitId
|
||||||
&& debugInfoLocation == rhs.debugInfoLocation;
|
&& debugInfoLocation == rhs.debugInfoLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,15 +167,15 @@ QString StartApplicationParameters::displayName() const
|
|||||||
name += QLatin1String("...");
|
name += QLatin1String("...");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Profile *profile = ProfileManager::instance()->find(profileId))
|
if (Kit *kit = KitManager::instance()->find(kitId))
|
||||||
name += QString::fromLatin1(" (%1)").arg(profile->displayName());
|
name += QString::fromLatin1(" (%1)").arg(kit->displayName());
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartApplicationParameters::toSettings(QSettings *settings) const
|
void StartApplicationParameters::toSettings(QSettings *settings) const
|
||||||
{
|
{
|
||||||
settings->setValue(_("LastProfileId"), profileId.toString());
|
settings->setValue(_("LastProfileId"), kitId.toString());
|
||||||
settings->setValue(_("LastExternalExecutable"), localExecutable);
|
settings->setValue(_("LastExternalExecutable"), localExecutable);
|
||||||
settings->setValue(_("LastExternalExecutableArguments"), processArgs);
|
settings->setValue(_("LastExternalExecutableArguments"), processArgs);
|
||||||
settings->setValue(_("LastExternalWorkingDirectory"), workingDirectory);
|
settings->setValue(_("LastExternalWorkingDirectory"), workingDirectory);
|
||||||
@@ -187,8 +187,8 @@ void StartApplicationParameters::toSettings(QSettings *settings) const
|
|||||||
|
|
||||||
void StartApplicationParameters::fromSettings(const QSettings *settings)
|
void StartApplicationParameters::fromSettings(const QSettings *settings)
|
||||||
{
|
{
|
||||||
const QString profileIdString = settings->value(_("LastProfileId")).toString();
|
const QString kitIdString = settings->value(_("LastProfileId")).toString();
|
||||||
profileId = profileIdString.isEmpty() ? Id() : Id(profileIdString);
|
kitId = kitIdString.isEmpty() ? Id() : Id(kitIdString);
|
||||||
localExecutable = settings->value(_("LastExternalExecutable")).toString();
|
localExecutable = settings->value(_("LastExternalExecutable")).toString();
|
||||||
processArgs = settings->value(_("LastExternalExecutableArguments")).toString();
|
processArgs = settings->value(_("LastExternalExecutableArguments")).toString();
|
||||||
workingDirectory = settings->value(_("LastExternalWorkingDirectory")).toString();
|
workingDirectory = settings->value(_("LastExternalWorkingDirectory")).toString();
|
||||||
@@ -225,7 +225,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
|
|||||||
|
|
||||||
d->runInTerminalCheckBox = new QCheckBox(this);
|
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 = new QCheckBox(this);
|
||||||
d->breakAtMainCheckBox->setText(QString());
|
d->breakAtMainCheckBox->setText(QString());
|
||||||
@@ -263,7 +263,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
|
|||||||
|
|
||||||
QFormLayout *formLayout = new QFormLayout();
|
QFormLayout *formLayout = new QFormLayout();
|
||||||
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
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("Local &executable:"), d->localExecutablePathChooser);
|
||||||
formLayout->addRow(tr("Command line &arguments:"), d->arguments);
|
formLayout->addRow(tr("Command line &arguments:"), d->arguments);
|
||||||
formLayout->addRow(tr("&Working directory:"), d->workingDirectory);
|
formLayout->addRow(tr("&Working directory:"), d->workingDirectory);
|
||||||
@@ -319,9 +319,9 @@ void StartApplicationDialog::historyIndexChanged(int index)
|
|||||||
setParameters(v.value<StartApplicationParameters>());
|
setParameters(v.value<StartApplicationParameters>());
|
||||||
}
|
}
|
||||||
|
|
||||||
Id StartApplicationDialog::profileId() const
|
Id StartApplicationDialog::kitId() const
|
||||||
{
|
{
|
||||||
return d->profileChooser->currentProfileId();
|
return d->kitChooser->currentKitId();
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartApplicationDialog::updateState()
|
void StartApplicationDialog::updateState()
|
||||||
@@ -373,9 +373,9 @@ bool StartApplicationDialog::run(QWidget *parent, QSettings *settings, DebuggerS
|
|||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *profile = dialog.d->profileChooser->currentProfile();
|
Kit *kit = dialog.d->kitChooser->currentKit();
|
||||||
QTC_ASSERT(profile, return false);
|
QTC_ASSERT(kit, return false);
|
||||||
fillParameters(sp, profile);
|
fillParameters(sp, kit);
|
||||||
|
|
||||||
sp->executable = newParameters.localExecutable;
|
sp->executable = newParameters.localExecutable;
|
||||||
sp->displayName = newParameters.displayName();
|
sp->displayName = newParameters.displayName();
|
||||||
@@ -387,7 +387,7 @@ bool StartApplicationDialog::run(QWidget *parent, QSettings *settings, DebuggerS
|
|||||||
sp->serverStartScript = newParameters.serverStartScript;
|
sp->serverStartScript = newParameters.serverStartScript;
|
||||||
sp->debugInfoLocation = newParameters.debugInfoLocation;
|
sp->debugInfoLocation = newParameters.debugInfoLocation;
|
||||||
|
|
||||||
bool isLocal = DeviceProfileInformation::device(profile)->type()
|
bool isLocal = DeviceKitInformation::device(kit)->type()
|
||||||
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
||||||
sp->startMode = isLocal ? StartExternal : StartRemoteProcess;
|
sp->startMode = isLocal ? StartExternal : StartRemoteProcess;
|
||||||
return true;
|
return true;
|
||||||
@@ -398,7 +398,7 @@ StartApplicationParameters StartApplicationDialog::parameters() const
|
|||||||
StartApplicationParameters result;
|
StartApplicationParameters result;
|
||||||
result.localExecutable = d->localExecutablePathChooser->path();
|
result.localExecutable = d->localExecutablePathChooser->path();
|
||||||
result.serverStartScript = d->serverStartScriptPathChooser->path();
|
result.serverStartScript = d->serverStartScriptPathChooser->path();
|
||||||
result.profileId = d->profileChooser->currentProfileId();
|
result.kitId = d->kitChooser->currentKitId();
|
||||||
result.debugInfoLocation = d->debuginfoPathChooser->path();
|
result.debugInfoLocation = d->debuginfoPathChooser->path();
|
||||||
result.processArgs = d->arguments->text();
|
result.processArgs = d->arguments->text();
|
||||||
result.workingDirectory = d->workingDirectory->path();
|
result.workingDirectory = d->workingDirectory->path();
|
||||||
@@ -409,7 +409,7 @@ StartApplicationParameters StartApplicationDialog::parameters() const
|
|||||||
|
|
||||||
void StartApplicationDialog::setParameters(const StartApplicationParameters &p)
|
void StartApplicationDialog::setParameters(const StartApplicationParameters &p)
|
||||||
{
|
{
|
||||||
d->profileChooser->setCurrentProfileId(p.profileId);
|
d->kitChooser->setCurrentKitId(p.kitId);
|
||||||
d->localExecutablePathChooser->setPath(p.localExecutable);
|
d->localExecutablePathChooser->setPath(p.localExecutable);
|
||||||
d->serverStartScriptPathChooser->setPath(p.serverStartScript);
|
d->serverStartScriptPathChooser->setPath(p.serverStartScript);
|
||||||
d->debuginfoPathChooser->setPath(p.debugInfoLocation);
|
d->debuginfoPathChooser->setPath(p.debugInfoLocation);
|
||||||
@@ -430,7 +430,7 @@ class AttachToQmlPortDialogPrivate
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QSpinBox *portSpinBox;
|
QSpinBox *portSpinBox;
|
||||||
ProfileChooser *profileChooser;
|
KitChooser *kitChooser;
|
||||||
};
|
};
|
||||||
|
|
||||||
AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
|
AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
|
||||||
@@ -440,7 +440,7 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
|
|||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
setWindowTitle(tr("Start Debugger"));
|
setWindowTitle(tr("Start Debugger"));
|
||||||
|
|
||||||
d->profileChooser = new ProfileChooser(this);
|
d->kitChooser = new KitChooser(this);
|
||||||
|
|
||||||
d->portSpinBox = new QSpinBox(this);
|
d->portSpinBox = new QSpinBox(this);
|
||||||
d->portSpinBox->setMaximum(65535);
|
d->portSpinBox->setMaximum(65535);
|
||||||
@@ -451,7 +451,7 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
|
|||||||
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
|
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
|
||||||
|
|
||||||
QFormLayout *formLayout = new QFormLayout();
|
QFormLayout *formLayout = new QFormLayout();
|
||||||
formLayout->addRow(tr("Target:"), d->profileChooser);
|
formLayout->addRow(tr("Kit:"), d->kitChooser);
|
||||||
formLayout->addRow(tr("&Port:"), d->portSpinBox);
|
formLayout->addRow(tr("&Port:"), d->portSpinBox);
|
||||||
|
|
||||||
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
|
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
|
||||||
@@ -477,14 +477,14 @@ int AttachToQmlPortDialog::port() const
|
|||||||
return d->portSpinBox->value();
|
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
|
// --------- StartRemoteCdbDialog
|
||||||
|
@@ -44,7 +44,7 @@ class QSettings;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core { class Id; }
|
namespace Core { class Id; }
|
||||||
namespace ProjectExplorer { class Profile; }
|
namespace ProjectExplorer { class Kit; }
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
class DebuggerStartParameters;
|
class DebuggerStartParameters;
|
||||||
@@ -78,7 +78,7 @@ private:
|
|||||||
void setParameters(const StartApplicationParameters &p);
|
void setParameters(const StartApplicationParameters &p);
|
||||||
void setHistory(const QList<StartApplicationParameters> &l);
|
void setHistory(const QList<StartApplicationParameters> &l);
|
||||||
void hideStartScript();
|
void hideStartScript();
|
||||||
Core::Id profileId() const;
|
Core::Id kitId() const;
|
||||||
|
|
||||||
StartApplicationDialogPrivate *d;
|
StartApplicationDialogPrivate *d;
|
||||||
};
|
};
|
||||||
@@ -94,8 +94,8 @@ public:
|
|||||||
int port() const;
|
int port() const;
|
||||||
void setPort(const int port);
|
void setPort(const int port);
|
||||||
|
|
||||||
ProjectExplorer::Profile *profile() const;
|
ProjectExplorer::Kit *kit() const;
|
||||||
void setProfileId(const Core::Id &id);
|
void setKitId(const Core::Id &id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AttachToQmlPortDialogPrivate *d;
|
AttachToQmlPortDialogPrivate *d;
|
||||||
|
@@ -28,12 +28,12 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "debuggerprofileconfigwidget.h"
|
#include "debuggerkitconfigwidget.h"
|
||||||
|
|
||||||
#include "debuggerprofileinformation.h"
|
#include "debuggerkitinformation.h"
|
||||||
|
|
||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
|
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/qtcassert.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 dgbToolsDownloadLink32C[] = "http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx";
|
||||||
static const char dgbToolsDownloadLink64C[] = "http://www.microsoft.com/whdc/devtools/debugging/install64bit.Mspx";
|
static const char dgbToolsDownloadLink64C[] = "http://www.microsoft.com/whdc/devtools/debugging/install64bit.Mspx";
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
// DebuggerProfileConfigWidget:
|
// DebuggerKitConfigWidget:
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
DebuggerProfileConfigWidget::DebuggerProfileConfigWidget(ProjectExplorer::Profile *p,
|
DebuggerKitConfigWidget::DebuggerKitConfigWidget(ProjectExplorer::Kit *k,
|
||||||
const DebuggerProfileInformation *pi,
|
const DebuggerKitInformation *ki,
|
||||||
QWidget *parent) :
|
QWidget *parent) :
|
||||||
ProjectExplorer::ProfileConfigWidget(parent),
|
ProjectExplorer::KitConfigWidget(parent),
|
||||||
m_profile(p),
|
m_kit(k),
|
||||||
m_info(pi),
|
m_info(ki),
|
||||||
m_chooser(new Utils::PathChooser)
|
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);
|
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||||
layout->setMargin(0);
|
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
|
if (tc && tc->targetAbi().os() == ProjectExplorer::Abi::WindowsOS
|
||||||
&& tc->targetAbi().osFlavor() != ProjectExplorer::Abi::WindowsMSysFlavor) {
|
&& tc->targetAbi().osFlavor() != ProjectExplorer::Abi::WindowsMSysFlavor) {
|
||||||
QLabel *msvcDebuggerConfigLabel = new QLabel;
|
QLabel *msvcDebuggerConfigLabel = new QLabel;
|
||||||
@@ -104,43 +104,42 @@ DebuggerProfileConfigWidget::DebuggerProfileConfigWidget(ProjectExplorer::Profil
|
|||||||
connect(m_chooser, SIGNAL(changed(QString)), this, SIGNAL(dirty()));
|
connect(m_chooser, SIGNAL(changed(QString)), this, SIGNAL(dirty()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DebuggerProfileConfigWidget::displayName() const
|
QString DebuggerKitConfigWidget::displayName() const
|
||||||
{
|
{
|
||||||
return tr("Debugger:");
|
return tr("Debugger:");
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerProfileConfigWidget::makeReadOnly()
|
void DebuggerKitConfigWidget::makeReadOnly()
|
||||||
{
|
{
|
||||||
m_chooser->setEnabled(false);
|
m_chooser->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerProfileConfigWidget::apply()
|
void DebuggerKitConfigWidget::apply()
|
||||||
{
|
{
|
||||||
Utils::FileName fn = m_chooser->fileName();
|
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);
|
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()));
|
m_chooser->setFileName(Utils::FileName::fromString(v.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
@@ -28,33 +28,33 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef DEBUGGER_DEBUGGERPROFILECONFIGWIDGET_H
|
#ifndef DEBUGGER_DEBUGGERKITCONFIGWIDGET_H
|
||||||
#define DEBUGGER_DEBUGGERPROFILECONFIGWIDGET_H
|
#define DEBUGGER_DEBUGGERKITCONFIGWIDGET_H
|
||||||
|
|
||||||
#include <projectexplorer/profileconfigwidget.h>
|
#include <projectexplorer/kitconfigwidget.h>
|
||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <debuggerprofileinformation.h>
|
#include <debuggerkitinformation.h>
|
||||||
|
|
||||||
namespace ProjectExplorer { class Profile; }
|
namespace ProjectExplorer { class Kit; }
|
||||||
namespace Utils { class PathChooser; }
|
namespace Utils { class PathChooser; }
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
class DebuggerProfileInformation;
|
class DebuggerKitInformation;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
// DebuggerProfileConfigWidget:
|
// DebuggerKitConfigWidget:
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
class DebuggerProfileConfigWidget : public ProjectExplorer::ProfileConfigWidget
|
class DebuggerKitConfigWidget : public ProjectExplorer::KitConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DebuggerProfileConfigWidget(ProjectExplorer::Profile *p,
|
DebuggerKitConfigWidget(ProjectExplorer::Kit *p,
|
||||||
const DebuggerProfileInformation *pi,
|
const DebuggerKitInformation *ki,
|
||||||
QWidget *parent = 0);
|
QWidget *parent = 0);
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
|
||||||
@@ -69,12 +69,12 @@ private slots:
|
|||||||
void autoDetectDebugger();
|
void autoDetectDebugger();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::Profile *m_profile;
|
ProjectExplorer::Kit *m_kit;
|
||||||
const DebuggerProfileInformation *m_info;
|
const DebuggerKitInformation *m_info;
|
||||||
Utils::PathChooser *m_chooser;
|
Utils::PathChooser *m_chooser;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Debugger
|
} // 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/abi.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
@@ -115,30 +115,30 @@ static QPair<QString, QString> autoDetectCdbDebugger()
|
|||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// DebuggerProfileInformation:
|
// DebuggerKitInformation:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
static const char DEBUGGER_INFORMATION[] = "Debugger.Information";
|
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);
|
static Core::Id id = Core::Id(DEBUGGER_INFORMATION);
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int DebuggerProfileInformation::priority() const
|
unsigned int DebuggerKitInformation::priority() const
|
||||||
{
|
{
|
||||||
return 28000;
|
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();
|
Abi abi = Abi::hostAbi();
|
||||||
if (tc)
|
if (tc)
|
||||||
abi = tc->targetAbi();
|
abi = tc->targetAbi();
|
||||||
@@ -166,11 +166,11 @@ QVariant DebuggerProfileInformation::defaultValue(Profile *p) const
|
|||||||
return env.searchInPath(debugger);
|
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);
|
const Core::Id id(Constants::TASK_CATEGORY_BUILDSYSTEM);
|
||||||
QList<Task> result;
|
QList<Task> result;
|
||||||
FileName dbg = debuggerCommand(p);
|
FileName dbg = debuggerCommand(k);
|
||||||
if (dbg.isEmpty()) {
|
if (dbg.isEmpty()) {
|
||||||
result << Task(Task::Warning, tr("No debugger set up."), FileName(), -1, id);
|
result << Task(Task::Warning, tr("No debugger set up."), FileName(), -1, id);
|
||||||
return result;
|
return result;
|
||||||
@@ -182,7 +182,7 @@ QList<Task> DebuggerProfileInformation::validate(Profile *p) const
|
|||||||
else if (!fi.isExecutable())
|
else if (!fi.isExecutable())
|
||||||
result << Task(Task::Error, tr("Debugger not exectutable."), FileName(), -1, id);
|
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.
|
// We need an absolute path to be able to locate Python on Windows.
|
||||||
const Abi abi = tc->targetAbi();
|
const Abi abi = tc->targetAbi();
|
||||||
if (abi.os() == Abi::WindowsOS && !fi.isAbsolute()) {
|
if (abi.os() == Abi::WindowsOS && !fi.isAbsolute()) {
|
||||||
@@ -202,25 +202,25 @@ QList<Task> DebuggerProfileInformation::validate(Profile *p) const
|
|||||||
return result;
|
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);
|
QTC_ASSERT(k, return);
|
||||||
p->setValue(Core::Id(DEBUGGER_INFORMATION), command.toString());
|
k->setValue(Core::Id(DEBUGGER_INFORMATION), command.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
@@ -28,38 +28,38 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef DEBUGGER_DEBUGGERPROFILEINFORMATION_H
|
#ifndef DEBUGGER_DEBUGGERKITINFORMATION_H
|
||||||
#define DEBUGGER_DEBUGGERPROFILEINFORMATION_H
|
#define DEBUGGER_DEBUGGERKITINFORMATION_H
|
||||||
|
|
||||||
#include "debugger_global.h"
|
#include "debugger_global.h"
|
||||||
|
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
|
|
||||||
class DEBUGGER_EXPORT DebuggerProfileInformation : public ProjectExplorer::ProfileInformation
|
class DEBUGGER_EXPORT DebuggerKitInformation : public ProjectExplorer::KitInformation
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DebuggerProfileInformation();
|
DebuggerKitInformation();
|
||||||
|
|
||||||
Core::Id dataId() const;
|
Core::Id dataId() const;
|
||||||
|
|
||||||
unsigned int priority() const; // the higher the closer to the top.
|
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 Utils::FileName debuggerCommand(const ProjectExplorer::Kit *k);
|
||||||
static void setDebuggerCommand(ProjectExplorer::Profile *p, const Utils::FileName &command);
|
static void setDebuggerCommand(ProjectExplorer::Kit *k, const Utils::FileName &command);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|
||||||
#endif // DEBUGGER_DEBUGGERPROFILEINFORMATION_H
|
#endif // DEBUGGER_DEBUGGERKITINFORMATION_H
|
@@ -41,7 +41,7 @@
|
|||||||
#include "debuggerrunner.h"
|
#include "debuggerrunner.h"
|
||||||
#include "debuggerruncontrolfactory.h"
|
#include "debuggerruncontrolfactory.h"
|
||||||
#include "debuggerstringutils.h"
|
#include "debuggerstringutils.h"
|
||||||
#include "debuggerprofileinformation.h"
|
#include "debuggerkitinformation.h"
|
||||||
#include "memoryagent.h"
|
#include "memoryagent.h"
|
||||||
#include "breakpoint.h"
|
#include "breakpoint.h"
|
||||||
#include "breakhandler.h"
|
#include "breakhandler.h"
|
||||||
@@ -101,9 +101,9 @@
|
|||||||
#include <projectexplorer/projectexplorersettings.h>
|
#include <projectexplorer/projectexplorersettings.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/session.h>
|
||||||
#include <projectexplorer/profilechooser.h>
|
#include <projectexplorer/kitchooser.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/profilemanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <projectexplorer/toolchainmanager.h>
|
#include <projectexplorer/toolchainmanager.h>
|
||||||
@@ -561,13 +561,13 @@ static inline QString executableForPid(qint64 pid)
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
class AbiProfileMatcher : public ProfileMatcher
|
class AbiKitMatcher : public KitMatcher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit AbiProfileMatcher(const QList<Abi> &abis) : m_abis(abis) {}
|
explicit AbiKitMatcher(const QList<Abi> &abis) : m_abis(abis) {}
|
||||||
bool matches(const Profile *p) const
|
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 m_abis.contains(tc->targetAbi());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -576,13 +576,13 @@ private:
|
|||||||
const QList<Abi> m_abis;
|
const QList<Abi> m_abis;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CompatibleAbiProfileMatcher : public ProfileMatcher
|
class CompatibleAbiKitMatcher : public KitMatcher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit CompatibleAbiProfileMatcher(const QList<Abi> &abis) : m_abis(abis) {}
|
explicit CompatibleAbiKitMatcher(const QList<Abi> &abis) : m_abis(abis) {}
|
||||||
bool matches(const Profile *p) const
|
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)
|
foreach (const Abi &a, m_abis)
|
||||||
if (a.isCompatibleWith(tc->targetAbi()))
|
if (a.isCompatibleWith(tc->targetAbi()))
|
||||||
return true;
|
return true;
|
||||||
@@ -593,14 +593,14 @@ private:
|
|||||||
const QList<Abi> m_abis;
|
const QList<Abi> m_abis;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CdbMatcher : ProfileMatcher
|
class CdbMatcher : KitMatcher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CdbMatcher(char wordWidth = 0) : m_wordWidth(wordWidth) {}
|
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);
|
QTC_ASSERT(tc, return false);
|
||||||
const Abi abi = tc->targetAbi();
|
const Abi abi = tc->targetAbi();
|
||||||
if (abi.architecture() != Abi::X86Architecture
|
if (abi.architecture() != Abi::X86Architecture
|
||||||
@@ -615,31 +615,31 @@ public:
|
|||||||
return true;
|
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.
|
// On a 64bit OS, prefer a 64bit debugger.
|
||||||
static Profile *findUniversalCdbProfile()
|
static Kit *findUniversalCdbKit()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
if (Utils::winIs64BitSystem()) {
|
if (Utils::winIs64BitSystem()) {
|
||||||
CdbMatcher matcher64(64);
|
CdbMatcher matcher64(64);
|
||||||
if (Profile *cdb64Profile = ProfileManager::instance()->find(&matcher64))
|
if (Kit *cdb64Kit = KitManager::instance()->find(&matcher64))
|
||||||
return cdb64Profile;
|
return cdb64Kit;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
CdbMatcher matcher;
|
CdbMatcher matcher;
|
||||||
return ProfileManager::instance()->find(&matcher);
|
return KitManager::instance()->find(&matcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const char m_wordWidth;
|
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
|
// This code can only be reached when starting via the command line
|
||||||
// (-debug pid or executable) or attaching from runconfiguration
|
// (-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;
|
QList<Abi> abis;
|
||||||
if (sp->toolChainAbi.isValid()) {
|
if (sp->toolChainAbi.isValid()) {
|
||||||
abis.push_back(sp->toolChainAbi);
|
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));
|
abis = Abi::abisOfBinary(Utils::FileName::fromString(sp->executable));
|
||||||
}
|
}
|
||||||
if (!abis.isEmpty()) {
|
if (!abis.isEmpty()) {
|
||||||
AbiProfileMatcher matcher(abis);
|
AbiKitMatcher matcher(abis);
|
||||||
profile = ProfileManager::instance()->find(&matcher);
|
kit = KitManager::instance()->find(&matcher);
|
||||||
if (!profile) {
|
if (!kit) {
|
||||||
CompatibleAbiProfileMatcher matcher(abis);
|
CompatibleAbiKitMatcher matcher(abis);
|
||||||
profile = ProfileManager::instance()->find(&matcher);
|
kit = KitManager::instance()->find(&matcher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!profile)
|
if (!kit)
|
||||||
profile = ProfileManager::instance()->defaultProfile();
|
kit = KitManager::instance()->defaultKit();
|
||||||
}
|
}
|
||||||
|
|
||||||
sp->sysRoot = SysRootProfileInformation::sysRoot(profile).toString();
|
sp->sysRoot = SysRootKitInformation::sysRoot(kit).toString();
|
||||||
sp->debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
sp->debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString();
|
||||||
|
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
ToolChain *tc = ToolChainKitInformation::toolChain(kit);
|
||||||
if (tc)
|
if (tc)
|
||||||
sp->toolChainAbi = tc->targetAbi();
|
sp->toolChainAbi = tc->targetAbi();
|
||||||
|
|
||||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
|
||||||
if (device) {
|
if (device) {
|
||||||
sp->connParams = device->sshParameters();
|
sp->connParams = device->sshParameters();
|
||||||
sp->remoteChannel = sp->connParams.host + QLatin1Char(':') + QString::number(sp->connParams.port);
|
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;
|
const QString &option = *it;
|
||||||
// '-debug <pid>'
|
// '-debug <pid>'
|
||||||
// '-debug <exe>[,server=<server:port>][,core=<core>][,profile=<profile>]'
|
// '-debug <exe>[,server=<server:port>][,core=<core>][,kit=<kit>]'
|
||||||
if (*it == _("-debug")) {
|
if (*it == _("-debug")) {
|
||||||
++it;
|
++it;
|
||||||
if (it == cend) {
|
if (it == cend) {
|
||||||
*errorMessage = msgParameterMissing(*it);
|
*errorMessage = msgParameterMissing(*it);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Profile *profile = 0;
|
Kit *kit = 0;
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
qulonglong pid = it->toULongLong();
|
qulonglong pid = it->toULongLong();
|
||||||
if (pid) {
|
if (pid) {
|
||||||
@@ -1433,12 +1433,12 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
|||||||
sp.displayName = tr("Core file \"%1\"").arg(sp.coreFile);
|
sp.displayName = tr("Core file \"%1\"").arg(sp.coreFile);
|
||||||
sp.startMessage = tr("Attaching to core file %1.").arg(sp.coreFile);
|
sp.startMessage = tr("Attaching to core file %1.").arg(sp.coreFile);
|
||||||
}
|
}
|
||||||
else if (key == QLatin1String("profile")) {
|
else if (key == QLatin1String("kit")) {
|
||||||
profile = ProfileManager::instance()->find(Id(val));
|
kit = KitManager::instance()->find(Id(val));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fillParameters(&sp, profile);
|
fillParameters(&sp, kit);
|
||||||
if (sp.startMode == StartExternal) {
|
if (sp.startMode == StartExternal) {
|
||||||
sp.displayName = tr("Executable file \"%1\"").arg(sp.executable);
|
sp.displayName = tr("Executable file \"%1\"").arg(sp.executable);
|
||||||
sp.startMessage = tr("Debugging 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;
|
return false;
|
||||||
}
|
}
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
fillParameters(&sp, CdbMatcher::findUniversalCdbProfile());
|
fillParameters(&sp, CdbMatcher::findUniversalCdbKit());
|
||||||
sp.startMode = AttachCrashedExternal;
|
sp.startMode = AttachCrashedExternal;
|
||||||
sp.crashParameter = it->section(QLatin1Char(':'), 0, 0);
|
sp.crashParameter = it->section(QLatin1Char(':'), 0, 0);
|
||||||
sp.attachPID = it->section(QLatin1Char(':'), 1, 1).toULongLong();
|
sp.attachPID = it->section(QLatin1Char(':'), 1, 1).toULongLong();
|
||||||
@@ -1579,7 +1579,7 @@ void DebuggerPluginPrivate::attachCore()
|
|||||||
{
|
{
|
||||||
AttachCoreDialog dlg(mainWindow());
|
AttachCoreDialog dlg(mainWindow());
|
||||||
|
|
||||||
dlg.setProfileId(Id(configValue(_("LastExternalProfile")).toString()));
|
dlg.setKitId(Id(configValue(_("LastExternalProfile")).toString()));
|
||||||
dlg.setLocalExecutableFile(configValue(_("LastExternalExecutableFile")).toString());
|
dlg.setLocalExecutableFile(configValue(_("LastExternalExecutableFile")).toString());
|
||||||
dlg.setLocalCoreFile(configValue(_("LastLocalCoreFile")).toString());
|
dlg.setLocalCoreFile(configValue(_("LastLocalCoreFile")).toString());
|
||||||
dlg.setRemoteCoreFile(configValue(_("LastRemoteCoreFile")).toString());
|
dlg.setRemoteCoreFile(configValue(_("LastRemoteCoreFile")).toString());
|
||||||
@@ -1591,12 +1591,12 @@ void DebuggerPluginPrivate::attachCore()
|
|||||||
setConfigValue(_("LastExternalExecutableFile"), dlg.localExecutableFile());
|
setConfigValue(_("LastExternalExecutableFile"), dlg.localExecutableFile());
|
||||||
setConfigValue(_("LastLocalCoreFile"), dlg.localCoreFile());
|
setConfigValue(_("LastLocalCoreFile"), dlg.localCoreFile());
|
||||||
setConfigValue(_("LastRemoteCoreFile"), dlg.remoteCoreFile());
|
setConfigValue(_("LastRemoteCoreFile"), dlg.remoteCoreFile());
|
||||||
setConfigValue(_("LastExternalProfile"), dlg.profile()->id().toString());
|
setConfigValue(_("LastExternalProfile"), dlg.kit()->id().toString());
|
||||||
setConfigValue(_("LastExternalStartScript"), dlg.overrideStartScript());
|
setConfigValue(_("LastExternalStartScript"), dlg.overrideStartScript());
|
||||||
|
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
QString display = dlg.isLocal() ? dlg.localCoreFile() : dlg.remoteCoreFile();
|
QString display = dlg.isLocal() ? dlg.localCoreFile() : dlg.remoteCoreFile();
|
||||||
fillParameters(&sp, dlg.profile());
|
fillParameters(&sp, dlg.kit());
|
||||||
sp.masterEngineType = GdbEngineType;
|
sp.masterEngineType = GdbEngineType;
|
||||||
sp.executable = dlg.localExecutableFile();
|
sp.executable = dlg.localExecutableFile();
|
||||||
sp.coreFile = dlg.localCoreFile();
|
sp.coreFile = dlg.localCoreFile();
|
||||||
@@ -1611,9 +1611,9 @@ void DebuggerPluginPrivate::startRemoteCdbSession()
|
|||||||
{
|
{
|
||||||
const QString connectionKey = _("CdbRemoteConnection");
|
const QString connectionKey = _("CdbRemoteConnection");
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
Profile *profile = CdbMatcher::findUniversalCdbProfile();
|
Kit *kit = CdbMatcher::findUniversalCdbKit();
|
||||||
QTC_ASSERT(profile, return);
|
QTC_ASSERT(kit, return);
|
||||||
fillParameters(&sp, profile);
|
fillParameters(&sp, kit);
|
||||||
sp.startMode = AttachToRemoteServer;
|
sp.startMode = AttachToRemoteServer;
|
||||||
sp.closeMode = KillAtClose;
|
sp.closeMode = KillAtClose;
|
||||||
StartRemoteCdbDialog dlg(mainWindow());
|
StartRemoteCdbDialog dlg(mainWindow());
|
||||||
@@ -1660,10 +1660,10 @@ void DebuggerPluginPrivate::attachToProcess(bool startServerOnly)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
ProfileChooser *profileChooser = dlg->profileChooser();
|
KitChooser *kitChooser = dlg->kitChooser();
|
||||||
Profile *profile = profileChooser->currentProfile();
|
Kit *kit = kitChooser->currentKit();
|
||||||
QTC_ASSERT(profile, return);
|
QTC_ASSERT(kit, return);
|
||||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
|
||||||
QTC_ASSERT(device, return);
|
QTC_ASSERT(device, return);
|
||||||
DeviceProcess process = dlg->currentProcess();
|
DeviceProcess process = dlg->currentProcess();
|
||||||
if (process.pid == 0) {
|
if (process.pid == 0) {
|
||||||
@@ -1683,7 +1683,7 @@ void DebuggerPluginPrivate::attachToProcess(bool startServerOnly)
|
|||||||
|
|
||||||
if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
fillParameters(&sp, profile);
|
fillParameters(&sp, kit);
|
||||||
sp.attachPID = process.pid;
|
sp.attachPID = process.pid;
|
||||||
sp.displayName = tr("Process %1").arg(process.pid);
|
sp.displayName = tr("Process %1").arg(process.pid);
|
||||||
sp.executable = process.exe;
|
sp.executable = process.exe;
|
||||||
@@ -1704,11 +1704,11 @@ void DebuggerPluginPrivate::attachExternalApplication(ProjectExplorer::RunContro
|
|||||||
sp.startMode = AttachExternal;
|
sp.startMode = AttachExternal;
|
||||||
sp.closeMode = DetachAtClose;
|
sp.closeMode = DetachAtClose;
|
||||||
sp.toolChainAbi = rc->abi();
|
sp.toolChainAbi = rc->abi();
|
||||||
Profile *profile = 0;
|
Kit *kit = 0;
|
||||||
if (const RunConfiguration *runConfiguration = rc->runConfiguration())
|
if (const RunConfiguration *runConfiguration = rc->runConfiguration())
|
||||||
if (const Target *target = runConfiguration->target())
|
if (const Target *target = runConfiguration->target())
|
||||||
profile = target->profile();
|
kit = target->kit();
|
||||||
fillParameters(&sp, profile);
|
fillParameters(&sp, kit);
|
||||||
DebuggerRunControlFactory::createAndScheduleRun(sp);
|
DebuggerRunControlFactory::createAndScheduleRun(sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1723,19 +1723,19 @@ void DebuggerPluginPrivate::attachToQmlPort()
|
|||||||
else
|
else
|
||||||
dlg.setPort(sp.qmlServerPort);
|
dlg.setPort(sp.qmlServerPort);
|
||||||
|
|
||||||
const QVariant profileId = configValue(_("LastProfile"));
|
const QVariant kitId = configValue(_("LastProfile"));
|
||||||
if (profileId.isValid())
|
if (kitId.isValid())
|
||||||
dlg.setProfileId(Id(profileId.toString()));
|
dlg.setKitId(Id(kitId.toString()));
|
||||||
|
|
||||||
if (dlg.exec() != QDialog::Accepted)
|
if (dlg.exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Profile *profile = dlg.profile();
|
Kit *kit = dlg.kit();
|
||||||
QTC_ASSERT(profile, return);
|
QTC_ASSERT(kit, return);
|
||||||
setConfigValue(_("LastQmlServerPort"), dlg.port());
|
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.qmlServerAddress = sp.connParams.host;
|
||||||
sp.qmlServerPort = dlg.port();
|
sp.qmlServerPort = dlg.port();
|
||||||
sp.startMode = AttachToRemoteProcess;
|
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_GENERAL);
|
||||||
mstart->addSeparator(globalcontext, Constants::G_SPECIAL);
|
mstart->addSeparator(globalcontext, Constants::G_SPECIAL);
|
||||||
|
|
||||||
ProfileManager::instance()->registerProfileInformation(new DebuggerProfileInformation);
|
KitManager::instance()->registerKitInformation(new DebuggerKitInformation);
|
||||||
|
|
||||||
return theDebuggerCore->initialize(arguments, errorMessage);
|
return theDebuggerCore->initialize(arguments, errorMessage);
|
||||||
}
|
}
|
||||||
@@ -3463,12 +3463,12 @@ static Target *activeTarget()
|
|||||||
return project->activeTarget();
|
return project->activeTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Profile *currentProfile()
|
static Kit *currentKit()
|
||||||
{
|
{
|
||||||
Target *t = activeTarget();
|
Target *t = activeTarget();
|
||||||
if (!t || !t->isEnabled())
|
if (!t || !t->isEnabled())
|
||||||
return 0;
|
return 0;
|
||||||
return activeTarget()->profile();
|
return activeTarget()->kit();
|
||||||
}
|
}
|
||||||
|
|
||||||
static LocalApplicationRunConfiguration *activeLocalRunConfiguration()
|
static LocalApplicationRunConfiguration *activeLocalRunConfiguration()
|
||||||
@@ -3516,7 +3516,7 @@ void DebuggerPluginPrivate::testPythonDumpers1()
|
|||||||
void DebuggerPluginPrivate::testPythonDumpers2()
|
void DebuggerPluginPrivate::testPythonDumpers2()
|
||||||
{
|
{
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
fillParameters(&sp, currentProfile());
|
fillParameters(&sp, currentKit());
|
||||||
sp.executable = activeLocalRunConfiguration()->executable();
|
sp.executable = activeLocalRunConfiguration()->executable();
|
||||||
testRunProject(sp, TestCallBack(this, "testPythonDumpers3"));
|
testRunProject(sp, TestCallBack(this, "testPythonDumpers3"));
|
||||||
}
|
}
|
||||||
@@ -3548,7 +3548,7 @@ void DebuggerPluginPrivate::testStateMachine1()
|
|||||||
void DebuggerPluginPrivate::testStateMachine2()
|
void DebuggerPluginPrivate::testStateMachine2()
|
||||||
{
|
{
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
fillParameters(&sp, currentProfile());
|
fillParameters(&sp, currentKit());
|
||||||
sp.executable = activeLocalRunConfiguration()->executable();
|
sp.executable = activeLocalRunConfiguration()->executable();
|
||||||
sp.testCase = TestNoBoundsOfCurrentFunction;
|
sp.testCase = TestNoBoundsOfCurrentFunction;
|
||||||
testRunProject(sp, TestCallBack(this, "testStateMachine3"));
|
testRunProject(sp, TestCallBack(this, "testStateMachine3"));
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
#include "debuggerplugin.h"
|
#include "debuggerplugin.h"
|
||||||
#include "debuggerstringutils.h"
|
#include "debuggerstringutils.h"
|
||||||
#include "debuggerstartparameters.h"
|
#include "debuggerstartparameters.h"
|
||||||
#include "debuggerprofileinformation.h"
|
#include "debuggerkitinformation.h"
|
||||||
#include "lldb/lldbenginehost.h"
|
#include "lldb/lldbenginehost.h"
|
||||||
#include "debuggertooltipmanager.h"
|
#include "debuggertooltipmanager.h"
|
||||||
|
|
||||||
@@ -485,8 +485,8 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
|
|||||||
QTC_ASSERT(rc, return sp);
|
QTC_ASSERT(rc, return sp);
|
||||||
|
|
||||||
Target *target = runConfiguration->target();
|
Target *target = runConfiguration->target();
|
||||||
Profile *profile = target ? target->profile() : ProfileManager::instance()->defaultProfile();
|
Kit *kit = target ? target->kit() : KitManager::instance()->defaultKit();
|
||||||
fillParameters(&sp, profile);
|
fillParameters(&sp, kit);
|
||||||
sp.environment = rc->environment();
|
sp.environment = rc->environment();
|
||||||
sp.workingDirectory = rc->workingDirectory();
|
sp.workingDirectory = rc->workingDirectory();
|
||||||
|
|
||||||
@@ -624,7 +624,7 @@ static void fixupEngineTypes(DebuggerStartParameters &sp, RunConfiguration *rc)
|
|||||||
if (rc) {
|
if (rc) {
|
||||||
DebuggerRunConfigurationAspect *aspect = rc->debuggerAspect();
|
DebuggerRunConfigurationAspect *aspect = rc->debuggerAspect();
|
||||||
if (const Target *target = rc->target())
|
if (const Target *target = rc->target())
|
||||||
fillParameters(&sp, target->profile());
|
fillParameters(&sp, target->kit());
|
||||||
const bool useCppDebugger = aspect->useCppDebugger();
|
const bool useCppDebugger = aspect->useCppDebugger();
|
||||||
const bool useQmlDebugger = aspect->useQmlDebugger();
|
const bool useQmlDebugger = aspect->useQmlDebugger();
|
||||||
if (useQmlDebugger) {
|
if (useQmlDebugger) {
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
#include <projectexplorer/profile.h>
|
#include <projectexplorer/kit.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
@@ -140,7 +140,7 @@ public:
|
|||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
void fillParameters(DebuggerStartParameters *sp, const ProjectExplorer::Profile *profile = 0);
|
void fillParameters(DebuggerStartParameters *sp, const ProjectExplorer::Kit *kit = 0);
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
@@ -33,14 +33,14 @@
|
|||||||
#include "debuggercore.h"
|
#include "debuggercore.h"
|
||||||
#include "debuggermainwindow.h"
|
#include "debuggermainwindow.h"
|
||||||
#include "debuggerplugin.h"
|
#include "debuggerplugin.h"
|
||||||
#include "debuggerprofileinformation.h"
|
#include "debuggerkitinformation.h"
|
||||||
#include "debuggerrunner.h"
|
#include "debuggerrunner.h"
|
||||||
#include "debuggerruncontrolfactory.h"
|
#include "debuggerruncontrolfactory.h"
|
||||||
#include "debuggerstartparameters.h"
|
#include "debuggerstartparameters.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <projectexplorer/profilechooser.h>
|
#include <projectexplorer/kitchooser.h>
|
||||||
#include <projectexplorer/devicesupport/deviceprocesslist.h>
|
#include <projectexplorer/devicesupport/deviceprocesslist.h>
|
||||||
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
DeviceProcessesDialog *dialog;
|
DeviceProcessesDialog *dialog;
|
||||||
bool startServerOnly;
|
bool startServerOnly;
|
||||||
DeviceProcess process;
|
DeviceProcess process;
|
||||||
Profile *profile;
|
Kit *kit;
|
||||||
IDevice::ConstPtr device;
|
IDevice::ConstPtr device;
|
||||||
|
|
||||||
DeviceUsedPortsGatherer gatherer;
|
DeviceUsedPortsGatherer gatherer;
|
||||||
@@ -81,9 +81,9 @@ GdbServerStarter::GdbServerStarter(DeviceProcessesDialog *dlg, bool startServerO
|
|||||||
{
|
{
|
||||||
d = new StartGdbServerDialogPrivate;
|
d = new StartGdbServerDialogPrivate;
|
||||||
d->dialog = dlg;
|
d->dialog = dlg;
|
||||||
d->profile = dlg->profileChooser()->currentProfile();
|
d->kit = dlg->kitChooser()->currentKit();
|
||||||
d->process = dlg->currentProcess();
|
d->process = dlg->currentProcess();
|
||||||
d->device = DeviceProfileInformation::device(d->profile);
|
d->device = DeviceKitInformation::device(d->kit);
|
||||||
d->startServerOnly = startServerOnly;
|
d->startServerOnly = startServerOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ void GdbServerStarter::handleProcessErrorOutput()
|
|||||||
|
|
||||||
void GdbServerStarter::attach(int port)
|
void GdbServerStarter::attach(int port)
|
||||||
{
|
{
|
||||||
QString sysroot = SysRootProfileInformation::sysRoot(d->profile).toString();
|
QString sysroot = SysRootKitInformation::sysRoot(d->kit).toString();
|
||||||
QString binary;
|
QString binary;
|
||||||
QString localExecutable;
|
QString localExecutable;
|
||||||
QString candidate = sysroot + d->process.exe;
|
QString candidate = sysroot + d->process.exe;
|
||||||
@@ -207,7 +207,7 @@ void GdbServerStarter::attach(int port)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
fillParameters(&sp, d->profile);
|
fillParameters(&sp, d->kit);
|
||||||
sp.masterEngineType = GdbEngineType;
|
sp.masterEngineType = GdbEngineType;
|
||||||
sp.connParams.port = port;
|
sp.connParams.port = port;
|
||||||
sp.displayName = tr("Remote: \"%1:%2\"").arg(sp.connParams.host).arg(port);
|
sp.displayName = tr("Remote: \"%1:%2\"").arg(sp.connParams.host).arg(port);
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
#define STARTGDBSERVERDIALOG_H
|
#define STARTGDBSERVERDIALOG_H
|
||||||
|
|
||||||
#include "debugger_global.h"
|
#include "debugger_global.h"
|
||||||
#include <projectexplorer/profile.h>
|
#include <projectexplorer/kit.h>
|
||||||
#include <projectexplorer/devicesupport/deviceprocessesdialog.h>
|
#include <projectexplorer/devicesupport/deviceprocessesdialog.h>
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
|
@@ -36,8 +36,8 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
#include <projectexplorer/profilechooser.h>
|
#include <projectexplorer/kitchooser.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
#include <ssh/sshremoteprocessrunner.h>
|
#include <ssh/sshremoteprocessrunner.h>
|
||||||
#include <ssh/sftpdefs.h>
|
#include <ssh/sftpdefs.h>
|
||||||
@@ -93,7 +93,7 @@ class SelectRemoteFileDialog : public QDialog
|
|||||||
public:
|
public:
|
||||||
explicit SelectRemoteFileDialog(QWidget *parent);
|
explicit SelectRemoteFileDialog(QWidget *parent);
|
||||||
|
|
||||||
void attachToDevice(Profile *profile);
|
void attachToDevice(Kit *k);
|
||||||
QString localFile() const { return m_localFile; }
|
QString localFile() const { return m_localFile; }
|
||||||
QString remoteFile() const { return m_remoteFile; }
|
QString remoteFile() const { return m_remoteFile; }
|
||||||
|
|
||||||
@@ -151,11 +151,11 @@ SelectRemoteFileDialog::SelectRemoteFileDialog(QWidget *parent)
|
|||||||
SLOT(handleConnectionError(QString)));
|
SLOT(handleConnectionError(QString)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectRemoteFileDialog::attachToDevice(Profile *profile)
|
void SelectRemoteFileDialog::attachToDevice(Kit *k)
|
||||||
{
|
{
|
||||||
m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||||
QTC_ASSERT(profile, return);
|
QTC_ASSERT(k, return);
|
||||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
IDevice::ConstPtr device = DeviceKitInformation::device(k);
|
||||||
QTC_ASSERT(device, return);
|
QTC_ASSERT(device, return);
|
||||||
QSsh::SshConnectionParameters sshParams = device->sshParameters();
|
QSsh::SshConnectionParameters sshParams = device->sshParameters();
|
||||||
m_fileSystemModel.setSshConnection(sshParams);
|
m_fileSystemModel.setSshConnection(sshParams);
|
||||||
@@ -223,7 +223,7 @@ void SelectRemoteFileDialog::selectFile()
|
|||||||
class AttachCoreDialogPrivate
|
class AttachCoreDialogPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ProfileChooser *profileChooser;
|
KitChooser *kitChooser;
|
||||||
|
|
||||||
QSettings *settings;
|
QSettings *settings;
|
||||||
|
|
||||||
@@ -245,7 +245,7 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
|
|||||||
|
|
||||||
d->settings = ICore::settings();
|
d->settings = ICore::settings();
|
||||||
|
|
||||||
d->profileChooser = new ProfileChooser(this);
|
d->kitChooser = new KitChooser(this);
|
||||||
|
|
||||||
d->selectRemoteCoreButton = new QPushButton(tr("Browse..."), this);
|
d->selectRemoteCoreButton = new QPushButton(tr("Browse..."), this);
|
||||||
d->remoteCoreFileName = new QLineEdit(this);
|
d->remoteCoreFileName = new QLineEdit(this);
|
||||||
@@ -277,7 +277,7 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
|
|||||||
formLayout->setContentsMargins(0, 0, 0, 0);
|
formLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
formLayout->setHorizontalSpacing(6);
|
formLayout->setHorizontalSpacing(6);
|
||||||
formLayout->setVerticalSpacing(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("&Executable:"), d->localExecFileName);
|
||||||
formLayout->addRow(tr("Core file:"), coreLayout);
|
formLayout->addRow(tr("Core file:"), coreLayout);
|
||||||
formLayout->addRow(tr("Override &start script:"), d->overrideStartScriptFileName);
|
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->selectRemoteCoreButton, SIGNAL(clicked()), SLOT(selectRemoteCoreFile()));
|
||||||
connect(d->remoteCoreFileName, SIGNAL(textChanged(QString)), SLOT(changed()));
|
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(rejected()), SLOT(reject()));
|
||||||
connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept()));
|
connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept()));
|
||||||
}
|
}
|
||||||
@@ -308,19 +308,19 @@ AttachCoreDialog::~AttachCoreDialog()
|
|||||||
|
|
||||||
bool AttachCoreDialog::isLocal() const
|
bool AttachCoreDialog::isLocal() const
|
||||||
{
|
{
|
||||||
Profile *profile = d->profileChooser->currentProfile();
|
Kit *k = d->kitChooser->currentKit();
|
||||||
QTC_ASSERT(profile, return false);
|
QTC_ASSERT(k, return false);
|
||||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
IDevice::ConstPtr device = DeviceKitInformation::device(k);
|
||||||
QTC_ASSERT(device, return false);
|
QTC_ASSERT(device, return false);
|
||||||
SshConnectionParameters sshParams = device->sshParameters();
|
SshConnectionParameters sshParams = device->sshParameters();
|
||||||
d->settings->setValue(QLatin1String("LastProfile"),
|
d->settings->setValue(QLatin1String("LastProfile"),
|
||||||
d->profileChooser->currentProfileId().toString());
|
d->kitChooser->currentKitId().toString());
|
||||||
return sshParams.host.isEmpty();
|
return sshParams.host.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttachCoreDialog::changed()
|
void AttachCoreDialog::changed()
|
||||||
{
|
{
|
||||||
bool isValid = d->profileChooser->currentIndex() >= 0
|
bool isValid = d->kitChooser->currentIndex() >= 0
|
||||||
&& !localCoreFile().isEmpty();
|
&& !localCoreFile().isEmpty();
|
||||||
d->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(isValid);
|
d->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(isValid);
|
||||||
|
|
||||||
@@ -341,7 +341,7 @@ void AttachCoreDialog::selectRemoteCoreFile()
|
|||||||
QTC_ASSERT(!isLocal(), return);
|
QTC_ASSERT(!isLocal(), return);
|
||||||
SelectRemoteFileDialog dlg(this);
|
SelectRemoteFileDialog dlg(this);
|
||||||
dlg.setWindowTitle(tr("Select Remote Core File"));
|
dlg.setWindowTitle(tr("Select Remote Core File"));
|
||||||
dlg.attachToDevice(d->profileChooser->currentProfile());
|
dlg.attachToDevice(d->kitChooser->currentKit());
|
||||||
if (dlg.exec() == QDialog::Rejected)
|
if (dlg.exec() == QDialog::Rejected)
|
||||||
return;
|
return;
|
||||||
d->localCoreFileName->setPath(dlg.localFile());
|
d->localCoreFileName->setPath(dlg.localFile());
|
||||||
@@ -379,15 +379,15 @@ QString AttachCoreDialog::remoteCoreFile() const
|
|||||||
return d->remoteCoreFileName->text();
|
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();
|
changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *AttachCoreDialog::profile() const
|
Kit *AttachCoreDialog::kit() const
|
||||||
{
|
{
|
||||||
return d->profileChooser->currentProfile();
|
return d->kitChooser->currentKit();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AttachCoreDialog::overrideStartScript() const
|
QString AttachCoreDialog::overrideStartScript() const
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
namespace Core { class Id; }
|
namespace Core { class Id; }
|
||||||
namespace ProjectExplorer { class Profile; }
|
namespace ProjectExplorer { class Kit; }
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -56,12 +56,12 @@ public:
|
|||||||
bool isLocal() const;
|
bool isLocal() const;
|
||||||
|
|
||||||
// For persistance.
|
// For persistance.
|
||||||
ProjectExplorer::Profile *profile() const;
|
ProjectExplorer::Kit *kit() const;
|
||||||
void setLocalExecutableFile(const QString &executable);
|
void setLocalExecutableFile(const QString &executable);
|
||||||
void setLocalCoreFile(const QString &core);
|
void setLocalCoreFile(const QString &core);
|
||||||
void setRemoteCoreFile(const QString &core);
|
void setRemoteCoreFile(const QString &core);
|
||||||
void setOverrideStartScript(const QString &scriptName);
|
void setOverrideStartScript(const QString &scriptName);
|
||||||
void setProfileId(const Core::Id &id);
|
void setKitId(const Core::Id &id);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void changed();
|
void changed();
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
#include "genericproject.h"
|
#include "genericproject.h"
|
||||||
|
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
@@ -113,7 +113,7 @@ BuildConfigWidget *GenericBuildConfiguration::createConfigWidget()
|
|||||||
|
|
||||||
IOutputParser *GenericBuildConfiguration::createOutputParser() const
|
IOutputParser *GenericBuildConfiguration::createOutputParser() const
|
||||||
{
|
{
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(target()->profile());
|
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
||||||
return tc ? tc->outputParser() : 0;
|
return tc ? tc->outputParser() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ BuildConfiguration *GenericBuildConfigurationFactory::restore(Target *parent, co
|
|||||||
|
|
||||||
bool GenericBuildConfigurationFactory::canHandle(const Target *t) const
|
bool GenericBuildConfigurationFactory::canHandle(const Target *t) const
|
||||||
{
|
{
|
||||||
if (!t->project()->supportsProfile(t->profile()))
|
if (!t->project()->supportsKit(t->kit()))
|
||||||
return false;
|
return false;
|
||||||
return qobject_cast<GenericProject *>(t->project());
|
return qobject_cast<GenericProject *>(t->project());
|
||||||
}
|
}
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/gnumakeparser.h>
|
#include <projectexplorer/gnumakeparser.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
@@ -119,7 +119,7 @@ bool GenericMakeStep::init()
|
|||||||
setIgnoreReturnValue(m_clean);
|
setIgnoreReturnValue(m_clean);
|
||||||
|
|
||||||
setOutputParser(new GnuMakeParser());
|
setOutputParser(new GnuMakeParser());
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(bc->target()->profile());
|
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
||||||
if (tc)
|
if (tc)
|
||||||
appendOutputParser(tc->outputParser());
|
appendOutputParser(tc->outputParser());
|
||||||
outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory());
|
outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory());
|
||||||
@@ -169,7 +169,7 @@ QString GenericMakeStep::makeCommand() const
|
|||||||
{
|
{
|
||||||
QString command = m_makeCommand;
|
QString command = m_makeCommand;
|
||||||
if (command.isEmpty()) {
|
if (command.isEmpty()) {
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(target()->profile());
|
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
||||||
if (tc)
|
if (tc)
|
||||||
command = tc->makeCommand();
|
command = tc->makeCommand();
|
||||||
else
|
else
|
||||||
@@ -243,7 +243,7 @@ GenericMakeStepConfigWidget::GenericMakeStepConfigWidget(GenericMakeStep *makeSt
|
|||||||
connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
|
connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
|
||||||
this, SLOT(updateDetails()));
|
this, SLOT(updateDetails()));
|
||||||
|
|
||||||
connect(m_makeStep->target(), SIGNAL(profileChanged()),
|
connect(m_makeStep->target(), SIGNAL(kitChanged()),
|
||||||
this, SLOT(updateMakeOverrrideLabel()));
|
this, SLOT(updateMakeOverrrideLabel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,8 +43,8 @@
|
|||||||
#include <projectexplorer/buildenvironmentwidget.h>
|
#include <projectexplorer/buildenvironmentwidget.h>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/headerpath.h>
|
#include <projectexplorer/headerpath.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/profilemanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <qtsupport/customexecutablerunconfiguration.h>
|
#include <qtsupport/customexecutablerunconfiguration.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
@@ -250,7 +250,7 @@ void GenericProject::refresh(RefreshOptions options)
|
|||||||
new CPlusPlus::CppModelManagerInterface::ProjectPart);
|
new CPlusPlus::CppModelManagerInterface::ProjectPart);
|
||||||
|
|
||||||
ToolChain *tc = activeTarget() ?
|
ToolChain *tc = activeTarget() ?
|
||||||
ToolChainProfileInformation::toolChain(activeTarget()->profile()) : 0;
|
ToolChainKitInformation::toolChain(activeTarget()->kit()) : 0;
|
||||||
if (tc) {
|
if (tc) {
|
||||||
part->defines = tc->predefinedMacros(QStringList());
|
part->defines = tc->predefinedMacros(QStringList());
|
||||||
part->defines += '\n';
|
part->defines += '\n';
|
||||||
@@ -430,9 +430,9 @@ bool GenericProject::fromMap(const QVariantMap &map)
|
|||||||
if (!Project::fromMap(map))
|
if (!Project::fromMap(map))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Profile *defaultProfile = ProfileManager::instance()->defaultProfile();
|
Kit *defaultKit = KitManager::instance()->defaultKit();
|
||||||
if (!activeTarget() && defaultProfile)
|
if (!activeTarget() && defaultKit)
|
||||||
addTarget(createTarget(defaultProfile));
|
addTarget(createTarget(defaultKit));
|
||||||
|
|
||||||
// Sanity check: We need both a buildconfiguration and a runconfiguration!
|
// Sanity check: We need both a buildconfiguration and a runconfiguration!
|
||||||
QList<Target *> targetList = targets();
|
QList<Target *> targetList = targets();
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <utils/filesystemwatcher.h>
|
#include <utils/filesystemwatcher.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -612,7 +612,7 @@ DebianManager::ActionStatus DebianManager::createTemplate(Qt4ProjectManager::Qt4
|
|||||||
<< (packageName + QLatin1Char('_')
|
<< (packageName + QLatin1Char('_')
|
||||||
+ AbstractMaemoPackageCreationStep::DefaultVersionNumber);
|
+ AbstractMaemoPackageCreationStep::DefaultVersionNumber);
|
||||||
|
|
||||||
QtSupport::BaseQtVersion *lqt = QtSupport::QtProfileInformation::qtVersion(bc->target()->profile());
|
QtSupport::BaseQtVersion *lqt = QtSupport::QtKitInformation::qtVersion(bc->target()->kit());
|
||||||
if (!lqt) {
|
if (!lqt) {
|
||||||
raiseError(tr("Unable to create Debian templates: No Qt version set."));
|
raiseError(tr("Unable to create Debian templates: No Qt version set."));
|
||||||
return ActionFailed;
|
return ActionFailed;
|
||||||
@@ -653,7 +653,7 @@ DebianManager::ActionStatus DebianManager::createTemplate(Qt4ProjectManager::Qt4
|
|||||||
|
|
||||||
setPackageName(debianDir, packageName);
|
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 sec = section(deviceType);
|
||||||
const QByteArray nameField = packageManagerNameFieldName(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());
|
Utils::FileName path = Utils::FileName::fromString(target->project()->projectDirectory());
|
||||||
path.appendPath(PackagingDirName);
|
path.appendPath(PackagingDirName);
|
||||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target->profile());
|
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target->kit());
|
||||||
if (deviceType == HarmattanOsType)
|
if (deviceType == HarmattanOsType)
|
||||||
path.appendPath(QLatin1String("debian_harmattan"));
|
path.appendPath(QLatin1String("debian_harmattan"));
|
||||||
else if (deviceType == Maemo5OsType)
|
else if (deviceType == Maemo5OsType)
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
#include "maemoqemumanager.h"
|
#include "maemoqemumanager.h"
|
||||||
|
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <remotelinux/abstractremotelinuxdeployservice.h>
|
#include <remotelinux/abstractremotelinuxdeployservice.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
MaemoQemuRuntime rt;
|
MaemoQemuRuntime rt;
|
||||||
const int qtId = QtSupport::QtProfileInformation::qtVersionId(profile());
|
const int qtId = QtSupport::QtKitInformation::qtVersionId(profile());
|
||||||
if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) {
|
if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) {
|
||||||
MaemoQemuManager::instance().startRuntime();
|
MaemoQemuManager::instance().startRuntime();
|
||||||
emit errorMessage(tr("Cannot deploy: Qemu was not running. "
|
emit errorMessage(tr("Cannot deploy: Qemu was not running. "
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
#include "maemoqemumanager.h"
|
#include "maemoqemumanager.h"
|
||||||
|
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <remotelinux/abstractuploadandinstallpackageservice.h>
|
#include <remotelinux/abstractuploadandinstallpackageservice.h>
|
||||||
#include <remotelinux/remotelinuxdeployconfiguration.h>
|
#include <remotelinux/remotelinuxdeployconfiguration.h>
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
@@ -117,7 +117,7 @@ MaemoUploadAndInstallPackageStep::MaemoUploadAndInstallPackageStep(ProjectExplor
|
|||||||
void MaemoUploadAndInstallPackageStep::ctor()
|
void MaemoUploadAndInstallPackageStep::ctor()
|
||||||
{
|
{
|
||||||
setDefaultDisplayName(displayName());
|
setDefaultDisplayName(displayName());
|
||||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||||
if (deviceType == HarmattanOsType)
|
if (deviceType == HarmattanOsType)
|
||||||
m_deployService = new HarmattanUploadAndInstallPackageAction(this);
|
m_deployService = new HarmattanUploadAndInstallPackageAction(this);
|
||||||
else
|
else
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
#include "maemoconstants.h"
|
#include "maemoconstants.h"
|
||||||
#include "qt4maemodeployconfiguration.h"
|
#include "qt4maemodeployconfiguration.h"
|
||||||
|
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qt4projectmanager/qt4nodes.h>
|
#include <qt4projectmanager/qt4nodes.h>
|
||||||
#include <remotelinux/deployablefile.h>
|
#include <remotelinux/deployablefile.h>
|
||||||
@@ -130,7 +130,7 @@ void MaemoDeployConfigurationWidget::addDesktopFile()
|
|||||||
DeployableFile d;
|
DeployableFile d;
|
||||||
d.remoteDir = QLatin1String("/usr/share/applications");
|
d.remoteDir = QLatin1String("/usr/share/applications");
|
||||||
Core::Id deviceType
|
Core::Id deviceType
|
||||||
= ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(deployConfiguration()->target()->profile());
|
= ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(deployConfiguration()->target()->kit());
|
||||||
if (deviceType == Maemo5OsType)
|
if (deviceType == Maemo5OsType)
|
||||||
d.remoteDir += QLatin1String("/hildon");
|
d.remoteDir += QLatin1String("/hildon");
|
||||||
d.localFilePath = desktopFilePath;
|
d.localFilePath = desktopFilePath;
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
#include "maemoremotemounter.h"
|
#include "maemoremotemounter.h"
|
||||||
|
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
@@ -63,15 +63,15 @@ MaemoDeploymentMounter::~MaemoDeploymentMounter() {}
|
|||||||
|
|
||||||
void MaemoDeploymentMounter::setupMounts(SshConnection *connection,
|
void MaemoDeploymentMounter::setupMounts(SshConnection *connection,
|
||||||
const QList<MaemoMountSpecification> &mountSpecs,
|
const QList<MaemoMountSpecification> &mountSpecs,
|
||||||
const Profile *profile)
|
const Kit *k)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_state == Inactive, return);
|
QTC_ASSERT(m_state == Inactive, return);
|
||||||
|
|
||||||
m_mountSpecs = mountSpecs;
|
m_mountSpecs = mountSpecs;
|
||||||
m_connection = connection;
|
m_connection = connection;
|
||||||
m_profile = profile;
|
m_kit = k;
|
||||||
m_devConf = DeviceProfileInformation::device(profile);
|
m_devConf = DeviceKitInformation::device(k);
|
||||||
m_mounter->setParameters(m_devConf, MaemoGlobal::maddeRoot(profile));
|
m_mounter->setParameters(m_devConf, MaemoGlobal::maddeRoot(k));
|
||||||
connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError()));
|
connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError()));
|
||||||
setState(UnmountingOldDirs);
|
setState(UnmountingOldDirs);
|
||||||
unmount();
|
unmount();
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
#include <utils/portlist.h>
|
#include <utils/portlist.h>
|
||||||
|
|
||||||
namespace ProjectExplorer { class Profile; }
|
namespace ProjectExplorer { class Kit; }
|
||||||
namespace QSsh { class SshConnection; }
|
namespace QSsh { class SshConnection; }
|
||||||
namespace Utils { class FileName; }
|
namespace Utils { class FileName; }
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ public:
|
|||||||
// Connection must be in connected state.
|
// Connection must be in connected state.
|
||||||
void setupMounts(QSsh::SshConnection *connection,
|
void setupMounts(QSsh::SshConnection *connection,
|
||||||
const QList<MaemoMountSpecification> &mountSpecs,
|
const QList<MaemoMountSpecification> &mountSpecs,
|
||||||
const ProjectExplorer::Profile *profile);
|
const ProjectExplorer::Kit *k);
|
||||||
void tearDownMounts();
|
void tearDownMounts();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -86,7 +86,7 @@ private:
|
|||||||
ProjectExplorer::IDevice::ConstPtr m_devConf;
|
ProjectExplorer::IDevice::ConstPtr m_devConf;
|
||||||
MaemoRemoteMounter * const m_mounter;
|
MaemoRemoteMounter * const m_mounter;
|
||||||
QList<MaemoMountSpecification> m_mountSpecs;
|
QList<MaemoMountSpecification> m_mountSpecs;
|
||||||
const ProjectExplorer::Profile *m_profile;
|
const ProjectExplorer::Kit *m_kit;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -41,7 +41,7 @@
|
|||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
#include <remotelinux/genericdirectuploadstep.h>
|
#include <remotelinux/genericdirectuploadstep.h>
|
||||||
#include <remotelinux/remotelinuxcheckforfreediskspacestep.h>
|
#include <remotelinux/remotelinuxcheckforfreediskspacestep.h>
|
||||||
@@ -69,7 +69,7 @@ QList<Core::Id> MaemoDeployStepFactory::availableCreationIds(BuildStepList *pare
|
|||||||
return ids;
|
return ids;
|
||||||
|
|
||||||
QString platform;
|
QString platform;
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(parent->target()->profile());
|
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(parent->target()->kit());
|
||||||
if (version)
|
if (version)
|
||||||
platform = version->platformName();
|
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)
|
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)
|
if (id == MaemoInstallDebianPackageToSysrootStep::Id)
|
||||||
return new MaemoInstallDebianPackageToSysrootStep(parent);
|
return new MaemoInstallDebianPackageToSysrootStep(parent);
|
||||||
|
@@ -33,11 +33,11 @@
|
|||||||
#include "maemoqemumanager.h"
|
#include "maemoqemumanager.h"
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <remotelinux/remotelinux_constants.h>
|
#include <remotelinux/remotelinux_constants.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
|
|
||||||
@@ -58,9 +58,9 @@ namespace {
|
|||||||
static const QLatin1String binQmake("/bin/qmake" EXEC_SUFFIX);
|
static const QLatin1String binQmake("/bin/qmake" EXEC_SUFFIX);
|
||||||
} // namespace
|
} // 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())
|
if (dev.isNull())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -68,9 +68,9 @@ bool MaemoGlobal::hasMaemoDevice(const Profile *p)
|
|||||||
return type == Maemo5OsType || type == HarmattanOsType;
|
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;
|
return type == Maemo5OsType || type == HarmattanOsType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ QString MaemoGlobal::devrootshPath()
|
|||||||
|
|
||||||
int MaemoGlobal::applicationIconSize(const Target *target)
|
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;
|
return deviceType == HarmattanOsType ? 80 : 64;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,10 +144,10 @@ QString MaemoGlobal::remoteSourceProfilesCommand()
|
|||||||
return QString::fromAscii(remoteCall);
|
return QString::fromAscii(remoteCall);
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::PortList MaemoGlobal::freePorts(const Profile *profile)
|
Utils::PortList MaemoGlobal::freePorts(const Kit *k)
|
||||||
{
|
{
|
||||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
IDevice::ConstPtr device = DeviceKitInformation::device(k);
|
||||||
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtProfileInformation::qtVersion(profile);
|
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(k);
|
||||||
|
|
||||||
if (!device || !qtVersion)
|
if (!device || !qtVersion)
|
||||||
return Utils::PortList();
|
return Utils::PortList();
|
||||||
@@ -167,9 +167,9 @@ QString MaemoGlobal::maddeRoot(const QString &qmakePath)
|
|||||||
return dir.absolutePath();
|
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)
|
QString MaemoGlobal::targetRoot(const QString &qmakePath)
|
||||||
|
@@ -45,7 +45,7 @@ class QProcess;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
class Profile;
|
class Kit;
|
||||||
class Target;
|
class Target;
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
@@ -81,8 +81,8 @@ class MaemoGlobal
|
|||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::MaemoGlobal)
|
Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::MaemoGlobal)
|
||||||
public:
|
public:
|
||||||
static bool hasMaemoDevice(const ProjectExplorer::Profile *p);
|
static bool hasMaemoDevice(const ProjectExplorer::Kit *k);
|
||||||
static bool supportsMaemoDevice(const ProjectExplorer::Profile *p);
|
static bool supportsMaemoDevice(const ProjectExplorer::Kit *p);
|
||||||
static bool isValidMaemo5QtVersion(const QString &qmakePath);
|
static bool isValidMaemo5QtVersion(const QString &qmakePath);
|
||||||
static bool isValidHarmattanQtVersion(const QString &qmakePath);
|
static bool isValidHarmattanQtVersion(const QString &qmakePath);
|
||||||
|
|
||||||
@@ -91,12 +91,12 @@ public:
|
|||||||
static int applicationIconSize(const ProjectExplorer::Target *target);
|
static int applicationIconSize(const ProjectExplorer::Target *target);
|
||||||
static QString remoteSudo(Core::Id deviceType, const QString &uname);
|
static QString remoteSudo(Core::Id deviceType, const QString &uname);
|
||||||
static QString remoteSourceProfilesCommand();
|
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 addMaddeEnvironment(Utils::Environment &env, const QString &qmakePath);
|
||||||
static void transformMaddeCall(QString &command, QStringList &args, const QString &qmakePath);
|
static void transformMaddeCall(QString &command, QStringList &args, const QString &qmakePath);
|
||||||
static QString maddeRoot(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 targetRoot(const QString &qmakePath);
|
||||||
static QString targetName(const QString &qmakePath);
|
static QString targetName(const QString &qmakePath);
|
||||||
static QString madCommand(const QString &qmakePath);
|
static QString madCommand(const QString &qmakePath);
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <remotelinux/deploymentinfo.h>
|
#include <remotelinux/deploymentinfo.h>
|
||||||
#include <remotelinux/remotelinuxdeployconfiguration.h>
|
#include <remotelinux/remotelinuxdeployconfiguration.h>
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ bool AbstractMaemoInstallPackageToSysrootStep::init()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
|
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||||
if (!version) {
|
if (!version) {
|
||||||
addOutput(tr("Cannot install package to sysroot without a Qt version."),
|
addOutput(tr("Cannot install package to sysroot without a Qt version."),
|
||||||
ErrorMessageOutput);
|
ErrorMessageOutput);
|
||||||
@@ -235,7 +235,7 @@ QStringList MaemoInstallDebianPackageToSysrootStep::madArguments() const
|
|||||||
{
|
{
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("xdpkg");
|
args << QLatin1String("xdpkg");
|
||||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||||
if (deviceType == HarmattanOsType)
|
if (deviceType == HarmattanOsType)
|
||||||
args << QLatin1String("--no-force-downgrade");
|
args << QLatin1String("--no-force-downgrade");
|
||||||
args << QLatin1String("-i");
|
args << QLatin1String("-i");
|
||||||
@@ -274,13 +274,13 @@ bool MaemoCopyToSysrootStep::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const MaemoQtVersion *const qtVersion
|
const MaemoQtVersion *const qtVersion
|
||||||
= dynamic_cast<MaemoQtVersion *>(QtSupport::QtProfileInformation::qtVersion(target()->profile()));
|
= dynamic_cast<MaemoQtVersion *>(QtSupport::QtKitInformation::qtVersion(target()->kit()));
|
||||||
if (!qtVersion) {
|
if (!qtVersion) {
|
||||||
addOutput(tr("Cannot copy to sysroot without valid Qt version."),
|
addOutput(tr("Cannot copy to sysroot without valid Qt version."),
|
||||||
ErrorMessageOutput);
|
ErrorMessageOutput);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(target()->profile()).toString();
|
m_systemRoot = ProjectExplorer::SysRootKitInformation::sysRoot(target()->kit()).toString();
|
||||||
|
|
||||||
const DeploymentInfo * const deploymentInfo
|
const DeploymentInfo * const deploymentInfo
|
||||||
= static_cast<RemoteLinuxDeployConfiguration *>(deployConfiguration())->deploymentInfo();
|
= static_cast<RemoteLinuxDeployConfiguration *>(deployConfiguration())->deploymentInfo();
|
||||||
@@ -352,7 +352,7 @@ bool MaemoMakeInstallToSysrootStep::init()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const QtSupport::BaseQtVersion *const qtVersion
|
const QtSupport::BaseQtVersion *const qtVersion
|
||||||
= QtSupport::QtProfileInformation::qtVersion(target()->profile());
|
= QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||||
if (!qtVersion) {
|
if (!qtVersion) {
|
||||||
addOutput("Cannot deploy: Unusable build configuration.",
|
addOutput("Cannot deploy: Unusable build configuration.",
|
||||||
ErrorMessageOutput);
|
ErrorMessageOutput);
|
||||||
@@ -363,8 +363,8 @@ bool MaemoMakeInstallToSysrootStep::init()
|
|||||||
MaemoGlobal::addMaddeEnvironment(env, qtVersion->qmakeCommand().toString());
|
MaemoGlobal::addMaddeEnvironment(env, qtVersion->qmakeCommand().toString());
|
||||||
QString command = MaemoGlobal::madCommand(qtVersion->qmakeCommand().toString());
|
QString command = MaemoGlobal::madCommand(qtVersion->qmakeCommand().toString());
|
||||||
QString systemRoot;
|
QString systemRoot;
|
||||||
if (ProjectExplorer::SysRootProfileInformation::hasSysRoot(target()->profile()))
|
if (ProjectExplorer::SysRootKitInformation::hasSysRoot(target()->kit()))
|
||||||
systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(target()->profile()).toString();
|
systemRoot = ProjectExplorer::SysRootKitInformation::sysRoot(target()->kit()).toString();
|
||||||
QStringList args = QStringList() << QLatin1String("-t")
|
QStringList args = QStringList() << QLatin1String("-t")
|
||||||
<< MaemoGlobal::targetName(qtVersion->qmakeCommand().toString()) << QLatin1String("make")
|
<< MaemoGlobal::targetName(qtVersion->qmakeCommand().toString()) << QLatin1String("make")
|
||||||
<< QLatin1String("install") << (QLatin1String("INSTALL_ROOT=") + systemRoot);
|
<< QLatin1String("install") << (QLatin1String("INSTALL_ROOT=") + systemRoot);
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/deployconfiguration.h>
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <qt4projectmanager/qt4project.h>
|
#include <qt4projectmanager/qt4project.h>
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -96,7 +96,7 @@ bool AbstractMaemoPackageCreationStep::init()
|
|||||||
QLatin1String("nostrip"), QLatin1String(" "));
|
QLatin1String("nostrip"), QLatin1String(" "));
|
||||||
}
|
}
|
||||||
|
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
|
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||||
if (!version) {
|
if (!version) {
|
||||||
raiseError(tr("Packaging failed: No Qt version."));
|
raiseError(tr("Packaging failed: No Qt version."));
|
||||||
return false;
|
return false;
|
||||||
@@ -236,7 +236,7 @@ void AbstractMaemoPackageCreationStep::preparePackagingProcess(QProcess *proc,
|
|||||||
|
|
||||||
QString AbstractMaemoPackageCreationStep::replaceDots(const QString &name) const
|
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 ...).
|
// Idiotic OVI store requirement for N900 (but not allowed for N9 ...).
|
||||||
if (deviceType == Maemo5OsType) {
|
if (deviceType == Maemo5OsType) {
|
||||||
QString adaptedName = name;
|
QString adaptedName = name;
|
||||||
@@ -274,7 +274,7 @@ bool MaemoDebianPackageCreationStep::init()
|
|||||||
{
|
{
|
||||||
if (!AbstractMaemoPackageCreationStep::init())
|
if (!AbstractMaemoPackageCreationStep::init())
|
||||||
return false;
|
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_maddeRoot = MaemoGlobal::maddeRoot(version->qmakeCommand().toString());
|
||||||
m_projectDirectory = project()->projectDirectory();
|
m_projectDirectory = project()->projectDirectory();
|
||||||
m_pkgFileName = DebianManager::packageFileName(DebianManager::debianDirectory(target())).toString();
|
m_pkgFileName = DebianManager::packageFileName(DebianManager::debianDirectory(target())).toString();
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
#include "maemopackagecreationstep.h"
|
#include "maemopackagecreationstep.h"
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
@@ -71,7 +71,7 @@ void MaemoPackageCreationWidget::initGui()
|
|||||||
{
|
{
|
||||||
m_ui->shortDescriptionLineEdit->setMaxLength(60);
|
m_ui->shortDescriptionLineEdit->setMaxLength(60);
|
||||||
updateVersionInfo();
|
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 Utils::FileName path = DebianManager::debianDirectory(m_step->target());
|
||||||
const QSize iconSize = MaddeDevice::packageManagerIconSize(deviceType);
|
const QSize iconSize = MaddeDevice::packageManagerIconSize(deviceType);
|
||||||
m_ui->packageManagerIconButton->setFixedSize(iconSize);
|
m_ui->packageManagerIconButton->setFixedSize(iconSize);
|
||||||
@@ -170,7 +170,7 @@ void MaemoPackageCreationWidget::updatePackageManagerName()
|
|||||||
{
|
{
|
||||||
const Utils::FileName path = DebianManager::debianDirectory(m_step->target());
|
const Utils::FileName path = DebianManager::debianDirectory(m_step->target());
|
||||||
Core::Id deviceType
|
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));
|
m_ui->packageManagerNameLineEdit->setText(DebianManager::packageManagerName(path, deviceType));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ void MaemoPackageCreationWidget::setPackageManagerIcon()
|
|||||||
{
|
{
|
||||||
const Utils::FileName path = DebianManager::debianDirectory(m_step->target());
|
const Utils::FileName path = DebianManager::debianDirectory(m_step->target());
|
||||||
Core::Id deviceType
|
Core::Id deviceType
|
||||||
= ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(m_step->target()->profile());
|
= ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(m_step->target()->kit());
|
||||||
QString imageFilter = tr("Images") + QLatin1String("( ");
|
QString imageFilter = tr("Images") + QLatin1String("( ");
|
||||||
const QList<QByteArray> &imageTypes = QImageReader::supportedImageFormats();
|
const QList<QByteArray> &imageTypes = QImageReader::supportedImageFormats();
|
||||||
foreach (const QByteArray &imageType, imageTypes)
|
foreach (const QByteArray &imageType, imageTypes)
|
||||||
@@ -215,7 +215,7 @@ void MaemoPackageCreationWidget::setPackageManagerName()
|
|||||||
{
|
{
|
||||||
const Utils::FileName path = DebianManager::debianDirectory(m_step->target());
|
const Utils::FileName path = DebianManager::debianDirectory(m_step->target());
|
||||||
Core::Id deviceType
|
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())) {
|
if (!DebianManager::setPackageManagerName(path, deviceType, m_ui->packageManagerNameLineEdit->text())) {
|
||||||
QMessageBox::critical(this, tr("File Error"),
|
QMessageBox::critical(this, tr("File Error"),
|
||||||
tr("Could not set package name for project manager."));
|
tr("Could not set package name for project manager."));
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
#include <qt4projectmanager/qmakestep.h>
|
#include <qt4projectmanager/qmakestep.h>
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <remotelinux/deployablefilesperprofile.h>
|
#include <remotelinux/deployablefilesperprofile.h>
|
||||||
#include <remotelinux/deploymentinfo.h>
|
#include <remotelinux/deploymentinfo.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
@@ -311,10 +311,10 @@ void MaemoPublisherFremantleFree::handleProcessFinished(bool failedToStart)
|
|||||||
setState(RunningMakeDistclean);
|
setState(RunningMakeDistclean);
|
||||||
// Toolchain might be null! (yes because this sucks)
|
// Toolchain might be null! (yes because this sucks)
|
||||||
ProjectExplorer::ToolChain *tc
|
ProjectExplorer::ToolChain *tc
|
||||||
= ProjectExplorer::ToolChainProfileInformation::toolChain(m_buildConfig->target()->profile());
|
= ProjectExplorer::ToolChainKitInformation::toolChain(m_buildConfig->target()->kit());
|
||||||
if (!tc) {
|
if (!tc) {
|
||||||
finishWithFailure(QString(), tr("Make distclean failed: %1")
|
finishWithFailure(QString(), tr("Make distclean failed: %1")
|
||||||
.arg(ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget()));
|
.arg(ProjectExplorer::ToolChainKitInformation::msgNoToolChainInTarget()));
|
||||||
}
|
}
|
||||||
m_process->start(tc->makeCommand(), QStringList() << QLatin1String("distclean"));
|
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)
|
if (!lqt)
|
||||||
finishWithFailure(QString(), tr("No Qt version set."));
|
finishWithFailure(QString(), tr("No Qt version set."));
|
||||||
|
|
||||||
@@ -606,7 +606,7 @@ QStringList MaemoPublisherFremantleFree::findProblems() const
|
|||||||
QStringList problems;
|
QStringList problems;
|
||||||
ProjectExplorer::Target *target = m_buildConfig->target();
|
ProjectExplorer::Target *target = m_buildConfig->target();
|
||||||
Core::Id deviceType
|
Core::Id deviceType
|
||||||
= ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target->profile());
|
= ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target->kit());
|
||||||
if (deviceType != Maemo5OsType)
|
if (deviceType != Maemo5OsType)
|
||||||
return QStringList();
|
return QStringList();
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(c
|
|||||||
m_buildConfigs.clear();
|
m_buildConfigs.clear();
|
||||||
|
|
||||||
foreach (const Target *const target, project->targets()) {
|
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))
|
if (!version || version->platformName() != QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM))
|
||||||
continue;
|
continue;
|
||||||
foreach (BuildConfiguration *const bc, target->buildConfigurations()) {
|
foreach (BuildConfiguration *const bc, target->buildConfigurations()) {
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
#include <qt4projectmanager/qt4project.h>
|
#include <qt4projectmanager/qt4project.h>
|
||||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -71,7 +71,7 @@ bool MaemoPublishingWizardFactoryFremantleFree::canCreateWizard(const Project *p
|
|||||||
if (!qobject_cast<const Qt4Project *>(project))
|
if (!qobject_cast<const Qt4Project *>(project))
|
||||||
return false;
|
return false;
|
||||||
foreach (const Target *const target, project->targets()) {
|
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();
|
const QString &platform = version ? version->platformName() : QString();
|
||||||
if (platform == QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM))
|
if (platform == QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM))
|
||||||
return true;
|
return true;
|
||||||
|
@@ -48,7 +48,7 @@
|
|||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/session.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtversionmanager.h>
|
#include <qtsupport/qtversionmanager.h>
|
||||||
#include <remotelinux/remotelinuxrunconfiguration.h>
|
#include <remotelinux/remotelinuxrunconfiguration.h>
|
||||||
#include <utils/filesystemwatcher.h>
|
#include <utils/filesystemwatcher.h>
|
||||||
@@ -246,23 +246,23 @@ void MaemoQemuManager::projectChanged(ProjectExplorer::Project *project)
|
|||||||
|
|
||||||
void MaemoQemuManager::targetAdded(ProjectExplorer::Target *target)
|
void MaemoQemuManager::targetAdded(ProjectExplorer::Target *target)
|
||||||
{
|
{
|
||||||
if (!target || !MaemoGlobal::hasMaemoDevice(target->profile()))
|
if (!target || !MaemoGlobal::hasMaemoDevice(target->kit()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// handle the Qt version changes the build configuration uses
|
// handle the Qt version changes the build configuration uses
|
||||||
connect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
|
connect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
|
||||||
connect(target, SIGNAL(profileChanged()), this, SLOT(systemChanged()));
|
connect(target, SIGNAL(kitChanged()), this, SLOT(systemChanged()));
|
||||||
|
|
||||||
toggleStarterButton(target);
|
toggleStarterButton(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoQemuManager::targetRemoved(ProjectExplorer::Target *target)
|
void MaemoQemuManager::targetRemoved(ProjectExplorer::Target *target)
|
||||||
{
|
{
|
||||||
if (!target || !MaemoGlobal::hasMaemoDevice(target->profile()))
|
if (!target || !MaemoGlobal::hasMaemoDevice(target->kit()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
disconnect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
|
disconnect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
|
||||||
disconnect(target, SIGNAL(profileChanged()), this, SLOT(systemChanged()));
|
disconnect(target, SIGNAL(kitChanged()), this, SLOT(systemChanged()));
|
||||||
|
|
||||||
showOrHideQemuButton();
|
showOrHideQemuButton();
|
||||||
}
|
}
|
||||||
@@ -459,7 +459,7 @@ void MaemoQemuManager::toggleStarterButton(Target *target)
|
|||||||
{
|
{
|
||||||
int uniqueId = -1;
|
int uniqueId = -1;
|
||||||
if (target) {
|
if (target) {
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target->profile());
|
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
|
||||||
if (version)
|
if (version)
|
||||||
uniqueId = version->uniqueId();
|
uniqueId = version->uniqueId();
|
||||||
}
|
}
|
||||||
@@ -474,7 +474,7 @@ void MaemoQemuManager::toggleStarterButton(Target *target)
|
|||||||
const Project * const p
|
const Project * const p
|
||||||
= ProjectExplorerPlugin::instance()->session()->startupProject();
|
= ProjectExplorerPlugin::instance()->session()->startupProject();
|
||||||
const bool qemuButtonEnabled
|
const bool qemuButtonEnabled
|
||||||
= p && p->activeTarget() && MaemoGlobal::hasMaemoDevice(target->profile())
|
= p && p->activeTarget() && MaemoGlobal::hasMaemoDevice(target->kit())
|
||||||
&& m_runtimes.value(uniqueId, MaemoQemuRuntime()).isValid()
|
&& m_runtimes.value(uniqueId, MaemoQemuRuntime()).isValid()
|
||||||
&& targetUsesMatchingRuntimeConfig(target) && !isRunning;
|
&& targetUsesMatchingRuntimeConfig(target) && !isRunning;
|
||||||
m_qemuAction->setEnabled(qemuButtonEnabled);
|
m_qemuAction->setEnabled(qemuButtonEnabled);
|
||||||
@@ -487,7 +487,7 @@ bool MaemoQemuManager::sessionHasMaemoTarget() const
|
|||||||
const QList<Project*> &projects = explorer->session()->projects();
|
const QList<Project*> &projects = explorer->session()->projects();
|
||||||
foreach (const Project *p, projects) {
|
foreach (const Project *p, projects) {
|
||||||
foreach (const Target * const target, p->targets()) {
|
foreach (const Target * const target, p->targets()) {
|
||||||
if (MaemoGlobal::hasMaemoDevice(target->profile()))
|
if (MaemoGlobal::hasMaemoDevice(target->kit()))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -507,13 +507,13 @@ bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target,
|
|||||||
if (!mrc)
|
if (!mrc)
|
||||||
return false;
|
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())
|
if (!version || !m_runtimes.value(version->uniqueId(), MaemoQemuRuntime()).isValid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (qtVersion)
|
if (qtVersion)
|
||||||
*qtVersion = version;
|
*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;
|
return !config.isNull() && config->machineType() == IDevice::Emulator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
#include "maemoconstants.h"
|
#include "maemoconstants.h"
|
||||||
#include "maemoglobal.h"
|
#include "maemoglobal.h"
|
||||||
|
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
@@ -163,13 +163,13 @@ QString MaemoQtVersion::platformDisplayName() const
|
|||||||
return QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM_TR);
|
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());
|
const QString maddeRoot = MaemoGlobal::maddeRoot(qmakeCommand().toString());
|
||||||
|
|
||||||
// Needed to make pkg-config stuff work.
|
// 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.prependOrSet(QLatin1String("SYSROOT_DIR"), sysRoot.toUserOutput());
|
||||||
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madbin")
|
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madbin")
|
||||||
.arg(maddeRoot)));
|
.arg(maddeRoot)));
|
||||||
|
@@ -49,7 +49,7 @@ public:
|
|||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
QList<ProjectExplorer::Abi> detectQtAbis() 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;
|
QString description() const;
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include <debugger/debuggerconstants.h>
|
#include <debugger/debuggerconstants.h>
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
@@ -77,7 +77,7 @@ void MaemoRunConfiguration::init()
|
|||||||
SLOT(handleRemoteMountsChanged()));
|
SLOT(handleRemoteMountsChanged()));
|
||||||
connect(m_remoteMounts, SIGNAL(modelReset()), SLOT(handleRemoteMountsChanged()));
|
connect(m_remoteMounts, SIGNAL(modelReset()), SLOT(handleRemoteMountsChanged()));
|
||||||
|
|
||||||
if (DeviceTypeProfileInformation::deviceTypeId(target()->profile()) != HarmattanOsType)
|
if (DeviceTypeKitInformation::deviceTypeId(target()->kit()) != HarmattanOsType)
|
||||||
debuggerAspect()->suppressQmlDebuggingOptions();
|
debuggerAspect()->suppressQmlDebuggingOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ QString MaemoRunConfiguration::environmentPreparationCommand() const
|
|||||||
|
|
||||||
QString MaemoRunConfiguration::commandPrefix() const
|
QString MaemoRunConfiguration::commandPrefix() const
|
||||||
{
|
{
|
||||||
IDevice::ConstPtr dev = DeviceProfileInformation::device(target()->profile());
|
IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit());
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
@@ -130,13 +130,13 @@ QString MaemoRunConfiguration::commandPrefix() const
|
|||||||
|
|
||||||
Utils::PortList MaemoRunConfiguration::freePorts() const
|
Utils::PortList MaemoRunConfiguration::freePorts() const
|
||||||
{
|
{
|
||||||
return MaemoGlobal::freePorts(target()->profile());
|
return MaemoGlobal::freePorts(target()->kit());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MaemoRunConfiguration::hasEnoughFreePorts(RunMode mode) const
|
bool MaemoRunConfiguration::hasEnoughFreePorts(RunMode mode) const
|
||||||
{
|
{
|
||||||
const int freePortCount = freePorts().count();
|
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 bool remoteMountsAllowed = MaddeDevice::allowsRemoteMounts(typeId);
|
||||||
const int mountDirCount = remoteMountsAllowed
|
const int mountDirCount = remoteMountsAllowed
|
||||||
? remoteMounts()->validMountSpecificationCount() : 0;
|
? remoteMounts()->validMountSpecificationCount() : 0;
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <projectexplorer/environmentwidget.h>
|
#include <projectexplorer/environmentwidget.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <remotelinux/remotelinuxrunconfigurationwidget.h>
|
#include <remotelinux/remotelinuxrunconfigurationwidget.h>
|
||||||
@@ -82,12 +82,12 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
|||||||
QVBoxLayout *subLayout = new QVBoxLayout(m_subWidget);
|
QVBoxLayout *subLayout = new QVBoxLayout(m_subWidget);
|
||||||
subLayout->setMargin(0);
|
subLayout->setMargin(0);
|
||||||
addMountWidgets(subLayout);
|
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()),
|
connect(m_runConfiguration->debuggerAspect(), SIGNAL(debuggersChanged()),
|
||||||
SLOT(updateMountWarning()));
|
SLOT(updateMountWarning()));
|
||||||
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));
|
m_mountDetailsContainer->setVisible(MaddeDevice::allowsRemoteMounts(devId));
|
||||||
|
|
||||||
connect(m_runConfiguration, SIGNAL(enabledChanged()),
|
connect(m_runConfiguration, SIGNAL(enabledChanged()),
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
#include <debugger/debuggerplugin.h>
|
#include <debugger/debuggerplugin.h>
|
||||||
#include <debugger/debuggerrunner.h>
|
#include <debugger/debuggerrunner.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/profileinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qt4projectmanager/qt4nodes.h>
|
#include <qt4projectmanager/qt4nodes.h>
|
||||||
#include <qt4projectmanager/qt4project.h>
|
#include <qt4projectmanager/qt4project.h>
|
||||||
@@ -69,9 +69,9 @@ QString pathFromId(Core::Id id)
|
|||||||
template<class Receiver> void setHelperActions(Receiver *receiver, MaemoRunConfiguration *runConfig,
|
template<class Receiver> void setHelperActions(Receiver *receiver, MaemoRunConfiguration *runConfig,
|
||||||
RunControl *runControl)
|
RunControl *runControl)
|
||||||
{
|
{
|
||||||
const Profile * const profile = runConfig->target()->profile();
|
const Kit * const k = runConfig->target()->kit();
|
||||||
MaemoPreRunAction * const preRunAction = new MaemoPreRunAction(
|
MaemoPreRunAction * const preRunAction = new MaemoPreRunAction(
|
||||||
DeviceProfileInformation::device(profile), MaemoGlobal::maddeRoot(profile),
|
DeviceKitInformation::device(k), MaemoGlobal::maddeRoot(k),
|
||||||
runConfig->remoteMounts()->mountSpecs(), runControl);
|
runConfig->remoteMounts()->mountSpecs(), runControl);
|
||||||
MaemoPostRunAction * const postRunAction
|
MaemoPostRunAction * const postRunAction
|
||||||
= new MaemoPostRunAction(preRunAction->mounter(), runControl);
|
= new MaemoPostRunAction(preRunAction->mounter(), runControl);
|
||||||
@@ -165,11 +165,11 @@ RunConfiguration *MaemoRunConfigurationFactory::clone(Target *parent, RunConfigu
|
|||||||
|
|
||||||
bool MaemoRunConfigurationFactory::canHandle(Target *t) const
|
bool MaemoRunConfigurationFactory::canHandle(Target *t) const
|
||||||
{
|
{
|
||||||
if (!t->project()->supportsProfile(t->profile()))
|
if (!t->project()->supportsKit(t->kit()))
|
||||||
return false;
|
return false;
|
||||||
if (!qobject_cast<Qt4Project *>(t->project()))
|
if (!qobject_cast<Qt4Project *>(t->project()))
|
||||||
return false;
|
return false;
|
||||||
Core::Id devType = DeviceTypeProfileInformation::deviceTypeId(t->profile());
|
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(t->kit());
|
||||||
return devType == Maemo5OsType || devType == HarmattanOsType;
|
return devType == Maemo5OsType || devType == HarmattanOsType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <qt4projectmanager/qt4project.h>
|
#include <qt4projectmanager/qt4project.h>
|
||||||
#include <qtsupport/qtprofileinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
#include <remotelinux/deployablefile.h>
|
#include <remotelinux/deployablefile.h>
|
||||||
#include <remotelinux/deployablefilesperprofile.h>
|
#include <remotelinux/deployablefilesperprofile.h>
|
||||||
@@ -121,7 +121,7 @@ DeploymentSettingsAssistant *Qt4MaemoDeployConfiguration::deploymentSettingsAssi
|
|||||||
|
|
||||||
QString Qt4MaemoDeployConfiguration::qmakeScope() const
|
QString Qt4MaemoDeployConfiguration::qmakeScope() const
|
||||||
{
|
{
|
||||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||||
|
|
||||||
if (deviceType == Maemo5OsType)
|
if (deviceType == Maemo5OsType)
|
||||||
return QLatin1String("maemo5");
|
return QLatin1String("maemo5");
|
||||||
@@ -132,7 +132,7 @@ QString Qt4MaemoDeployConfiguration::qmakeScope() const
|
|||||||
|
|
||||||
QString Qt4MaemoDeployConfiguration::installPrefix() const
|
QString Qt4MaemoDeployConfiguration::installPrefix() const
|
||||||
{
|
{
|
||||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||||
|
|
||||||
if (deviceType == Maemo5OsType)
|
if (deviceType == Maemo5OsType)
|
||||||
return QLatin1String("/opt");
|
return QLatin1String("/opt");
|
||||||
@@ -159,7 +159,7 @@ void Qt4MaemoDeployConfiguration::setupPackaging()
|
|||||||
void Qt4MaemoDeployConfiguration::setupDebianPackaging()
|
void Qt4MaemoDeployConfiguration::setupDebianPackaging()
|
||||||
{
|
{
|
||||||
Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration());
|
Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration());
|
||||||
if (!bc || !target()->profile())
|
if (!bc || !target()->kit())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Utils::FileName debianDir = DebianManager::debianDirectory(target());
|
Utils::FileName debianDir = DebianManager::debianDirectory(target());
|
||||||
@@ -176,7 +176,7 @@ void Qt4MaemoDeployConfiguration::setupDebianPackaging()
|
|||||||
if (status == DebianManager::NoActionRequired)
|
if (status == DebianManager::NoActionRequired)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile());
|
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit());
|
||||||
QString projectName = target()->project()->displayName();
|
QString projectName = target()->project()->displayName();
|
||||||
|
|
||||||
if (!DebianManager::hasPackageManagerIcon(debianDir)) {
|
if (!DebianManager::hasPackageManagerIcon(debianDir)) {
|
||||||
@@ -269,7 +269,7 @@ QList<Core::Id> Qt4MaemoDeployConfigurationFactory::availableCreationIds(Target
|
|||||||
if (!canHandle(parent))
|
if (!canHandle(parent))
|
||||||
return ids;
|
return ids;
|
||||||
|
|
||||||
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->profile());
|
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit());
|
||||||
if (deviceType == Maemo5OsType)
|
if (deviceType == Maemo5OsType)
|
||||||
ids << Qt4MaemoDeployConfiguration::fremantleWithPackagingId()
|
ids << Qt4MaemoDeployConfiguration::fremantleWithPackagingId()
|
||||||
<< Qt4MaemoDeployConfiguration::fremantleWithoutPackagingId();
|
<< Qt4MaemoDeployConfiguration::fremantleWithoutPackagingId();
|
||||||
@@ -330,7 +330,7 @@ bool Qt4MaemoDeployConfigurationFactory::canRestore(Target *parent, const QVaria
|
|||||||
Core::Id id = idFromMap(map);
|
Core::Id id = idFromMap(map);
|
||||||
return canHandle(parent)
|
return canHandle(parent)
|
||||||
&& (availableCreationIds(parent).contains(id) || id == OldDeployConfigId)
|
&& (availableCreationIds(parent).contains(id) || id == OldDeployConfigId)
|
||||||
&& MaemoGlobal::supportsMaemoDevice(parent->profile());
|
&& MaemoGlobal::supportsMaemoDevice(parent->kit());
|
||||||
}
|
}
|
||||||
|
|
||||||
DeployConfiguration *Qt4MaemoDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map)
|
DeployConfiguration *Qt4MaemoDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map)
|
||||||
@@ -338,7 +338,7 @@ DeployConfiguration *Qt4MaemoDeployConfigurationFactory::restore(Target *parent,
|
|||||||
if (!canRestore(parent, map))
|
if (!canRestore(parent, map))
|
||||||
return 0;
|
return 0;
|
||||||
Core::Id id = idFromMap(map);
|
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 (id == OldDeployConfigId) {
|
||||||
if (deviceType == Maemo5OsType)
|
if (deviceType == Maemo5OsType)
|
||||||
id = Qt4MaemoDeployConfiguration::fremantleWithPackagingId();
|
id = Qt4MaemoDeployConfiguration::fremantleWithPackagingId();
|
||||||
@@ -367,9 +367,9 @@ bool Qt4MaemoDeployConfigurationFactory::canHandle(Target *parent) const
|
|||||||
{
|
{
|
||||||
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
|
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
|
||||||
return false;
|
return false;
|
||||||
if (!parent->project()->supportsProfile(parent->profile()))
|
if (!parent->project()->supportsKit(parent->kit()))
|
||||||
return false;
|
return false;
|
||||||
return MaemoGlobal::supportsMaemoDevice(parent->profile());
|
return MaemoGlobal::supportsMaemoDevice(parent->kit());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
#include "buildsteplist.h"
|
#include "buildsteplist.h"
|
||||||
#include "projectexplorer.h"
|
#include "projectexplorer.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
#include "profilemanager.h"
|
#include "kitmanager.h"
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
|
|
||||||
@@ -92,8 +92,8 @@ BuildConfiguration::BuildConfiguration(Target *target, const Core::Id id) :
|
|||||||
bsl->setDefaultDisplayName(tr("Clean"));
|
bsl->setDefaultDisplayName(tr("Clean"));
|
||||||
m_stepLists.append(bsl);
|
m_stepLists.append(bsl);
|
||||||
|
|
||||||
connect(ProfileManager::instance(), SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
connect(KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||||
this, SLOT(handleProfileUpdate(ProjectExplorer::Profile*)));
|
this, SLOT(handleKitUpdate(ProjectExplorer::Kit*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildConfiguration::BuildConfiguration(Target *target, BuildConfiguration *source) :
|
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
|
// otherwise BuildStepFactories might reject to set up a BuildStep for us
|
||||||
// since we are not yet the derived class!
|
// since we are not yet the derived class!
|
||||||
|
|
||||||
connect(ProfileManager::instance(), SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
connect(KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||||
this, SLOT(handleProfileUpdate(ProjectExplorer::Profile*)));
|
this, SLOT(handleKitUpdate(ProjectExplorer::Kit*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildConfiguration::~BuildConfiguration()
|
BuildConfiguration::~BuildConfiguration()
|
||||||
@@ -187,9 +187,9 @@ bool BuildConfiguration::fromMap(const QVariantMap &map)
|
|||||||
return ProjectConfiguration::fromMap(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;
|
return;
|
||||||
emit environmentChanged();
|
emit environmentChanged();
|
||||||
}
|
}
|
||||||
|
@@ -47,7 +47,7 @@ namespace ProjectExplorer {
|
|||||||
class BuildConfiguration;
|
class BuildConfiguration;
|
||||||
class BuildConfigWidget;
|
class BuildConfigWidget;
|
||||||
class BuildStepList;
|
class BuildStepList;
|
||||||
class Profile;
|
class Kit;
|
||||||
class Target;
|
class Target;
|
||||||
class IOutputParser;
|
class IOutputParser;
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ protected:
|
|||||||
virtual bool fromMap(const QVariantMap &map);
|
virtual bool fromMap(const QVariantMap &map);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleProfileUpdate(ProjectExplorer::Profile *p);
|
void handleKitUpdate(ProjectExplorer::Kit *p);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_clearSystemEnvironment;
|
bool m_clearSystemEnvironment;
|
||||||
|
@@ -173,7 +173,7 @@ BuildSettingsWidget::BuildSettingsWidget(Target *target) :
|
|||||||
connect(m_target, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
connect(m_target, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
||||||
this, SLOT(updateActiveConfiguration()));
|
this, SLOT(updateActiveConfiguration()));
|
||||||
|
|
||||||
connect(m_target, SIGNAL(profileChanged()), this, SLOT(updateAddButtonMenu()));
|
connect(m_target, SIGNAL(kitChanged()), this, SLOT(updateAddButtonMenu()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildSettingsWidget::addSubWidget(BuildConfigWidget *widget)
|
void BuildSettingsWidget::addSubWidget(BuildConfigWidget *widget)
|
||||||
|
@@ -48,7 +48,7 @@ QString CodeStyleSettingsPanelFactory::id() const
|
|||||||
|
|
||||||
QString CodeStyleSettingsPanelFactory::displayName() const
|
QString CodeStyleSettingsPanelFactory::displayName() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("CodeStyleSettingsPanelFactory", "Code Style Settings");
|
return QCoreApplication::translate("CodeStyleSettingsPanelFactory", "Code Style");
|
||||||
}
|
}
|
||||||
|
|
||||||
int CodeStyleSettingsPanelFactory::priority() const
|
int CodeStyleSettingsPanelFactory::priority() const
|
||||||
@@ -67,7 +67,7 @@ PropertiesPanel *CodeStyleSettingsPanelFactory::createPanel(Project *project)
|
|||||||
PropertiesPanel *panel = new PropertiesPanel;
|
PropertiesPanel *panel = new PropertiesPanel;
|
||||||
panel->setWidget(new CodeStyleSettingsWidget(project));
|
panel->setWidget(new CodeStyleSettingsWidget(project));
|
||||||
panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/CodeStyleSettings.png")));
|
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;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
#include "buildmanager.h"
|
#include "buildmanager.h"
|
||||||
#include "buildsteplist.h"
|
#include "buildsteplist.h"
|
||||||
#include "buildstepspage.h"
|
#include "buildstepspage.h"
|
||||||
#include "profileinformation.h"
|
#include "kitinformation.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "projectexplorer.h"
|
#include "projectexplorer.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
@@ -242,9 +242,9 @@ DeployConfigurationFactory *DeployConfigurationFactory::find(Target *parent)
|
|||||||
|
|
||||||
bool DeployConfigurationFactory::canHandle(Target *parent) const
|
bool DeployConfigurationFactory::canHandle(Target *parent) const
|
||||||
{
|
{
|
||||||
if (!parent->project()->supportsProfile(parent->profile()))
|
if (!parent->project()->supportsKit(parent->kit()))
|
||||||
return false;
|
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/deviceprocessesdialog.h"
|
||||||
#include "devicesupport/deviceprocesslist.h"
|
#include "devicesupport/deviceprocesslist.h"
|
||||||
#include "profilechooser.h"
|
#include "kitchooser.h"
|
||||||
#include "profileinformation.h"
|
#include "kitinformation.h"
|
||||||
|
|
||||||
#include <utils/filterlineedit.h>
|
#include <utils/filterlineedit.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -113,7 +113,7 @@ public:
|
|||||||
QWidget *q;
|
QWidget *q;
|
||||||
DeviceProcessList *processList;
|
DeviceProcessList *processList;
|
||||||
ProcessListFilterModel proxyModel;
|
ProcessListFilterModel proxyModel;
|
||||||
ProfileChooser *profileChooser;
|
KitChooser *kitChooser;
|
||||||
|
|
||||||
QTreeView *procView;
|
QTreeView *procView;
|
||||||
QTextBrowser *errorText;
|
QTextBrowser *errorText;
|
||||||
@@ -133,7 +133,7 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(QWidget *parent)
|
|||||||
processFilterLineEdit->setPlaceholderText(DeviceProcessesDialog::tr("Filter"));
|
processFilterLineEdit->setPlaceholderText(DeviceProcessesDialog::tr("Filter"));
|
||||||
processFilterLineEdit->setFocus(Qt::TabFocusReason);
|
processFilterLineEdit->setFocus(Qt::TabFocusReason);
|
||||||
|
|
||||||
profileChooser = new ProfileChooser(q);
|
kitChooser = new KitChooser(q);
|
||||||
|
|
||||||
procView = new QTreeView(q);
|
procView = new QTreeView(q);
|
||||||
procView->setModel(&proxyModel);
|
procView->setModel(&proxyModel);
|
||||||
@@ -157,7 +157,7 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(QWidget *parent)
|
|||||||
|
|
||||||
QFormLayout *leftColumn = new QFormLayout();
|
QFormLayout *leftColumn = new QFormLayout();
|
||||||
leftColumn->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
leftColumn->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||||
leftColumn->addRow(DeviceProcessesDialog::tr("Target:"), profileChooser);
|
leftColumn->addRow(DeviceProcessesDialog::tr("Kit:"), kitChooser);
|
||||||
leftColumn->addRow(DeviceProcessesDialog::tr("&Filter:"), processFilterLineEdit);
|
leftColumn->addRow(DeviceProcessesDialog::tr("&Filter:"), processFilterLineEdit);
|
||||||
|
|
||||||
// QVBoxLayout *rightColumn = new QVBoxLayout();
|
// QVBoxLayout *rightColumn = new QVBoxLayout();
|
||||||
@@ -185,7 +185,7 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(QWidget *parent)
|
|||||||
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||||
SLOT(updateButtons()));
|
SLOT(updateButtons()));
|
||||||
connect(updateListButton, SIGNAL(clicked()), SLOT(updateProcessList()));
|
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(killProcessButton, SIGNAL(clicked()), SLOT(killProcess()));
|
||||||
connect(&proxyModel, SIGNAL(layoutChanged()), SLOT(handleProcessListUpdated()));
|
connect(&proxyModel, SIGNAL(layoutChanged()), SLOT(handleProcessListUpdated()));
|
||||||
connect(buttonBox, SIGNAL(accepted()), q, SLOT(accept()));
|
connect(buttonBox, SIGNAL(accepted()), q, SLOT(accept()));
|
||||||
@@ -246,7 +246,7 @@ void DeviceProcessesDialogPrivate::killProcess()
|
|||||||
|
|
||||||
void DeviceProcessesDialogPrivate::updateDevice()
|
void DeviceProcessesDialogPrivate::updateDevice()
|
||||||
{
|
{
|
||||||
setDevice(DeviceProfileInformation::device(profileChooser->currentProfile()));
|
setDevice(DeviceKitInformation::device(kitChooser->currentKit()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceProcessesDialogPrivate::handleProcessKilled()
|
void DeviceProcessesDialogPrivate::handleProcessKilled()
|
||||||
@@ -323,13 +323,13 @@ void DeviceProcessesDialog::addCloseButton()
|
|||||||
|
|
||||||
void DeviceProcessesDialog::setDevice(const IDevice::ConstPtr &device)
|
void DeviceProcessesDialog::setDevice(const IDevice::ConstPtr &device)
|
||||||
{
|
{
|
||||||
d->profileChooser->hide();
|
d->kitChooser->hide();
|
||||||
d->setDevice(device);
|
d->setDevice(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceProcessesDialog::showAllDevices()
|
void DeviceProcessesDialog::showAllDevices()
|
||||||
{
|
{
|
||||||
d->profileChooser->show();
|
d->kitChooser->show();
|
||||||
d->updateDevice();
|
d->updateDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,9 +338,9 @@ DeviceProcess DeviceProcessesDialog::currentProcess() const
|
|||||||
return d->selectedProcess();
|
return d->selectedProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileChooser *DeviceProcessesDialog::profileChooser() const
|
KitChooser *DeviceProcessesDialog::kitChooser() const
|
||||||
{
|
{
|
||||||
return d->profileChooser;
|
return d->kitChooser;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceProcessesDialog::logMessage(const QString &line)
|
void DeviceProcessesDialog::logMessage(const QString &line)
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "../projectexplorer_export.h"
|
#include "../projectexplorer_export.h"
|
||||||
|
|
||||||
#include <projectexplorer/profile.h>
|
#include <projectexplorer/kit.h>
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
#include <projectexplorer/devicesupport/deviceprocesslist.h>
|
#include <projectexplorer/devicesupport/deviceprocesslist.h>
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class ProfileChooser;
|
class KitChooser;
|
||||||
|
|
||||||
namespace Internal { class DeviceProcessesDialogPrivate; }
|
namespace Internal { class DeviceProcessesDialogPrivate; }
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ public:
|
|||||||
void setDevice(const IDevice::ConstPtr &device);
|
void setDevice(const IDevice::ConstPtr &device);
|
||||||
void showAllDevices();
|
void showAllDevices();
|
||||||
DeviceProcess currentProcess() const;
|
DeviceProcess currentProcess() const;
|
||||||
ProfileChooser *profileChooser() const;
|
KitChooser *kitChooser() const;
|
||||||
void logMessage(const QString &line);
|
void logMessage(const QString &line);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -44,7 +44,7 @@ QString EditorSettingsPanelFactory::id() const
|
|||||||
|
|
||||||
QString EditorSettingsPanelFactory::displayName() const
|
QString EditorSettingsPanelFactory::displayName() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("EditorSettingsPanelFactory", "Editor Settings");
|
return QCoreApplication::translate("EditorSettingsPanelFactory", "Editor");
|
||||||
}
|
}
|
||||||
|
|
||||||
int EditorSettingsPanelFactory::priority() const
|
int EditorSettingsPanelFactory::priority() const
|
||||||
@@ -61,7 +61,7 @@ bool EditorSettingsPanelFactory::supports(Project *project)
|
|||||||
PropertiesPanel *EditorSettingsPanelFactory::createPanel(Project *project)
|
PropertiesPanel *EditorSettingsPanelFactory::createPanel(Project *project)
|
||||||
{
|
{
|
||||||
PropertiesPanel *panel = new PropertiesPanel;
|
PropertiesPanel *panel = new PropertiesPanel;
|
||||||
panel->setDisplayName(QCoreApplication::translate("EditorSettingsPanel", "Editor Settings"));
|
panel->setDisplayName(QCoreApplication::translate("EditorSettingsPanel", "Editor"));
|
||||||
panel->setWidget(new EditorSettingsWidget(project)),
|
panel->setWidget(new EditorSettingsWidget(project)),
|
||||||
panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/EditorSettings.png")));
|
panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/EditorSettings.png")));
|
||||||
return panel;
|
return panel;
|
||||||
|
@@ -28,11 +28,11 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "profile.h"
|
#include "kit.h"
|
||||||
|
|
||||||
#include "devicesupport/devicemanager.h"
|
#include "devicesupport/devicemanager.h"
|
||||||
#include "profileinformation.h"
|
#include "kitinformation.h"
|
||||||
#include "profilemanager.h"
|
#include "kitmanager.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "toolchainmanager.h"
|
#include "toolchainmanager.h"
|
||||||
|
|
||||||
@@ -55,15 +55,15 @@ const char ICON_KEY[] = "PE.Profile.Icon";
|
|||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
// ProfilePrivate
|
// KitPrivate
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ProfilePrivate
|
class KitPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ProfilePrivate() :
|
KitPrivate() :
|
||||||
m_id(QUuid::createUuid().toString().toLatin1().constData()),
|
m_id(QUuid::createUuid().toString().toLatin1().constData()),
|
||||||
m_autodetected(false),
|
m_autodetected(false),
|
||||||
m_isValid(true)
|
m_isValid(true)
|
||||||
@@ -82,32 +82,32 @@ public:
|
|||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
// Profile:
|
// Kit:
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
Profile::Profile() :
|
Kit::Kit() :
|
||||||
d(new Internal::ProfilePrivate)
|
d(new Internal::KitPrivate)
|
||||||
{
|
{
|
||||||
ProfileManager *stm = ProfileManager::instance();
|
KitManager *stm = KitManager::instance();
|
||||||
foreach (ProfileInformation *sti, stm->profileInformation())
|
foreach (KitInformation *sti, stm->kitInformation())
|
||||||
d->m_data.insert(sti->dataId(), sti->defaultValue(this));
|
d->m_data.insert(sti->dataId(), sti->defaultValue(this));
|
||||||
|
|
||||||
setDisplayName(QCoreApplication::translate("ProjectExplorer::Profile", "Unnamed"));
|
setDisplayName(QCoreApplication::translate("ProjectExplorer::Kit", "Unnamed"));
|
||||||
setIconPath(QLatin1String(":///DESKTOP///"));
|
setIconPath(QLatin1String(":///DESKTOP///"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile::~Profile()
|
Kit::~Kit()
|
||||||
{
|
{
|
||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *Profile::clone(bool keepName) const
|
Kit *Kit::clone(bool keepName) const
|
||||||
{
|
{
|
||||||
Profile *p = new Profile;
|
Kit *p = new Kit;
|
||||||
if (keepName)
|
if (keepName)
|
||||||
p->d->m_displayName = d->m_displayName;
|
p->d->m_displayName = d->m_displayName;
|
||||||
else
|
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);
|
.arg(d->m_displayName);
|
||||||
p->d->m_autodetected = false;
|
p->d->m_autodetected = false;
|
||||||
p->d->m_data = d->m_data;
|
p->d->m_data = d->m_data;
|
||||||
@@ -117,21 +117,21 @@ Profile *Profile::clone(bool keepName) const
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Profile::isValid() const
|
bool Kit::isValid() const
|
||||||
{
|
{
|
||||||
return d->m_id.isValid() && d->m_isValid;
|
return d->m_id.isValid() && d->m_isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<Task> Profile::validate()
|
QList<Task> Kit::validate()
|
||||||
{
|
{
|
||||||
QList<Task> result;
|
QList<Task> result;
|
||||||
QList<ProfileInformation *> infoList = ProfileManager::instance()->profileInformation();
|
QList<KitInformation *> infoList = KitManager::instance()->kitInformation();
|
||||||
foreach (ProfileInformation *i, infoList)
|
foreach (KitInformation *i, infoList)
|
||||||
result.append(i->validate(this));
|
result.append(i->validate(this));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Profile::displayName() const
|
QString Kit::displayName() const
|
||||||
{
|
{
|
||||||
return d->m_displayName;
|
return d->m_displayName;
|
||||||
}
|
}
|
||||||
@@ -143,16 +143,16 @@ static QString candidateName(const QString &name, const QString &postfix)
|
|||||||
return name + QLatin1Char('-') + postfix;
|
return name + QLatin1Char('-') + postfix;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::setDisplayName(const QString &name)
|
void Kit::setDisplayName(const QString &name)
|
||||||
{
|
{
|
||||||
ProfileManager *pm = ProfileManager::instance();
|
KitManager *pm = KitManager::instance();
|
||||||
QList<ProfileInformation *> profileInfo = pm->profileInformation();
|
QList<KitInformation *> kitInfo = pm->kitInformation();
|
||||||
|
|
||||||
QStringList nameList;
|
QStringList nameList;
|
||||||
foreach (Profile *p, pm->profiles()) {
|
foreach (Kit *p, pm->kits()) {
|
||||||
nameList << p->displayName();
|
nameList << p->displayName();
|
||||||
foreach (ProfileInformation *pi, profileInfo) {
|
foreach (KitInformation *ki, kitInfo) {
|
||||||
const QString postfix = pi->displayNamePostfix(p);
|
const QString postfix = ki->displayNamePostfix(p);
|
||||||
if (!postfix.isEmpty())
|
if (!postfix.isEmpty())
|
||||||
nameList << candidateName(p->displayName(), postfix);
|
nameList << candidateName(p->displayName(), postfix);
|
||||||
}
|
}
|
||||||
@@ -161,8 +161,8 @@ void Profile::setDisplayName(const QString &name)
|
|||||||
QStringList candidateNames;
|
QStringList candidateNames;
|
||||||
candidateNames << name;
|
candidateNames << name;
|
||||||
|
|
||||||
foreach (ProfileInformation *pi, profileInfo) {
|
foreach (KitInformation *ki, kitInfo) {
|
||||||
const QString postfix = pi->displayNamePostfix(this);
|
const QString postfix = ki->displayNamePostfix(this);
|
||||||
if (!postfix.isEmpty())
|
if (!postfix.isEmpty())
|
||||||
candidateNames << candidateName(name, postfix);
|
candidateNames << candidateName(name, postfix);
|
||||||
}
|
}
|
||||||
@@ -181,30 +181,30 @@ void Profile::setDisplayName(const QString &name)
|
|||||||
if (d->m_displayName == uniqueName)
|
if (d->m_displayName == uniqueName)
|
||||||
return;
|
return;
|
||||||
d->m_displayName = uniqueName;
|
d->m_displayName = uniqueName;
|
||||||
profileUpdated();
|
kitUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Profile::isAutoDetected() const
|
bool Kit::isAutoDetected() const
|
||||||
{
|
{
|
||||||
return d->m_autodetected;
|
return d->m_autodetected;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id Profile::id() const
|
Core::Id Kit::id() const
|
||||||
{
|
{
|
||||||
return d->m_id;
|
return d->m_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon Profile::icon() const
|
QIcon Kit::icon() const
|
||||||
{
|
{
|
||||||
return d->m_icon;
|
return d->m_icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Profile::iconPath() const
|
QString Kit::iconPath() const
|
||||||
{
|
{
|
||||||
return d->m_iconPath;
|
return d->m_iconPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::setIconPath(const QString &path)
|
void Kit::setIconPath(const QString &path)
|
||||||
{
|
{
|
||||||
if (d->m_iconPath == path)
|
if (d->m_iconPath == path)
|
||||||
return;
|
return;
|
||||||
@@ -215,36 +215,36 @@ void Profile::setIconPath(const QString &path)
|
|||||||
d->m_icon = qApp->style()->standardIcon(QStyle::SP_ComputerIcon);
|
d->m_icon = qApp->style()->standardIcon(QStyle::SP_ComputerIcon);
|
||||||
else
|
else
|
||||||
d->m_icon = QIcon(path);
|
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);
|
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);
|
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)
|
if (d->m_data.value(key) == value)
|
||||||
return;
|
return;
|
||||||
d->m_data.insert(key, value);
|
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))
|
if (!d->m_data.contains(key))
|
||||||
return;
|
return;
|
||||||
d->m_data.remove(key);
|
d->m_data.remove(key);
|
||||||
profileUpdated();
|
kitUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap Profile::toMap() const
|
QVariantMap Kit::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap data;
|
QVariantMap data;
|
||||||
data.insert(QLatin1String(ID_KEY), QString::fromLatin1(d->m_id.name()));
|
data.insert(QLatin1String(ID_KEY), QString::fromLatin1(d->m_id.name()));
|
||||||
@@ -260,19 +260,19 @@ QVariantMap Profile::toMap() const
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Profile::operator==(const Profile &other) const
|
bool Kit::operator==(const Kit &other) const
|
||||||
{
|
{
|
||||||
return d->m_data == other.d->m_data;
|
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();
|
QList<KitInformation *> infoList = KitManager::instance()->kitInformation();
|
||||||
foreach (ProfileInformation *si, infoList)
|
foreach (KitInformation *ki, infoList)
|
||||||
si->addToEnvironment(this, env);
|
ki->addToEnvironment(this, env);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Profile::toHtml()
|
QString Kit::toHtml()
|
||||||
{
|
{
|
||||||
QString rc;
|
QString rc;
|
||||||
QTextStream str(&rc);
|
QTextStream str(&rc);
|
||||||
@@ -287,10 +287,10 @@ QString Profile::toHtml()
|
|||||||
str << "<b>";
|
str << "<b>";
|
||||||
switch (t.type) {
|
switch (t.type) {
|
||||||
case Task::Error:
|
case Task::Error:
|
||||||
QCoreApplication::translate("ProjectExplorer::Profile", "Error:");
|
QCoreApplication::translate("ProjectExplorer::Kit", "Error:");
|
||||||
break;
|
break;
|
||||||
case Task::Warning:
|
case Task::Warning:
|
||||||
QCoreApplication::translate("ProjectExplorer::Profile", "Warning:");
|
QCoreApplication::translate("ProjectExplorer::Kit", "Warning:");
|
||||||
break;
|
break;
|
||||||
case Task::Unknown:
|
case Task::Unknown:
|
||||||
default:
|
default:
|
||||||
@@ -301,17 +301,17 @@ QString Profile::toHtml()
|
|||||||
str << "</p>";
|
str << "</p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<ProfileInformation *> infoList = ProfileManager::instance()->profileInformation();
|
QList<KitInformation *> infoList = KitManager::instance()->kitInformation();
|
||||||
foreach (ProfileInformation *i, infoList) {
|
foreach (KitInformation *ki, infoList) {
|
||||||
ProfileInformation::ItemList list = i->toUserOutput(this);
|
KitInformation::ItemList list = ki->toUserOutput(this);
|
||||||
foreach (const ProfileInformation::Item &j, list)
|
foreach (const KitInformation::Item &j, list)
|
||||||
str << "<tr><td><b>" << j.first << ":</b></td><td>" << j.second << "</td></tr>";
|
str << "<tr><td><b>" << j.first << ":</b></td><td>" << j.second << "</td></tr>";
|
||||||
}
|
}
|
||||||
str << "</table></body></html>";
|
str << "</table></body></html>";
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Profile::fromMap(const QVariantMap &data)
|
bool Kit::fromMap(const QVariantMap &data)
|
||||||
{
|
{
|
||||||
const QString id = data.value(QLatin1String(ID_KEY)).toString();
|
const QString id = data.value(QLatin1String(ID_KEY)).toString();
|
||||||
if (id.isEmpty())
|
if (id.isEmpty())
|
||||||
@@ -328,19 +328,19 @@ bool Profile::fromMap(const QVariantMap &data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::setAutoDetected(bool detected)
|
void Kit::setAutoDetected(bool detected)
|
||||||
{
|
{
|
||||||
d->m_autodetected = detected;
|
d->m_autodetected = detected;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::setValid(bool valid)
|
void Kit::setValid(bool valid)
|
||||||
{
|
{
|
||||||
d->m_isValid = valid;
|
d->m_isValid = valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::profileUpdated()
|
void Kit::kitUpdated()
|
||||||
{
|
{
|
||||||
ProfileManager::instance()->notifyAboutUpdate(this);
|
KitManager::instance()->notifyAboutUpdate(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
@@ -28,8 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef PROFILE_H
|
#ifndef KIT_H
|
||||||
#define PROFILE_H
|
#define KIT_H
|
||||||
|
|
||||||
#include "projectexplorer_export.h"
|
#include "projectexplorer_export.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
@@ -43,21 +43,21 @@ namespace Utils { class Environment; }
|
|||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class ProfileManagerPrivate;
|
class KitManagerPrivate;
|
||||||
class ProfilePrivate;
|
class KitPrivate;
|
||||||
} // namespace Internal
|
} // 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.
|
* under development.
|
||||||
*/
|
*/
|
||||||
class PROJECTEXPLORER_EXPORT Profile
|
class PROJECTEXPLORER_EXPORT Kit
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Profile();
|
Kit();
|
||||||
~Profile();
|
~Kit();
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
QList<Task> validate();
|
QList<Task> validate();
|
||||||
@@ -77,34 +77,34 @@ public:
|
|||||||
void setValue(const Core::Id &key, const QVariant &value);
|
void setValue(const Core::Id &key, const QVariant &value);
|
||||||
void removeKey(const Core::Id &key);
|
void removeKey(const Core::Id &key);
|
||||||
|
|
||||||
bool operator==(const Profile &other) const;
|
bool operator==(const Kit &other) const;
|
||||||
|
|
||||||
void addToEnvironment(Utils::Environment &env) const;
|
void addToEnvironment(Utils::Environment &env) const;
|
||||||
|
|
||||||
QString toHtml();
|
QString toHtml();
|
||||||
Profile *clone(bool keepName = false) const;
|
Kit *clone(bool keepName = false) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Unimplemented.
|
// Unimplemented.
|
||||||
Profile(const Profile &other);
|
Kit(const Kit &other);
|
||||||
void operator=(const Profile &other);
|
void operator=(const Kit &other);
|
||||||
|
|
||||||
void setAutoDetected(bool detected);
|
void setAutoDetected(bool detected);
|
||||||
void setValid(bool valid);
|
void setValid(bool valid);
|
||||||
|
|
||||||
void profileUpdated();
|
void kitUpdated();
|
||||||
|
|
||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
bool fromMap(const QVariantMap &value);
|
bool fromMap(const QVariantMap &value);
|
||||||
|
|
||||||
Internal::ProfilePrivate *d;
|
Internal::KitPrivate *d;
|
||||||
|
|
||||||
friend class ProfileManager;
|
friend class KitManager;
|
||||||
friend class Internal::ProfileManagerPrivate;
|
friend class Internal::KitManagerPrivate;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // 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 "kitinformation.h"
|
||||||
#include "profilemanager.h"
|
#include "kitmanager.h"
|
||||||
#include "abi.h"
|
#include "abi.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
ProfileChooser::ProfileChooser(QWidget *parent, unsigned flags) :
|
KitChooser::KitChooser(QWidget *parent, unsigned flags) :
|
||||||
QComboBox(parent)
|
QComboBox(parent)
|
||||||
{
|
{
|
||||||
populate(flags);
|
populate(flags);
|
||||||
@@ -46,64 +46,64 @@ ProfileChooser::ProfileChooser(QWidget *parent, unsigned flags) :
|
|||||||
connect(this, SIGNAL(currentIndexChanged(int)), SLOT(onCurrentIndexChanged(int)));
|
connect(this, SIGNAL(currentIndexChanged(int)), SLOT(onCurrentIndexChanged(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileChooser::onCurrentIndexChanged(int index)
|
void KitChooser::onCurrentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
if (Profile *profile = profileAt(index))
|
if (Kit *kit = kitAt(index))
|
||||||
setToolTip(profile->toHtml());
|
setToolTip(kit->toHtml());
|
||||||
else
|
else
|
||||||
setToolTip(QString());
|
setToolTip(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileChooser::populate(unsigned flags)
|
void KitChooser::populate(unsigned flags)
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
const Abi hostAbi = Abi::hostAbi();
|
const Abi hostAbi = Abi::hostAbi();
|
||||||
foreach (Profile *profile, ProfileManager::instance()->profiles()) {
|
foreach (Kit *kit, KitManager::instance()->kits()) {
|
||||||
if (!profile->isValid() && !(flags & IncludeInvalidProfiles))
|
if (!kit->isValid() && !(flags & IncludeInvalidKits))
|
||||||
continue;
|
continue;
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
ToolChain *tc = ToolChainKitInformation::toolChain(kit);
|
||||||
if (!tc)
|
if (!tc)
|
||||||
continue;
|
continue;
|
||||||
const Abi abi = tc->targetAbi();
|
const Abi abi = tc->targetAbi();
|
||||||
if ((flags & HostAbiOnly) && hostAbi.os() != abi.os())
|
if ((flags & HostAbiOnly) && hostAbi.os() != abi.os())
|
||||||
continue;
|
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())
|
if ((flags & HasDebugger) && debuggerCommand.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
const QString completeBase = QFileInfo(debuggerCommand).completeBaseName();
|
const QString completeBase = QFileInfo(debuggerCommand).completeBaseName();
|
||||||
const QString name = tr("%1 (%2)").arg(profile->displayName(), completeBase);
|
const QString name = tr("%1 (%2)").arg(kit->displayName(), completeBase);
|
||||||
addItem(name, qVariantFromValue(profile->id()));
|
addItem(name, qVariantFromValue(kit->id()));
|
||||||
setItemData(count() - 1, profile->toHtml(), Qt::ToolTipRole);
|
setItemData(count() - 1, kit->toHtml(), Qt::ToolTipRole);
|
||||||
}
|
}
|
||||||
setEnabled(count() > 1);
|
setEnabled(count() > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *ProfileChooser::currentProfile() const
|
Kit *KitChooser::currentKit() const
|
||||||
{
|
{
|
||||||
const int index = currentIndex();
|
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) {
|
for (int i = 0, n = count(); i != n; ++i) {
|
||||||
if (profileAt(i)->id() == id) {
|
if (kitAt(i)->id() == id) {
|
||||||
setCurrentIndex(i);
|
setCurrentIndex(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id ProfileChooser::currentProfileId() const
|
Core::Id KitChooser::currentKitId() const
|
||||||
{
|
{
|
||||||
Profile *profile = currentProfile();
|
Kit *kit = currentKit();
|
||||||
return profile ? profile->id() : Core::Id();
|
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));
|
Core::Id id = qvariant_cast<Core::Id>(itemData(index));
|
||||||
return ProfileManager::instance()->find(id);
|
return KitManager::instance()->find(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
@@ -28,8 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef PROJECTEXPLORER_PROFILECHOOSER_H
|
#ifndef PROJECTEXPLORER_KITCHOOSER_H
|
||||||
#define PROJECTEXPLORER_PROFILECHOOSER_H
|
#define PROJECTEXPLORER_KITCHOOSER_H
|
||||||
|
|
||||||
#include "projectexplorer_export.h"
|
#include "projectexplorer_export.h"
|
||||||
|
|
||||||
@@ -39,35 +39,35 @@ namespace Core { class Id; }
|
|||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class Profile;
|
class Kit;
|
||||||
|
|
||||||
// Let the user pick a profile.
|
// Let the user pick a kit.
|
||||||
class PROJECTEXPLORER_EXPORT ProfileChooser : public QComboBox
|
class PROJECTEXPLORER_EXPORT KitChooser : public QComboBox
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum Flags {
|
enum Flags {
|
||||||
HostAbiOnly = 0x1,
|
HostAbiOnly = 0x1,
|
||||||
IncludeInvalidProfiles = 0x2,
|
IncludeInvalidKits = 0x2,
|
||||||
HasDebugger = 0x4,
|
HasDebugger = 0x4,
|
||||||
RemoteDebugging = IncludeInvalidProfiles | HasDebugger,
|
RemoteDebugging = IncludeInvalidKits | HasDebugger,
|
||||||
LocalDebugging = RemoteDebugging | HostAbiOnly
|
LocalDebugging = RemoteDebugging | HostAbiOnly
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit ProfileChooser(QWidget *parent, unsigned flags = 0);
|
explicit KitChooser(QWidget *parent, unsigned flags = 0);
|
||||||
|
|
||||||
void setCurrentProfileId(Core::Id id);
|
void setCurrentKitId(Core::Id id);
|
||||||
Core::Id currentProfileId() const;
|
Core::Id currentKitId() const;
|
||||||
|
|
||||||
Profile *currentProfile() const;
|
Kit *currentKit() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_SLOT void onCurrentIndexChanged(int index);
|
Q_SLOT void onCurrentIndexChanged(int index);
|
||||||
void populate(unsigned flags);
|
void populate(unsigned flags);
|
||||||
Profile *profileAt(int index) const;
|
Kit *kitAt(int index) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
#endif // PROJECTEXPLORER_PROFILECHOOSER_H
|
#endif // PROJECTEXPLORER_KITCHOOSER_H
|
@@ -28,8 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef PROFILECONFIGWIDGET_H
|
#ifndef KITCONFIGWIDGET_H
|
||||||
#define PROFILECONFIGWIDGET_H
|
#define KITCONFIGWIDGET_H
|
||||||
|
|
||||||
#include "projectexplorer_export.h"
|
#include "projectexplorer_export.h"
|
||||||
|
|
||||||
@@ -38,15 +38,15 @@
|
|||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// ProfileConfigWidget
|
// KitConfigWidget
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT ProfileConfigWidget : public QWidget
|
class PROJECTEXPLORER_EXPORT KitConfigWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProfileConfigWidget(QWidget *parent = 0) : QWidget(parent)
|
KitConfigWidget(QWidget *parent = 0) : QWidget(parent)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
virtual QString displayName() const = 0;
|
virtual QString displayName() const = 0;
|
||||||
@@ -63,4 +63,4 @@ signals:
|
|||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
#endif // PROFILECONFIGWIDGET_H
|
#endif // KITCONFIGWIDGET_H
|
@@ -28,13 +28,13 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "profileinformation.h"
|
#include "kitinformation.h"
|
||||||
|
|
||||||
#include "devicesupport/desktopdevice.h"
|
#include "devicesupport/desktopdevice.h"
|
||||||
#include "devicesupport/devicemanager.h"
|
#include "devicesupport/devicemanager.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
#include "profile.h"
|
#include "kit.h"
|
||||||
#include "profileinformationconfigwidget.h"
|
#include "kitinformationconfigwidget.h"
|
||||||
#include "toolchain.h"
|
#include "toolchain.h"
|
||||||
#include "toolchainmanager.h"
|
#include "toolchainmanager.h"
|
||||||
|
|
||||||
@@ -55,67 +55,67 @@ namespace ProjectExplorer {
|
|||||||
|
|
||||||
static const char SYSROOT_INFORMATION[] = "PE.Profile.SysRoot";
|
static const char SYSROOT_INFORMATION[] = "PE.Profile.SysRoot";
|
||||||
|
|
||||||
SysRootProfileInformation::SysRootProfileInformation()
|
SysRootKitInformation::SysRootKitInformation()
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("SysRootInformation"));
|
setObjectName(QLatin1String("SysRootInformation"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id SysRootProfileInformation::dataId() const
|
Core::Id SysRootKitInformation::dataId() const
|
||||||
{
|
{
|
||||||
static const Core::Id id(SYSROOT_INFORMATION);
|
static const Core::Id id(SYSROOT_INFORMATION);
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int SysRootProfileInformation::priority() const
|
unsigned int SysRootKitInformation::priority() const
|
||||||
{
|
{
|
||||||
return 32000;
|
return 32000;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant SysRootProfileInformation::defaultValue(Profile *p) const
|
QVariant SysRootKitInformation::defaultValue(Kit *k) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(p)
|
Q_UNUSED(k)
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<Task> SysRootProfileInformation::validate(Profile *p) const
|
QList<Task> SysRootKitInformation::validate(Kit *k) const
|
||||||
{
|
{
|
||||||
QList<Task> result;
|
QList<Task> result;
|
||||||
const Utils::FileName dir = SysRootProfileInformation::sysRoot(p);
|
const Utils::FileName dir = SysRootKitInformation::sysRoot(k);
|
||||||
if (!dir.toFileInfo().isDir() && SysRootProfileInformation::hasSysRoot(p)) {
|
if (!dir.toFileInfo().isDir() && SysRootKitInformation::hasSysRoot(k)) {
|
||||||
result << Task(Task::Error, tr("Sys Root \"%1\" is not a directory.").arg(dir.toUserOutput()),
|
result << Task(Task::Error, tr("Sys Root \"%1\" is not a directory.").arg(dir.toUserOutput()),
|
||||||
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
|
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileConfigWidget *SysRootProfileInformation::createConfigWidget(Profile *p) const
|
KitConfigWidget *SysRootKitInformation::createConfigWidget(Kit *k) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(p);
|
Q_ASSERT(k);
|
||||||
return new Internal::SysRootInformationConfigWidget(p);
|
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)
|
if (k)
|
||||||
return !p->value(Core::Id(SYSROOT_INFORMATION)).toString().isEmpty();
|
return !k->value(Core::Id(SYSROOT_INFORMATION)).toString().isEmpty();
|
||||||
return false;
|
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();
|
||||||
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";
|
static const char TOOLCHAIN_INFORMATION[] = "PE.Profile.ToolChain";
|
||||||
|
|
||||||
ToolChainProfileInformation::ToolChainProfileInformation()
|
ToolChainKitInformation::ToolChainKitInformation()
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("ToolChainInformation"));
|
setObjectName(QLatin1String("ToolChainInformation"));
|
||||||
connect(ToolChainManager::instance(), SIGNAL(toolChainRemoved(ProjectExplorer::ToolChain*)),
|
connect(ToolChainManager::instance(), SIGNAL(toolChainRemoved(ProjectExplorer::ToolChain*)),
|
||||||
@@ -133,20 +133,20 @@ ToolChainProfileInformation::ToolChainProfileInformation()
|
|||||||
this, SIGNAL(validationNeeded()));
|
this, SIGNAL(validationNeeded()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id ToolChainProfileInformation::dataId() const
|
Core::Id ToolChainKitInformation::dataId() const
|
||||||
{
|
{
|
||||||
static const Core::Id id(TOOLCHAIN_INFORMATION);
|
static const Core::Id id(TOOLCHAIN_INFORMATION);
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int ToolChainProfileInformation::priority() const
|
unsigned int ToolChainKitInformation::priority() const
|
||||||
{
|
{
|
||||||
return 30000;
|
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();
|
QList<ToolChain *> tcList = ToolChainManager::instance()->toolChains();
|
||||||
if (tcList.isEmpty())
|
if (tcList.isEmpty())
|
||||||
return QString();
|
return QString();
|
||||||
@@ -161,58 +161,58 @@ QVariant ToolChainProfileInformation::defaultValue(Profile *p) const
|
|||||||
return tcList.at(0)->id();
|
return tcList.at(0)->id();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<Task> ToolChainProfileInformation::validate(Profile *p) const
|
QList<Task> ToolChainKitInformation::validate(Kit *k) const
|
||||||
{
|
{
|
||||||
QList<Task> result;
|
QList<Task> result;
|
||||||
if (!toolChain(p)) {
|
if (!toolChain(k)) {
|
||||||
setToolChain(p, 0); // make sure to clear out no longer known tool chains
|
setToolChain(k, 0); // make sure to clear out no longer known tool chains
|
||||||
result << Task(Task::Error, ToolChainProfileInformation::msgNoToolChainInTarget(),
|
result << Task(Task::Error, ToolChainKitInformation::msgNoToolChainInTarget(),
|
||||||
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
|
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileConfigWidget *ToolChainProfileInformation::createConfigWidget(Profile *p) const
|
KitConfigWidget *ToolChainKitInformation::createConfigWidget(Kit *k) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(p);
|
Q_ASSERT(k);
|
||||||
return new Internal::ToolChainInformationConfigWidget(p);
|
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();
|
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"));
|
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)
|
if (tc)
|
||||||
tc->addToEnvironment(env);
|
tc->addToEnvironment(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolChain *ToolChainProfileInformation::toolChain(const Profile *p)
|
ToolChain *ToolChainKitInformation::toolChain(const Kit *k)
|
||||||
{
|
{
|
||||||
if (!p)
|
if (!k)
|
||||||
return 0;
|
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);
|
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";
|
static const char DEVICETYPE_INFORMATION[] = "PE.Profile.DeviceType";
|
||||||
|
|
||||||
DeviceTypeProfileInformation::DeviceTypeProfileInformation()
|
DeviceTypeKitInformation::DeviceTypeKitInformation()
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("DeviceTypeInformation"));
|
setObjectName(QLatin1String("DeviceTypeInformation"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id DeviceTypeProfileInformation::dataId() const
|
Core::Id DeviceTypeKitInformation::dataId() const
|
||||||
{
|
{
|
||||||
static const Core::Id id(DEVICETYPE_INFORMATION);
|
static const Core::Id id(DEVICETYPE_INFORMATION);
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int DeviceTypeProfileInformation::priority() const
|
unsigned int DeviceTypeKitInformation::priority() const
|
||||||
{
|
{
|
||||||
return 33000;
|
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);
|
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;
|
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."),
|
result.append(Task(Task::Error, tr("Device does not match device type."),
|
||||||
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
|
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileConfigWidget *DeviceTypeProfileInformation::createConfigWidget(Profile *p) const
|
KitConfigWidget *DeviceTypeKitInformation::createConfigWidget(Kit *k) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(p);
|
Q_ASSERT(k);
|
||||||
return new Internal::DeviceTypeInformationConfigWidget(p);
|
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");
|
QString typeDisplayName = tr("Unknown device type");
|
||||||
if (type.isValid()) {
|
if (type.isValid()) {
|
||||||
QList<IDeviceFactory *> factories
|
QList<IDeviceFactory *> factories
|
||||||
@@ -276,16 +276,16 @@ ProfileInformation::ItemList DeviceTypeProfileInformation::toUserOutput(Profile
|
|||||||
return ItemList() << qMakePair(tr("Device type"), typeDisplayName);
|
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();
|
||||||
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";
|
static const char DEVICE_INFORMATION[] = "PE.Profile.Device";
|
||||||
|
|
||||||
DeviceProfileInformation::DeviceProfileInformation()
|
DeviceKitInformation::DeviceKitInformation()
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("DeviceInformation"));
|
setObjectName(QLatin1String("DeviceInformation"));
|
||||||
connect(DeviceManager::instance(), SIGNAL(deviceRemoved(Core::Id)),
|
connect(DeviceManager::instance(), SIGNAL(deviceRemoved(Core::Id)),
|
||||||
@@ -303,71 +303,71 @@ DeviceProfileInformation::DeviceProfileInformation()
|
|||||||
this, SIGNAL(validationNeeded()));
|
this, SIGNAL(validationNeeded()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id DeviceProfileInformation::dataId() const
|
Core::Id DeviceKitInformation::dataId() const
|
||||||
{
|
{
|
||||||
static const Core::Id id(DEVICE_INFORMATION);
|
static const Core::Id id(DEVICE_INFORMATION);
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int DeviceProfileInformation::priority() const
|
unsigned int DeviceKitInformation::priority() const
|
||||||
{
|
{
|
||||||
return 32000;
|
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);
|
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;
|
QList<Task> result;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileConfigWidget *DeviceProfileInformation::createConfigWidget(Profile *p) const
|
KitConfigWidget *DeviceKitInformation::createConfigWidget(Kit *k) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(p);
|
Q_ASSERT(k);
|
||||||
return new Internal::DeviceInformationConfigWidget(p);
|
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();
|
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());
|
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();
|
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) {
|
if (k) {
|
||||||
QString idname = p->value(Core::Id(DEVICE_INFORMATION)).toString();
|
QString idname = k->value(Core::Id(DEVICE_INFORMATION)).toString();
|
||||||
return idname.isEmpty() ? IDevice::invalidId() : Core::Id(idname);
|
return idname.isEmpty() ? IDevice::invalidId() : Core::Id(idname);
|
||||||
}
|
}
|
||||||
return IDevice::invalidId();
|
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
|
} // namespace ProjectExplorer
|
@@ -28,11 +28,11 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef PROFILEINFORMATION_H
|
#ifndef KITINFORMATION_H
|
||||||
#define PROFILEINFORMATION_H
|
#define KITINFORMATION_H
|
||||||
|
|
||||||
#include "profilemanager.h"
|
#include "kitmanager.h"
|
||||||
#include "profile.h"
|
#include "kit.h"
|
||||||
|
|
||||||
#include "devicesupport/idevice.h"
|
#include "devicesupport/idevice.h"
|
||||||
#include "toolchain.h"
|
#include "toolchain.h"
|
||||||
@@ -43,44 +43,44 @@
|
|||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class ProfileConfigWidget;
|
class KitConfigWidget;
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// SysRootInformation:
|
// SysRootInformation:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT SysRootProfileInformation : public ProfileInformation
|
class PROJECTEXPLORER_EXPORT SysRootKitInformation : public KitInformation
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SysRootProfileInformation();
|
SysRootKitInformation();
|
||||||
|
|
||||||
Core::Id dataId() const;
|
Core::Id dataId() const;
|
||||||
unsigned int priority() 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 bool hasSysRoot(const Kit *k);
|
||||||
static Utils::FileName sysRoot(const Profile *p);
|
static Utils::FileName sysRoot(const Kit *k);
|
||||||
static void setSysRoot(Profile *p, const Utils::FileName &v);
|
static void setSysRoot(Kit *k, const Utils::FileName &v);
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT SysRootMatcher : public ProfileMatcher
|
class PROJECTEXPLORER_EXPORT SysRootMatcher : public KitMatcher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SysRootMatcher(const Utils::FileName &fn) : m_sysroot(fn)
|
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:
|
private:
|
||||||
@@ -91,43 +91,43 @@ private:
|
|||||||
// ToolChainInformation:
|
// ToolChainInformation:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT ToolChainProfileInformation : public ProfileInformation
|
class PROJECTEXPLORER_EXPORT ToolChainKitInformation : public KitInformation
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ToolChainProfileInformation();
|
ToolChainKitInformation();
|
||||||
|
|
||||||
Core::Id dataId() const;
|
Core::Id dataId() const;
|
||||||
unsigned int priority() 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 ToolChain *toolChain(const Kit *k);
|
||||||
static void setToolChain(Profile *p, ToolChain *tc);
|
static void setToolChain(Kit *k, ToolChain *tc);
|
||||||
|
|
||||||
static QString msgNoToolChainInTarget();
|
static QString msgNoToolChainInTarget();
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT ToolChainMatcher : public ProfileMatcher
|
class PROJECTEXPLORER_EXPORT ToolChainMatcher : public KitMatcher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ToolChainMatcher(const ToolChain *tc) : m_tc(tc)
|
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:
|
private:
|
||||||
@@ -138,37 +138,37 @@ private:
|
|||||||
// DeviceTypeInformation:
|
// DeviceTypeInformation:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT DeviceTypeProfileInformation : public ProfileInformation
|
class PROJECTEXPLORER_EXPORT DeviceTypeKitInformation : public KitInformation
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DeviceTypeProfileInformation();
|
DeviceTypeKitInformation();
|
||||||
|
|
||||||
Core::Id dataId() const;
|
Core::Id dataId() const;
|
||||||
unsigned int priority() 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 const Core::Id deviceTypeId(const Kit *k);
|
||||||
static void setDeviceTypeId(Profile *p, Core::Id type);
|
static void setDeviceTypeId(Kit *k, Core::Id type);
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT DeviceTypeMatcher : public ProfileMatcher
|
class PROJECTEXPLORER_EXPORT DeviceTypeMatcher : public KitMatcher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DeviceTypeMatcher(const Core::Id t) : m_type(t)
|
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())
|
if (!deviceType.isValid())
|
||||||
return false;
|
return false;
|
||||||
return deviceType == m_type;
|
return deviceType == m_type;
|
||||||
@@ -182,41 +182,41 @@ private:
|
|||||||
// DeviceInformation:
|
// DeviceInformation:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT DeviceProfileInformation : public ProfileInformation
|
class PROJECTEXPLORER_EXPORT DeviceKitInformation : public KitInformation
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DeviceProfileInformation();
|
DeviceKitInformation();
|
||||||
|
|
||||||
Core::Id dataId() const;
|
Core::Id dataId() const;
|
||||||
unsigned int priority() 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 IDevice::ConstPtr device(const Kit *k);
|
||||||
static Core::Id deviceId(const Profile *p);
|
static Core::Id deviceId(const Kit *k);
|
||||||
static void setDevice(Profile *p, IDevice::ConstPtr dev);
|
static void setDevice(Kit *k, IDevice::ConstPtr dev);
|
||||||
static void setDeviceId(Profile *p, const Core::Id id);
|
static void setDeviceId(Kit *k, const Core::Id id);
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT DeviceMatcher : public ProfileMatcher
|
class PROJECTEXPLORER_EXPORT DeviceMatcher : public KitMatcher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DeviceMatcher(Core::Id id) : m_devId(id)
|
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:
|
private:
|
||||||
@@ -225,4 +225,4 @@ private:
|
|||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
#endif // PROFILEINFORMATION_H
|
#endif // KITINFORMATION_H
|
@@ -28,14 +28,14 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "profileinformationconfigwidget.h"
|
#include "kitinformationconfigwidget.h"
|
||||||
|
|
||||||
#include "devicesupport/devicemanager.h"
|
#include "devicesupport/devicemanager.h"
|
||||||
#include "devicesupport/devicemanagermodel.h"
|
#include "devicesupport/devicemanagermodel.h"
|
||||||
#include "devicesupport/idevicefactory.h"
|
#include "devicesupport/idevicefactory.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
#include "profile.h"
|
#include "kit.h"
|
||||||
#include "profileinformation.h"
|
#include "kitinformation.h"
|
||||||
#include "toolchain.h"
|
#include "toolchain.h"
|
||||||
#include "toolchainmanager.h"
|
#include "toolchainmanager.h"
|
||||||
|
|
||||||
@@ -55,9 +55,9 @@ namespace Internal {
|
|||||||
// SysRootInformationConfigWidget:
|
// SysRootInformationConfigWidget:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
SysRootInformationConfigWidget::SysRootInformationConfigWidget(Profile *p, QWidget *parent) :
|
SysRootInformationConfigWidget::SysRootInformationConfigWidget(Kit *k, QWidget *parent) :
|
||||||
ProfileConfigWidget(parent),
|
KitConfigWidget(parent),
|
||||||
m_profile(p)
|
m_kit(k)
|
||||||
{
|
{
|
||||||
setToolTip(tr("The root directory of the system image to use.<br>"
|
setToolTip(tr("The root directory of the system image to use.<br>"
|
||||||
"Leave empty when building for the desktop."));
|
"Leave empty when building for the desktop."));
|
||||||
@@ -68,7 +68,7 @@ SysRootInformationConfigWidget::SysRootInformationConfigWidget(Profile *p, QWidg
|
|||||||
layout->addWidget(m_chooser);
|
layout->addWidget(m_chooser);
|
||||||
m_chooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
|
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()));
|
connect(m_chooser, SIGNAL(changed(QString)), this, SIGNAL(dirty()));
|
||||||
}
|
}
|
||||||
@@ -80,17 +80,17 @@ QString SysRootInformationConfigWidget::displayName() const
|
|||||||
|
|
||||||
void SysRootInformationConfigWidget::apply()
|
void SysRootInformationConfigWidget::apply()
|
||||||
{
|
{
|
||||||
SysRootProfileInformation::setSysRoot(m_profile, m_chooser->fileName());
|
SysRootKitInformation::setSysRoot(m_kit, m_chooser->fileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SysRootInformationConfigWidget::discard()
|
void SysRootInformationConfigWidget::discard()
|
||||||
{
|
{
|
||||||
m_chooser->setFileName(SysRootProfileInformation::sysRoot(m_profile));
|
m_chooser->setFileName(SysRootKitInformation::sysRoot(m_kit));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SysRootInformationConfigWidget::isDirty() const
|
bool SysRootInformationConfigWidget::isDirty() const
|
||||||
{
|
{
|
||||||
return SysRootProfileInformation::sysRoot(m_profile) != m_chooser->fileName();
|
return SysRootKitInformation::sysRoot(m_kit) != m_chooser->fileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SysRootInformationConfigWidget::makeReadOnly()
|
void SysRootInformationConfigWidget::makeReadOnly()
|
||||||
@@ -107,9 +107,9 @@ QWidget *SysRootInformationConfigWidget::buttonWidget() const
|
|||||||
// ToolChainInformationConfigWidget:
|
// ToolChainInformationConfigWidget:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
ToolChainInformationConfigWidget::ToolChainInformationConfigWidget(Profile *p, QWidget *parent) :
|
ToolChainInformationConfigWidget::ToolChainInformationConfigWidget(Kit *k, QWidget *parent) :
|
||||||
ProfileConfigWidget(parent),
|
KitConfigWidget(parent),
|
||||||
m_isReadOnly(false), m_profile(p),
|
m_isReadOnly(false), m_kit(k),
|
||||||
m_comboBox(new QComboBox), m_manageButton(new QPushButton(this))
|
m_comboBox(new QComboBox), m_manageButton(new QPushButton(this))
|
||||||
{
|
{
|
||||||
setToolTip(tr("The compiler to use for building.<br>"
|
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();
|
const QString id = m_comboBox->itemData(m_comboBox->currentIndex()).toString();
|
||||||
ToolChain *tc = ToolChainManager::instance()->findToolChain(id);
|
ToolChain *tc = ToolChainManager::instance()->findToolChain(id);
|
||||||
ToolChainProfileInformation::setToolChain(m_profile, tc);
|
ToolChainKitInformation::setToolChain(m_kit, tc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolChainInformationConfigWidget::discard()
|
void ToolChainInformationConfigWidget::discard()
|
||||||
{
|
{
|
||||||
m_comboBox->setCurrentIndex(indexOf(ToolChainProfileInformation::toolChain(m_profile)));
|
m_comboBox->setCurrentIndex(indexOf(ToolChainKitInformation::toolChain(m_kit)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ToolChainInformationConfigWidget::isDirty() const
|
bool ToolChainInformationConfigWidget::isDirty() const
|
||||||
{
|
{
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(m_profile);
|
ToolChain *tc = ToolChainKitInformation::toolChain(m_kit);
|
||||||
return (m_comboBox->itemData(m_comboBox->currentIndex()).toString())
|
return (m_comboBox->itemData(m_comboBox->currentIndex()).toString())
|
||||||
== (tc ? tc->id() : QString());
|
== (tc ? tc->id() : QString());
|
||||||
}
|
}
|
||||||
@@ -235,9 +235,9 @@ int ToolChainInformationConfigWidget::indexOf(const ToolChain *tc)
|
|||||||
// DeviceTypeInformationConfigWidget:
|
// DeviceTypeInformationConfigWidget:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
DeviceTypeInformationConfigWidget::DeviceTypeInformationConfigWidget(Profile *p, QWidget *parent) :
|
DeviceTypeInformationConfigWidget::DeviceTypeInformationConfigWidget(Kit *k, QWidget *parent) :
|
||||||
ProfileConfigWidget(parent),
|
KitConfigWidget(parent),
|
||||||
m_isReadOnly(false), m_profile(p),
|
m_isReadOnly(false), m_kit(k),
|
||||||
m_comboBox(new QComboBox)
|
m_comboBox(new QComboBox)
|
||||||
{
|
{
|
||||||
setToolTip(tr("The type of device to run applications on."));
|
setToolTip(tr("The type of device to run applications on."));
|
||||||
@@ -269,12 +269,12 @@ void DeviceTypeInformationConfigWidget::apply()
|
|||||||
Core::Id devType;
|
Core::Id devType;
|
||||||
if (m_comboBox->currentIndex() >= 0)
|
if (m_comboBox->currentIndex() >= 0)
|
||||||
devType = m_comboBox->itemData(m_comboBox->currentIndex()).value<Core::Id>();
|
devType = m_comboBox->itemData(m_comboBox->currentIndex()).value<Core::Id>();
|
||||||
DeviceTypeProfileInformation::setDeviceTypeId(m_profile, devType);
|
DeviceTypeKitInformation::setDeviceTypeId(m_kit, devType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceTypeInformationConfigWidget::discard()
|
void DeviceTypeInformationConfigWidget::discard()
|
||||||
{
|
{
|
||||||
Core::Id devType = DeviceTypeProfileInformation::deviceTypeId(m_profile);
|
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(m_kit);
|
||||||
if (!devType.isValid())
|
if (!devType.isValid())
|
||||||
m_comboBox->setCurrentIndex(-1);
|
m_comboBox->setCurrentIndex(-1);
|
||||||
for (int i = 0; i < m_comboBox->count(); ++i) {
|
for (int i = 0; i < m_comboBox->count(); ++i) {
|
||||||
@@ -290,7 +290,7 @@ bool DeviceTypeInformationConfigWidget::isDirty() const
|
|||||||
Core::Id devType;
|
Core::Id devType;
|
||||||
if (m_comboBox->currentIndex() >= 0)
|
if (m_comboBox->currentIndex() >= 0)
|
||||||
devType = m_comboBox->itemData(m_comboBox->currentIndex()).value<Core::Id>();
|
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()
|
void DeviceTypeInformationConfigWidget::makeReadOnly()
|
||||||
@@ -302,9 +302,9 @@ void DeviceTypeInformationConfigWidget::makeReadOnly()
|
|||||||
// DeviceInformationConfigWidget:
|
// DeviceInformationConfigWidget:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
DeviceInformationConfigWidget::DeviceInformationConfigWidget(Profile *p, QWidget *parent) :
|
DeviceInformationConfigWidget::DeviceInformationConfigWidget(Kit *k, QWidget *parent) :
|
||||||
ProfileConfigWidget(parent),
|
KitConfigWidget(parent),
|
||||||
m_isReadOnly(false), m_profile(p),
|
m_isReadOnly(false), m_kit(k),
|
||||||
m_comboBox(new QComboBox), m_manageButton(new QPushButton(this)),
|
m_comboBox(new QComboBox), m_manageButton(new QPushButton(this)),
|
||||||
m_model(new DeviceManagerModel(DeviceManager::instance()))
|
m_model(new DeviceManagerModel(DeviceManager::instance()))
|
||||||
{
|
{
|
||||||
@@ -336,19 +336,19 @@ void DeviceInformationConfigWidget::apply()
|
|||||||
{
|
{
|
||||||
int idx = m_comboBox->currentIndex();
|
int idx = m_comboBox->currentIndex();
|
||||||
if (idx >= 0)
|
if (idx >= 0)
|
||||||
DeviceProfileInformation::setDeviceId(m_profile, m_model->deviceId(idx));
|
DeviceKitInformation::setDeviceId(m_kit, m_model->deviceId(idx));
|
||||||
else
|
else
|
||||||
DeviceProfileInformation::setDeviceId(m_profile, IDevice::invalidId());
|
DeviceKitInformation::setDeviceId(m_kit, IDevice::invalidId());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceInformationConfigWidget::discard()
|
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
|
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());
|
return devId != m_model->deviceId(m_comboBox->currentIndex());
|
||||||
}
|
}
|
||||||
|
|
@@ -28,10 +28,10 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef PROFILEINFORMATIONCONFIGWIDGET_H
|
#ifndef KITINFORMATIONCONFIGWIDGET_H
|
||||||
#define PROFILEINFORMATIONCONFIGWIDGET_H
|
#define KITINFORMATIONCONFIGWIDGET_H
|
||||||
|
|
||||||
#include "profileconfigwidget.h"
|
#include "kitconfigwidget.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
@@ -43,7 +43,7 @@ namespace Utils { class PathChooser; }
|
|||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class DeviceManagerModel;
|
class DeviceManagerModel;
|
||||||
class Profile;
|
class Kit;
|
||||||
class ToolChain;
|
class ToolChain;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -52,12 +52,12 @@ namespace Internal {
|
|||||||
// SysRootInformationConfigWidget:
|
// SysRootInformationConfigWidget:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class SysRootInformationConfigWidget : public ProfileConfigWidget
|
class SysRootInformationConfigWidget : public KitConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SysRootInformationConfigWidget(Profile *p, QWidget *parent = 0);
|
explicit SysRootInformationConfigWidget(Kit *k, QWidget *parent = 0);
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
void apply();
|
void apply();
|
||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
QWidget *buttonWidget() const;
|
QWidget *buttonWidget() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Profile *m_profile;
|
Kit *m_kit;
|
||||||
Utils::PathChooser *m_chooser;
|
Utils::PathChooser *m_chooser;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -75,12 +75,12 @@ private:
|
|||||||
// ToolChainInformationConfigWidget:
|
// ToolChainInformationConfigWidget:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class ToolChainInformationConfigWidget : public ProfileConfigWidget
|
class ToolChainInformationConfigWidget : public KitConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ToolChainInformationConfigWidget(Profile *p, QWidget *parent = 0);
|
explicit ToolChainInformationConfigWidget(Kit *k, QWidget *parent = 0);
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
void apply();
|
void apply();
|
||||||
@@ -100,7 +100,7 @@ private:
|
|||||||
int indexOf(const ToolChain *tc);
|
int indexOf(const ToolChain *tc);
|
||||||
|
|
||||||
bool m_isReadOnly;
|
bool m_isReadOnly;
|
||||||
Profile *m_profile;
|
Kit *m_kit;
|
||||||
QComboBox *m_comboBox;
|
QComboBox *m_comboBox;
|
||||||
QPushButton *m_manageButton;
|
QPushButton *m_manageButton;
|
||||||
};
|
};
|
||||||
@@ -109,12 +109,12 @@ private:
|
|||||||
// DeviceTypeInformationConfigWidget:
|
// DeviceTypeInformationConfigWidget:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class DeviceTypeInformationConfigWidget : public ProfileConfigWidget
|
class DeviceTypeInformationConfigWidget : public KitConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DeviceTypeInformationConfigWidget(Profile *p, QWidget *parent = 0);
|
explicit DeviceTypeInformationConfigWidget(Kit *k, QWidget *parent = 0);
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
void apply();
|
void apply();
|
||||||
@@ -124,7 +124,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_isReadOnly;
|
bool m_isReadOnly;
|
||||||
Profile *m_profile;
|
Kit *m_kit;
|
||||||
QComboBox *m_comboBox;
|
QComboBox *m_comboBox;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -132,12 +132,12 @@ private:
|
|||||||
// DeviceInformationConfigWidget:
|
// DeviceInformationConfigWidget:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class DeviceInformationConfigWidget : public ProfileConfigWidget
|
class DeviceInformationConfigWidget : public KitConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DeviceInformationConfigWidget(Profile *p, QWidget *parent = 0);
|
explicit DeviceInformationConfigWidget(Kit *k, QWidget *parent = 0);
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
void apply();
|
void apply();
|
||||||
@@ -151,7 +151,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_isReadOnly;
|
bool m_isReadOnly;
|
||||||
Profile *m_profile;
|
Kit *m_kit;
|
||||||
QComboBox *m_comboBox;
|
QComboBox *m_comboBox;
|
||||||
QPushButton *m_manageButton;
|
QPushButton *m_manageButton;
|
||||||
DeviceManagerModel *m_model;
|
DeviceManagerModel *m_model;
|
||||||
@@ -160,4 +160,4 @@ private:
|
|||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace ProjectExplorer
|
} // 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>
|
#include <utils/detailswidget.h>
|
||||||
|
|
||||||
@@ -46,11 +46,11 @@
|
|||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
ProfileManagerConfigWidget::ProfileManagerConfigWidget(Profile *p, QWidget *parent) :
|
KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, QWidget *parent) :
|
||||||
ProfileConfigWidget(parent),
|
KitConfigWidget(parent),
|
||||||
m_layout(new QGridLayout),
|
m_layout(new QGridLayout),
|
||||||
m_iconButton(new QToolButton),
|
m_iconButton(new QToolButton),
|
||||||
m_profile(p)
|
m_kit(k)
|
||||||
{
|
{
|
||||||
m_layout->setMargin(0);
|
m_layout->setMargin(0);
|
||||||
m_layout->setSpacing(6);
|
m_layout->setSpacing(6);
|
||||||
@@ -88,35 +88,35 @@ ProfileManagerConfigWidget::ProfileManagerConfigWidget(Profile *p, QWidget *pare
|
|||||||
connect(m_iconButton, SIGNAL(clicked()), this, SLOT(setIcon()));
|
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();
|
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();
|
w->discard();
|
||||||
m_iconButton->setIcon(m_profile->icon());
|
m_iconButton->setIcon(m_kit->icon());
|
||||||
m_iconPath = m_profile->iconPath();
|
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())
|
if (w->isDirty())
|
||||||
return true;
|
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(widget);
|
||||||
Q_ASSERT(!m_widgets.contains(widget));
|
Q_ASSERT(!m_widgets.contains(widget));
|
||||||
@@ -138,14 +138,14 @@ void ProfileManagerConfigWidget::addConfigWidget(ProjectExplorer::ProfileConfigW
|
|||||||
m_widgets.append(widget);
|
m_widgets.append(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileManagerConfigWidget::makeReadOnly()
|
void KitManagerConfigWidget::makeReadOnly()
|
||||||
{
|
{
|
||||||
foreach (ProfileConfigWidget *w, m_widgets)
|
foreach (KitConfigWidget *w, m_widgets)
|
||||||
w->makeReadOnly();
|
w->makeReadOnly();
|
||||||
m_iconButton->setEnabled(false);
|
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)"));
|
const QString path = QFileDialog::getOpenFileName(0, tr("Select Icon"), m_iconPath, tr("Images (*.png *.xpm *.jpg)"));
|
||||||
if (path.isEmpty())
|
if (path.isEmpty())
|
@@ -28,10 +28,10 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef PROFILEMANAGERWIDGET_H
|
#ifndef KITMANAGERWIDGET_H
|
||||||
#define PROFILEMANAGERWIDGET_H
|
#define KITMANAGERWIDGET_H
|
||||||
|
|
||||||
#include "profileconfigwidget.h"
|
#include "kitconfigwidget.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QHBoxLayout;
|
class QHBoxLayout;
|
||||||
@@ -40,23 +40,23 @@ class QToolButton;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
class Profile;
|
class Kit;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ProfileManagerConfigWidget : public ProjectExplorer::ProfileConfigWidget
|
class KitManagerConfigWidget : public ProjectExplorer::KitConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ProfileManagerConfigWidget(Profile *p, QWidget *parent = 0);
|
explicit KitManagerConfigWidget(Kit *k, QWidget *parent = 0);
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
|
||||||
void apply();
|
void apply();
|
||||||
void discard();
|
void discard();
|
||||||
bool isDirty() const;
|
bool isDirty() const;
|
||||||
void addConfigWidget(ProjectExplorer::ProfileConfigWidget *widget);
|
void addConfigWidget(ProjectExplorer::KitConfigWidget *widget);
|
||||||
void makeReadOnly();
|
void makeReadOnly();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@@ -65,12 +65,12 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
QGridLayout *m_layout;
|
QGridLayout *m_layout;
|
||||||
QToolButton *m_iconButton;
|
QToolButton *m_iconButton;
|
||||||
QList<ProfileConfigWidget *> m_widgets;
|
QList<KitConfigWidget *> m_widgets;
|
||||||
Profile *m_profile;
|
Kit *m_kit;
|
||||||
QString m_iconPath;
|
QString m_iconPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
#endif // PROFILEMANAGERCONFIGWIDGET_H
|
#endif // KITMANAGERWIDGET_H
|
@@ -28,11 +28,11 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "profilemodel.h"
|
#include "kitmodel.h"
|
||||||
|
|
||||||
#include "profile.h"
|
#include "kit.h"
|
||||||
#include "profileconfigwidget.h"
|
#include "kitconfigwidget.h"
|
||||||
#include "profilemanager.h"
|
#include "kitmanager.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -43,128 +43,128 @@
|
|||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ProfileNode
|
class KitNode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit ProfileNode(ProfileNode *pn, Profile *p = 0, bool c = false) :
|
explicit KitNode(KitNode *pn, Kit *k = 0, bool c = false) :
|
||||||
parent(pn), profile(p), changed(c)
|
parent(pn), kit(k), changed(c)
|
||||||
{
|
{
|
||||||
if (pn)
|
if (pn)
|
||||||
pn->childNodes.append(this);
|
pn->childNodes.append(this);
|
||||||
widget = ProfileManager::instance()->createConfigWidget(p);
|
widget = KitManager::instance()->createConfigWidget(k);
|
||||||
if (widget) {
|
if (widget) {
|
||||||
if (p && p->isAutoDetected())
|
if (k && k->isAutoDetected())
|
||||||
widget->makeReadOnly();
|
widget->makeReadOnly();
|
||||||
widget->setVisible(false);
|
widget->setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
~ProfileNode()
|
~KitNode()
|
||||||
{
|
{
|
||||||
if (parent)
|
if (parent)
|
||||||
parent->childNodes.removeOne(this);
|
parent->childNodes.removeOne(this);
|
||||||
|
|
||||||
// deleting a child removes it from childNodes
|
// deleting a child removes it from childNodes
|
||||||
// so operate on a temporary list
|
// so operate on a temporary list
|
||||||
QList<ProfileNode *> tmp = childNodes;
|
QList<KitNode *> tmp = childNodes;
|
||||||
qDeleteAll(tmp);
|
qDeleteAll(tmp);
|
||||||
Q_ASSERT(childNodes.isEmpty());
|
Q_ASSERT(childNodes.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileNode *parent;
|
KitNode *parent;
|
||||||
QString newName;
|
QString newName;
|
||||||
QList<ProfileNode *> childNodes;
|
QList<KitNode *> childNodes;
|
||||||
Profile *profile;
|
Kit *kit;
|
||||||
ProfileConfigWidget *widget;
|
KitConfigWidget *widget;
|
||||||
bool changed;
|
bool changed;
|
||||||
};
|
};
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// ProfileModel
|
// KitModel
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
ProfileModel::ProfileModel(QBoxLayout *parentLayout, QObject *parent) :
|
KitModel::KitModel(QBoxLayout *parentLayout, QObject *parent) :
|
||||||
QAbstractItemModel(parent),
|
QAbstractItemModel(parent),
|
||||||
m_parentLayout(parentLayout),
|
m_parentLayout(parentLayout),
|
||||||
m_defaultNode(0)
|
m_defaultNode(0)
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_parentLayout);
|
Q_ASSERT(m_parentLayout);
|
||||||
|
|
||||||
connect(ProfileManager::instance(), SIGNAL(profileAdded(ProjectExplorer::Profile*)),
|
connect(KitManager::instance(), SIGNAL(kitAdded(ProjectExplorer::Kit*)),
|
||||||
this, SLOT(addProfile(ProjectExplorer::Profile*)));
|
this, SLOT(addKit(ProjectExplorer::Kit*)));
|
||||||
connect(ProfileManager::instance(), SIGNAL(profileRemoved(ProjectExplorer::Profile*)),
|
connect(KitManager::instance(), SIGNAL(kitRemoved(ProjectExplorer::Kit*)),
|
||||||
this, SLOT(removeProfile(ProjectExplorer::Profile*)));
|
this, SLOT(removeKit(ProjectExplorer::Kit*)));
|
||||||
connect(ProfileManager::instance(), SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
connect(KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||||
this, SLOT(updateProfile(ProjectExplorer::Profile*)));
|
this, SLOT(updateKit(ProjectExplorer::Kit*)));
|
||||||
connect(ProfileManager::instance(), SIGNAL(defaultProfileChanged()),
|
connect(KitManager::instance(), SIGNAL(defaultkitChanged()),
|
||||||
this, SLOT(changeDefaultProfile()));
|
this, SLOT(changeDefaultKit()));
|
||||||
|
|
||||||
m_root = new ProfileNode(0);
|
m_root = new KitNode(0);
|
||||||
m_autoRoot = new ProfileNode(m_root);
|
m_autoRoot = new KitNode(m_root);
|
||||||
m_manualRoot = new ProfileNode(m_root);
|
m_manualRoot = new KitNode(m_root);
|
||||||
|
|
||||||
foreach (Profile *p, ProfileManager::instance()->profiles())
|
foreach (Kit *k, KitManager::instance()->kits())
|
||||||
addProfile(p);
|
addKit(k);
|
||||||
|
|
||||||
changeDefaultProfile();
|
changeDefaultKit();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileModel::~ProfileModel()
|
KitModel::~KitModel()
|
||||||
{
|
{
|
||||||
delete m_root;
|
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 (!parent.isValid()) {
|
||||||
if (row >= 0 && row < m_root->childNodes.count())
|
if (row >= 0 && row < m_root->childNodes.count())
|
||||||
return createIndex(row, column, m_root->childNodes.at(row));
|
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)
|
if (row < node->childNodes.count() && column == 0)
|
||||||
return createIndex(row, column, node->childNodes.at(row));
|
return createIndex(row, column, node->childNodes.at(row));
|
||||||
else
|
else
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex ProfileModel::parent(const QModelIndex &idx) const
|
QModelIndex KitModel::parent(const QModelIndex &idx) const
|
||||||
{
|
{
|
||||||
if (!idx.isValid())
|
if (!idx.isValid())
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
ProfileNode *node = static_cast<ProfileNode *>(idx.internalPointer());
|
KitNode *node = static_cast<KitNode *>(idx.internalPointer());
|
||||||
if (node->parent == m_root)
|
if (node->parent == m_root)
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
return index(node->parent);
|
return index(node->parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ProfileModel::rowCount(const QModelIndex &parent) const
|
int KitModel::rowCount(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
if (!parent.isValid())
|
if (!parent.isValid())
|
||||||
return m_root->childNodes.count();
|
return m_root->childNodes.count();
|
||||||
ProfileNode *node = static_cast<ProfileNode *>(parent.internalPointer());
|
KitNode *node = static_cast<KitNode *>(parent.internalPointer());
|
||||||
return node->childNodes.count();
|
return node->childNodes.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
int ProfileModel::columnCount(const QModelIndex &parent) const
|
int KitModel::columnCount(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(parent);
|
Q_UNUSED(parent);
|
||||||
return 1;
|
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");
|
static QIcon warningIcon(":/projectexplorer/images/compile_warning.png");
|
||||||
|
|
||||||
if (!index.isValid() || index.column() != 0)
|
if (!index.isValid() || index.column() != 0)
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
ProfileNode *node = static_cast<ProfileNode *>(index.internalPointer());
|
KitNode *node = static_cast<KitNode *>(index.internalPointer());
|
||||||
QTC_ASSERT(node, return QVariant());
|
QTC_ASSERT(node, return QVariant());
|
||||||
if (node == m_autoRoot && role == Qt::DisplayRole)
|
if (node == m_autoRoot && role == Qt::DisplayRole)
|
||||||
return tr("Auto-detected");
|
return tr("Auto-detected");
|
||||||
if (node == m_manualRoot && role == Qt::DisplayRole)
|
if (node == m_manualRoot && role == Qt::DisplayRole)
|
||||||
return tr("Manual");
|
return tr("Manual");
|
||||||
if (node->profile) {
|
if (node->kit) {
|
||||||
if (role == Qt::FontRole) {
|
if (role == Qt::FontRole) {
|
||||||
QFont f = QApplication::font();
|
QFont f = QApplication::font();
|
||||||
if (node->changed)
|
if (node->changed)
|
||||||
@@ -173,54 +173,54 @@ QVariant ProfileModel::data(const QModelIndex &index, int role) const
|
|||||||
f.setItalic(f.style() != QFont::StyleItalic);
|
f.setItalic(f.style() != QFont::StyleItalic);
|
||||||
return f;
|
return f;
|
||||||
} else if (role == Qt::DisplayRole) {
|
} 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)
|
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);
|
baseName = tr("%1 (default)").arg(baseName);
|
||||||
return baseName;
|
return baseName;
|
||||||
} else if (role == Qt::EditRole) {
|
} 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) {
|
} else if (role == Qt::DecorationRole) {
|
||||||
return node->profile->isValid() ? QIcon() : warningIcon;
|
return node->kit->isValid() ? QIcon() : warningIcon;
|
||||||
} else if (role == Qt::ToolTipRole) {
|
} else if (role == Qt::ToolTipRole) {
|
||||||
return node->profile->toHtml();
|
return node->kit->toHtml();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QVariant();
|
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())
|
if (!index.isValid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ProfileNode *node = static_cast<ProfileNode *>(index.internalPointer());
|
KitNode *node = static_cast<KitNode *>(index.internalPointer());
|
||||||
Q_ASSERT(node);
|
Q_ASSERT(node);
|
||||||
if (index.column() != 0 || !node->profile || role != Qt::EditRole)
|
if (index.column() != 0 || !node->kit || role != Qt::EditRole)
|
||||||
return false;
|
return false;
|
||||||
node->newName = value.toString();
|
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;
|
node->changed = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::ItemFlags ProfileModel::flags(const QModelIndex &index) const
|
Qt::ItemFlags KitModel::flags(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ProfileNode *node = static_cast<ProfileNode *>(index.internalPointer());
|
KitNode *node = static_cast<KitNode *>(index.internalPointer());
|
||||||
Q_ASSERT(node);
|
Q_ASSERT(node);
|
||||||
if (!node->profile)
|
if (!node->kit)
|
||||||
return Qt::ItemIsEnabled;
|
return Qt::ItemIsEnabled;
|
||||||
|
|
||||||
if (node->profile->isAutoDetected())
|
if (node->kit->isAutoDetected())
|
||||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||||
|
|
||||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
|
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);
|
Q_UNUSED(section);
|
||||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
||||||
@@ -228,64 +228,64 @@ QVariant ProfileModel::headerData(int section, Qt::Orientation orientation, int
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *ProfileModel::profile(const QModelIndex &index)
|
Kit *KitModel::kit(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return 0;
|
return 0;
|
||||||
ProfileNode *node = static_cast<ProfileNode *>(index.internalPointer());
|
KitNode *node = static_cast<KitNode *>(index.internalPointer());
|
||||||
Q_ASSERT(node);
|
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();
|
return n ? index(n) : QModelIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileModel::setDefaultProfile(const QModelIndex &index)
|
void KitModel::setDefaultKit(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return;
|
return;
|
||||||
ProfileNode *node = static_cast<ProfileNode *>(index.internalPointer());
|
KitNode *node = static_cast<KitNode *>(index.internalPointer());
|
||||||
Q_ASSERT(node);
|
Q_ASSERT(node);
|
||||||
if (node->profile)
|
if (node->kit)
|
||||||
setDefaultNode(node);
|
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())
|
if (!index.isValid())
|
||||||
return 0;
|
return 0;
|
||||||
ProfileNode *node = static_cast<ProfileNode *>(index.internalPointer());
|
KitNode *node = static_cast<KitNode *>(index.internalPointer());
|
||||||
Q_ASSERT(node);
|
Q_ASSERT(node);
|
||||||
return node->widget;
|
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)
|
if (n->changed)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
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;
|
return n ? !n->changed : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileModel::setDirty()
|
void KitModel::setDirty()
|
||||||
{
|
{
|
||||||
ProfileConfigWidget *w = qobject_cast<ProfileConfigWidget *>(sender());
|
KitConfigWidget *w = qobject_cast<KitConfigWidget *>(sender());
|
||||||
foreach (ProfileNode *n, m_manualRoot->childNodes) {
|
foreach (KitNode *n, m_manualRoot->childNodes) {
|
||||||
if (n->widget == w) {
|
if (n->widget == w) {
|
||||||
n->changed = true;
|
n->changed = true;
|
||||||
emit dataChanged(index(n, 0), index(n, columnCount(QModelIndex())));
|
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:
|
// Remove unused kits:
|
||||||
QList<ProfileNode *> nodes = m_toRemoveList;
|
QList<KitNode *> nodes = m_toRemoveList;
|
||||||
foreach (ProfileNode *n, nodes) {
|
foreach (KitNode *n, nodes) {
|
||||||
Q_ASSERT(!n->parent);
|
Q_ASSERT(!n->parent);
|
||||||
ProfileManager::instance()->deregisterProfile(n->profile);
|
KitManager::instance()->deregisterKit(n->kit);
|
||||||
}
|
}
|
||||||
Q_ASSERT(m_toRemoveList.isEmpty());
|
Q_ASSERT(m_toRemoveList.isEmpty());
|
||||||
|
|
||||||
// Update profiles:
|
// Update kits:
|
||||||
foreach (ProfileNode *n, m_manualRoot->childNodes) {
|
foreach (KitNode *n, m_manualRoot->childNodes) {
|
||||||
Q_ASSERT(n);
|
Q_ASSERT(n);
|
||||||
Q_ASSERT(n->profile);
|
Q_ASSERT(n->kit);
|
||||||
if (n->changed) {
|
if (n->changed) {
|
||||||
ProfileManager::instance()->blockSignals(true);
|
KitManager::instance()->blockSignals(true);
|
||||||
if (!n->newName.isEmpty()) {
|
if (!n->newName.isEmpty()) {
|
||||||
n->profile->setDisplayName(n->newName);
|
n->kit->setDisplayName(n->newName);
|
||||||
n->newName.clear();
|
n->newName.clear();
|
||||||
}
|
}
|
||||||
if (n->widget)
|
if (n->widget)
|
||||||
n->widget->apply();
|
n->widget->apply();
|
||||||
n->changed = false;
|
n->changed = false;
|
||||||
|
|
||||||
ProfileManager::instance()->blockSignals(false);
|
KitManager::instance()->blockSignals(false);
|
||||||
ProfileManager::instance()->notifyAboutUpdate(n->profile);
|
KitManager::instance()->notifyAboutUpdate(n->kit);
|
||||||
emit dataChanged(index(n, 0), index(n, columnCount(QModelIndex())));
|
emit dataChanged(index(n, 0), index(n, columnCount(QModelIndex())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new (and already updated) profiles
|
// Add new (and already updated) kits
|
||||||
QStringList removedSts;
|
QStringList removedSts;
|
||||||
nodes = m_toAddList;
|
nodes = m_toAddList;
|
||||||
foreach (ProfileNode *n, nodes) {
|
foreach (KitNode *n, nodes) {
|
||||||
if (!ProfileManager::instance()->registerProfile(n->profile))
|
if (!KitManager::instance()->registerKit(n->kit))
|
||||||
removedSts << n->profile->displayName();
|
removedSts << n->kit->displayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (ProfileNode *n, m_toAddList)
|
foreach (KitNode *n, m_toAddList)
|
||||||
markForRemoval(n->profile);
|
markForRemoval(n->kit);
|
||||||
|
|
||||||
if (removedSts.count() == 1) {
|
if (removedSts.count() == 1) {
|
||||||
QMessageBox::warning(0,
|
QMessageBox::warning(0,
|
||||||
tr("Duplicate Target Detected"),
|
tr("Duplicate Kit Detected"),
|
||||||
tr("The target<br> %1<br>"
|
tr("The kit<br> %1<br>"
|
||||||
" was already configured. It was not configured again.")
|
" was already configured. It was not configured again.")
|
||||||
.arg(removedSts.at(0)));
|
.arg(removedSts.at(0)));
|
||||||
|
|
||||||
} else if (!removedSts.isEmpty()) {
|
} else if (!removedSts.isEmpty()) {
|
||||||
QMessageBox::warning(0,
|
QMessageBox::warning(0,
|
||||||
tr("Duplicate Targets Detected"),
|
tr("Duplicate Kits Detected"),
|
||||||
tr("The following targets were already configured:<br>"
|
tr("The following kits were already configured:<br>"
|
||||||
" %1<br>"
|
" %1<br>"
|
||||||
"They were not configured again.")
|
"They were not configured again.")
|
||||||
.arg(removedSts.join(QLatin1String(",<br> "))));
|
.arg(removedSts.join(QLatin1String(",<br> "))));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set default profile:
|
// Set default kit:
|
||||||
if (m_defaultNode)
|
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)
|
if (!node)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (node == m_defaultNode) {
|
if (node == m_defaultNode) {
|
||||||
ProfileNode *newDefault = 0;
|
KitNode *newDefault = 0;
|
||||||
if (!m_autoRoot->childNodes.isEmpty())
|
if (!m_autoRoot->childNodes.isEmpty())
|
||||||
newDefault = m_autoRoot->childNodes.at(0);
|
newDefault = m_autoRoot->childNodes.at(0);
|
||||||
else if (!m_manualRoot->childNodes.isEmpty())
|
else if (!m_manualRoot->childNodes.isEmpty())
|
||||||
@@ -374,8 +374,8 @@ void ProfileModel::markForRemoval(Profile *p)
|
|||||||
m_manualRoot->childNodes.removeOne(node);
|
m_manualRoot->childNodes.removeOne(node);
|
||||||
node->parent = 0;
|
node->parent = 0;
|
||||||
if (m_toAddList.contains(node)) {
|
if (m_toAddList.contains(node)) {
|
||||||
delete node->profile;
|
delete node->kit;
|
||||||
node->profile = 0;
|
node->kit = 0;
|
||||||
m_toAddList.removeOne(node);
|
m_toAddList.removeOne(node);
|
||||||
delete node;
|
delete node;
|
||||||
} else {
|
} else {
|
||||||
@@ -384,12 +384,12 @@ void ProfileModel::markForRemoval(Profile *p)
|
|||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileModel::markForAddition(Profile *p)
|
void KitModel::markForAddition(Kit *k)
|
||||||
{
|
{
|
||||||
int pos = m_manualRoot->childNodes.size();
|
int pos = m_manualRoot->childNodes.size();
|
||||||
beginInsertRows(index(m_manualRoot), pos, pos);
|
beginInsertRows(index(m_manualRoot), pos, pos);
|
||||||
|
|
||||||
ProfileNode *node = createNode(m_manualRoot, p, true);
|
KitNode *node = createNode(m_manualRoot, k, true);
|
||||||
m_toAddList.append(node);
|
m_toAddList.append(node);
|
||||||
|
|
||||||
if (!m_defaultNode)
|
if (!m_defaultNode)
|
||||||
@@ -398,7 +398,7 @@ void ProfileModel::markForAddition(Profile *p)
|
|||||||
endInsertRows();
|
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)
|
if (node->parent == 0) // is root (or was marked for deletion)
|
||||||
return QModelIndex();
|
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));
|
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) {
|
foreach (KitNode *n, m_autoRoot->childNodes) {
|
||||||
if (n->profile == p)
|
if (n->kit == k)
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
foreach (ProfileNode *n, m_manualRoot->childNodes) {
|
foreach (KitNode *n, m_manualRoot->childNodes) {
|
||||||
if (n->profile == p)
|
if (n->kit == k)
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
return 0;
|
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) {
|
if (node->widget) {
|
||||||
node->widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
node->widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
m_parentLayout->addWidget(node->widget, 10);
|
m_parentLayout->addWidget(node->widget, 10);
|
||||||
@@ -433,7 +433,7 @@ ProfileNode *ProfileModel::createNode(ProfileNode *parent, Profile *p, bool chan
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileModel::setDefaultNode(ProfileNode *node)
|
void KitModel::setDefaultNode(KitNode *node)
|
||||||
{
|
{
|
||||||
if (m_defaultNode) {
|
if (m_defaultNode) {
|
||||||
QModelIndex idx = index(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;
|
QList<KitNode *> nodes = m_toAddList;
|
||||||
foreach (ProfileNode *n, nodes) {
|
foreach (KitNode *n, nodes) {
|
||||||
if (n->profile == p) {
|
if (n->kit == k) {
|
||||||
m_toAddList.removeOne(n);
|
m_toAddList.removeOne(n);
|
||||||
// do not delete n: Still used elsewhere!
|
// do not delete n: Still used elsewhere!
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileNode *parent = m_manualRoot;
|
KitNode *parent = m_manualRoot;
|
||||||
if (p->isAutoDetected())
|
if (k->isAutoDetected())
|
||||||
parent = m_autoRoot;
|
parent = m_autoRoot;
|
||||||
int row = parent->childNodes.count();
|
int row = parent->childNodes.count();
|
||||||
|
|
||||||
beginInsertRows(index(parent), row, row);
|
beginInsertRows(index(parent), row, row);
|
||||||
createNode(parent, p, false);
|
createNode(parent, k, false);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
|
|
||||||
emit profileStateChanged();
|
emit kitStateChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileModel::removeProfile(Profile *p)
|
void KitModel::removeKit(Kit *k)
|
||||||
{
|
{
|
||||||
QList<ProfileNode *> nodes = m_toRemoveList;
|
QList<KitNode *> nodes = m_toRemoveList;
|
||||||
foreach (ProfileNode *n, nodes) {
|
foreach (KitNode *n, nodes) {
|
||||||
if (n->profile == p) {
|
if (n->kit == k) {
|
||||||
m_toRemoveList.removeOne(n);
|
m_toRemoveList.removeOne(n);
|
||||||
delete n;
|
delete n;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileNode *parent = m_manualRoot;
|
KitNode *parent = m_manualRoot;
|
||||||
if (p->isAutoDetected())
|
if (k->isAutoDetected())
|
||||||
parent = m_autoRoot;
|
parent = m_autoRoot;
|
||||||
int row = 0;
|
int row = 0;
|
||||||
ProfileNode *node = 0;
|
KitNode *node = 0;
|
||||||
foreach (ProfileNode *current, parent->childNodes) {
|
foreach (KitNode *current, parent->childNodes) {
|
||||||
if (current->profile == p) {
|
if (current->kit == k) {
|
||||||
node = current;
|
node = current;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -500,13 +500,13 @@ void ProfileModel::removeProfile(Profile *p)
|
|||||||
delete node;
|
delete node;
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
|
|
||||||
emit profileStateChanged();
|
emit kitStateChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileModel::updateProfile(Profile *p)
|
void KitModel::updateKit(Kit *k)
|
||||||
{
|
{
|
||||||
ProfileNode *n = find(p);
|
KitNode *n = find(k);
|
||||||
// This can happen if Qt Versions and Profiles are removed simultaneously.
|
// This can happen if Qt Versions and kits are removed simultaneously.
|
||||||
if (!n)
|
if (!n)
|
||||||
return;
|
return;
|
||||||
if (n->widget)
|
if (n->widget)
|
||||||
@@ -515,9 +515,9 @@ void ProfileModel::updateProfile(Profile *p)
|
|||||||
emit dataChanged(idx, idx);
|
emit dataChanged(idx, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileModel::changeDefaultProfile()
|
void KitModel::changeDefaultKit()
|
||||||
{
|
{
|
||||||
setDefaultNode(find(ProfileManager::instance()->defaultProfile()));
|
setDefaultNode(find(KitManager::instance()->defaultKit()));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
@@ -28,8 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef PROFILEMODEL_H
|
#ifndef KITMODEL_H
|
||||||
#define PROFILEMODEL_H
|
#define KITMODEL_H
|
||||||
|
|
||||||
#include "projectexplorer_export.h"
|
#include "projectexplorer_export.h"
|
||||||
|
|
||||||
@@ -42,26 +42,26 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class Profile;
|
class Kit;
|
||||||
class ProfileConfigWidget;
|
class KitConfigWidget;
|
||||||
class ProfileFactory;
|
class KitFactory;
|
||||||
class ProfileManager;
|
class KitManager;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ProfileNode;
|
class KitNode;
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// ProfileModel:
|
// KitModel:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class ProfileModel : public QAbstractItemModel
|
class KitModel : public QAbstractItemModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ProfileModel(QBoxLayout *parentLayout, QObject *parent = 0);
|
explicit KitModel(QBoxLayout *parentLayout, QObject *parent = 0);
|
||||||
~ProfileModel();
|
~KitModel();
|
||||||
|
|
||||||
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
|
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
|
||||||
QModelIndex parent(const QModelIndex &index) const;
|
QModelIndex parent(const QModelIndex &index) const;
|
||||||
@@ -73,50 +73,50 @@ public:
|
|||||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
Profile *profile(const QModelIndex &);
|
Kit *kit(const QModelIndex &);
|
||||||
QModelIndex indexOf(Profile *p) const;
|
QModelIndex indexOf(Kit *k) const;
|
||||||
|
|
||||||
void setDefaultProfile(const QModelIndex &index);
|
void setDefaultKit(const QModelIndex &index);
|
||||||
bool isDefaultProfile(const QModelIndex &index);
|
bool isDefaultKit(const QModelIndex &index);
|
||||||
|
|
||||||
ProfileConfigWidget *widget(const QModelIndex &);
|
KitConfigWidget *widget(const QModelIndex &);
|
||||||
|
|
||||||
bool isDirty() const;
|
bool isDirty() const;
|
||||||
bool isDirty(Profile *p) const;
|
bool isDirty(Kit *k) const;
|
||||||
|
|
||||||
void apply();
|
void apply();
|
||||||
|
|
||||||
void markForRemoval(Profile *p);
|
void markForRemoval(Kit *k);
|
||||||
void markForAddition(Profile *p);
|
void markForAddition(Kit *k);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void profileStateChanged();
|
void kitStateChanged();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void addProfile(ProjectExplorer::Profile *p);
|
void addKit(ProjectExplorer::Kit *k);
|
||||||
void removeProfile(ProjectExplorer::Profile *p);
|
void removeKit(ProjectExplorer::Kit *k);
|
||||||
void updateProfile(ProjectExplorer::Profile *p);
|
void updateKit(ProjectExplorer::Kit *k);
|
||||||
void changeDefaultProfile();
|
void changeDefaultKit();
|
||||||
void setDirty();
|
void setDirty();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QModelIndex index(ProfileNode *, int column = 0) const;
|
QModelIndex index(KitNode *, int column = 0) const;
|
||||||
ProfileNode *find(Profile *) const;
|
KitNode *find(Kit *k) const;
|
||||||
ProfileNode *createNode(ProfileNode *parent, Profile *p, bool changed);
|
KitNode *createNode(KitNode *parent, Kit *k, bool changed);
|
||||||
void setDefaultNode(ProfileNode *node);
|
void setDefaultNode(KitNode *node);
|
||||||
|
|
||||||
ProfileNode *m_root;
|
KitNode *m_root;
|
||||||
ProfileNode *m_autoRoot;
|
KitNode *m_autoRoot;
|
||||||
ProfileNode *m_manualRoot;
|
KitNode *m_manualRoot;
|
||||||
|
|
||||||
QList<ProfileNode *> m_toAddList;
|
QList<KitNode *> m_toAddList;
|
||||||
QList<ProfileNode *> m_toRemoveList;
|
QList<KitNode *> m_toRemoveList;
|
||||||
|
|
||||||
QBoxLayout *m_parentLayout;
|
QBoxLayout *m_parentLayout;
|
||||||
ProfileNode *m_defaultNode;
|
KitNode *m_defaultNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
#endif // PROFILEMODEL_H
|
#endif // KITMODEL_H
|
@@ -28,13 +28,13 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "profileoptionspage.h"
|
#include "kitoptionspage.h"
|
||||||
|
|
||||||
#include "profilemodel.h"
|
#include "kitmodel.h"
|
||||||
#include "profile.h"
|
#include "kit.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
#include "profileconfigwidget.h"
|
#include "kitconfigwidget.h"
|
||||||
#include "profilemanager.h"
|
#include "kitmanager.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
@@ -50,28 +50,28 @@
|
|||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// ProfileOptionsPage:
|
// KitOptionsPage:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
ProfileOptionsPage::ProfileOptionsPage() :
|
KitOptionsPage::KitOptionsPage() :
|
||||||
m_model(0), m_selectionModel(0), m_currentWidget(0), m_toShow(0)
|
m_model(0), m_selectionModel(0), m_currentWidget(0), m_toShow(0)
|
||||||
{
|
{
|
||||||
setId(Constants::PROFILE_SETTINGS_PAGE_ID);
|
setId(Constants::KITS_SETTINGS_PAGE_ID);
|
||||||
setDisplayName(tr("Targets"));
|
setDisplayName(tr("Kits"));
|
||||||
setCategory(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY));
|
setCategory(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY));
|
||||||
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
||||||
Constants::PROJECTEXPLORER_SETTINGS_TR_CATEGORY));
|
Constants::PROJECTEXPLORER_SETTINGS_TR_CATEGORY));
|
||||||
setCategoryIcon(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON));
|
setCategoryIcon(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON));
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *ProfileOptionsPage::createPage(QWidget *parent)
|
QWidget *KitOptionsPage::createPage(QWidget *parent)
|
||||||
{
|
{
|
||||||
m_configWidget = new QWidget(parent);
|
m_configWidget = new QWidget(parent);
|
||||||
|
|
||||||
m_profilesView = new QTreeView(m_configWidget);
|
m_kitsView = new QTreeView(m_configWidget);
|
||||||
m_profilesView->setUniformRowHeights(true);
|
m_kitsView->setUniformRowHeights(true);
|
||||||
m_profilesView->header()->setStretchLastSection(true);
|
m_kitsView->header()->setStretchLastSection(true);
|
||||||
m_profilesView->setSizePolicy(m_profilesView->sizePolicy().horizontalPolicy(),
|
m_kitsView->setSizePolicy(m_kitsView->sizePolicy().horizontalPolicy(),
|
||||||
QSizePolicy::Ignored);
|
QSizePolicy::Ignored);
|
||||||
|
|
||||||
m_addButton = new QPushButton(tr("Add"), m_configWidget);
|
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));
|
buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||||
|
|
||||||
QHBoxLayout *horizontalLayout = new QHBoxLayout();
|
QHBoxLayout *horizontalLayout = new QHBoxLayout();
|
||||||
horizontalLayout->addWidget(m_profilesView);
|
horizontalLayout->addWidget(m_kitsView);
|
||||||
horizontalLayout->addLayout(buttonLayout);
|
horizontalLayout->addLayout(buttonLayout);
|
||||||
|
|
||||||
QVBoxLayout *verticalLayout = new QVBoxLayout(m_configWidget);
|
QVBoxLayout *verticalLayout = new QVBoxLayout(m_configWidget);
|
||||||
verticalLayout->addLayout(horizontalLayout);
|
verticalLayout->addLayout(horizontalLayout);
|
||||||
|
|
||||||
Q_ASSERT(!m_model);
|
Q_ASSERT(!m_model);
|
||||||
m_model = new Internal::ProfileModel(verticalLayout);
|
m_model = new Internal::KitModel(verticalLayout);
|
||||||
connect(m_model, SIGNAL(profileStateChanged()), this, SLOT(updateState()));
|
connect(m_model, SIGNAL(kitStateChanged()), this, SLOT(updateState()));
|
||||||
|
|
||||||
m_profilesView->setModel(m_model);
|
m_kitsView->setModel(m_model);
|
||||||
m_profilesView->header()->setResizeMode(0, QHeaderView::Stretch);
|
m_kitsView->header()->setResizeMode(0, QHeaderView::Stretch);
|
||||||
m_profilesView->expandAll();
|
m_kitsView->expandAll();
|
||||||
|
|
||||||
m_selectionModel = m_profilesView->selectionModel();
|
m_selectionModel = m_kitsView->selectionModel();
|
||||||
connect(m_selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
connect(m_selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||||
this, SLOT(profileSelectionChanged()));
|
this, SLOT(kitSelectionChanged()));
|
||||||
connect(ProfileManager::instance(), SIGNAL(profileAdded(ProjectExplorer::Profile*)),
|
connect(KitManager::instance(), SIGNAL(kitAdded(ProjectExplorer::Kit*)),
|
||||||
this, SLOT(profileSelectionChanged()));
|
this, SLOT(kitSelectionChanged()));
|
||||||
connect(ProfileManager::instance(), SIGNAL(profileRemoved(ProjectExplorer::Profile*)),
|
connect(KitManager::instance(), SIGNAL(kitRemoved(ProjectExplorer::Kit*)),
|
||||||
this, SLOT(profileSelectionChanged()));
|
this, SLOT(kitSelectionChanged()));
|
||||||
connect(ProfileManager::instance(), SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
connect(KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||||
this, SLOT(profileSelectionChanged()));
|
this, SLOT(kitSelectionChanged()));
|
||||||
|
|
||||||
// Set up add menu:
|
// Set up add menu:
|
||||||
connect(m_addButton, SIGNAL(clicked()), this, SLOT(addNewProfile()));
|
connect(m_addButton, SIGNAL(clicked()), this, SLOT(addNewKit()));
|
||||||
connect(m_cloneButton, SIGNAL(clicked()), this, SLOT(cloneProfile()));
|
connect(m_cloneButton, SIGNAL(clicked()), this, SLOT(cloneKit()));
|
||||||
connect(m_delButton, SIGNAL(clicked()), this, SLOT(removeProfile()));
|
connect(m_delButton, SIGNAL(clicked()), this, SLOT(removeKit()));
|
||||||
connect(m_makeDefaultButton, SIGNAL(clicked()), this, SLOT(makeDefaultProfile()));
|
connect(m_makeDefaultButton, SIGNAL(clicked()), this, SLOT(makeDefaultKit()));
|
||||||
|
|
||||||
m_searchKeywords = tr("Targets");
|
m_searchKeywords = tr("Kits");
|
||||||
|
|
||||||
updateState();
|
updateState();
|
||||||
|
|
||||||
@@ -133,13 +133,13 @@ QWidget *ProfileOptionsPage::createPage(QWidget *parent)
|
|||||||
return m_configWidget;
|
return m_configWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileOptionsPage::apply()
|
void KitOptionsPage::apply()
|
||||||
{
|
{
|
||||||
if (m_model)
|
if (m_model)
|
||||||
m_model->apply();
|
m_model->apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileOptionsPage::finish()
|
void KitOptionsPage::finish()
|
||||||
{
|
{
|
||||||
if (m_model) {
|
if (m_model) {
|
||||||
delete m_model;
|
delete m_model;
|
||||||
@@ -148,22 +148,22 @@ void ProfileOptionsPage::finish()
|
|||||||
|
|
||||||
m_configWidget = 0; // deleted by settingsdialog
|
m_configWidget = 0; // deleted by settingsdialog
|
||||||
m_selectionModel = 0; // child of m_configWidget
|
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_currentWidget = 0; // deleted by the model
|
||||||
m_toShow = 0;
|
m_toShow = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProfileOptionsPage::matches(const QString &s) const
|
bool KitOptionsPage::matches(const QString &s) const
|
||||||
{
|
{
|
||||||
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
|
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)
|
if (m_currentWidget)
|
||||||
m_currentWidget->setVisible(false);
|
m_currentWidget->setVisible(false);
|
||||||
@@ -176,63 +176,63 @@ void ProfileOptionsPage::profileSelectionChanged()
|
|||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileOptionsPage::addNewProfile()
|
void KitOptionsPage::addNewKit()
|
||||||
{
|
{
|
||||||
Profile *p = new Profile;
|
Kit *k = new Kit;
|
||||||
m_model->markForAddition(p);
|
m_model->markForAddition(k);
|
||||||
|
|
||||||
QModelIndex newIdx = m_model->indexOf(p);
|
QModelIndex newIdx = m_model->indexOf(k);
|
||||||
m_selectionModel->select(newIdx,
|
m_selectionModel->select(newIdx,
|
||||||
QItemSelectionModel::Clear
|
QItemSelectionModel::Clear
|
||||||
| QItemSelectionModel::SelectCurrent
|
| QItemSelectionModel::SelectCurrent
|
||||||
| QItemSelectionModel::Rows);
|
| QItemSelectionModel::Rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileOptionsPage::cloneProfile()
|
void KitOptionsPage::cloneKit()
|
||||||
{
|
{
|
||||||
Profile *current = m_model->profile(currentIndex());
|
Kit *current = m_model->kit(currentIndex());
|
||||||
if (!current)
|
if (!current)
|
||||||
return;
|
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,
|
m_selectionModel->select(newIdx,
|
||||||
QItemSelectionModel::Clear
|
QItemSelectionModel::Clear
|
||||||
| QItemSelectionModel::SelectCurrent
|
| QItemSelectionModel::SelectCurrent
|
||||||
| QItemSelectionModel::Rows);
|
| QItemSelectionModel::Rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileOptionsPage::removeProfile()
|
void KitOptionsPage::removeKit()
|
||||||
{
|
{
|
||||||
Profile *p = m_model->profile(currentIndex());
|
Kit *k = m_model->kit(currentIndex());
|
||||||
if (!p)
|
if (!k)
|
||||||
return;
|
return;
|
||||||
m_model->markForRemoval(p);
|
m_model->markForRemoval(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileOptionsPage::makeDefaultProfile()
|
void KitOptionsPage::makeDefaultKit()
|
||||||
{
|
{
|
||||||
m_model->setDefaultProfile(currentIndex());
|
m_model->setDefaultKit(currentIndex());
|
||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileOptionsPage::updateState()
|
void KitOptionsPage::updateState()
|
||||||
{
|
{
|
||||||
if (!m_profilesView)
|
if (!m_kitsView)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool canCopy = false;
|
bool canCopy = false;
|
||||||
bool canDelete = false;
|
bool canDelete = false;
|
||||||
bool canMakeDefault = false;
|
bool canMakeDefault = false;
|
||||||
QModelIndex index = currentIndex();
|
QModelIndex index = currentIndex();
|
||||||
Profile *p = m_model->profile(index);
|
Kit *k = m_model->kit(index);
|
||||||
if (p) {
|
if (k) {
|
||||||
canCopy = p->isValid();
|
canCopy = k->isValid();
|
||||||
canDelete = !p->isAutoDetected();
|
canDelete = !k->isAutoDetected();
|
||||||
canMakeDefault = !m_model->isDefaultProfile(index);
|
canMakeDefault = !m_model->isDefaultKit(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_cloneButton->setEnabled(canCopy);
|
m_cloneButton->setEnabled(canCopy);
|
||||||
@@ -240,7 +240,7 @@ void ProfileOptionsPage::updateState()
|
|||||||
m_makeDefaultButton->setEnabled(canMakeDefault);
|
m_makeDefaultButton->setEnabled(canMakeDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex ProfileOptionsPage::currentIndex() const
|
QModelIndex KitOptionsPage::currentIndex() const
|
||||||
{
|
{
|
||||||
if (!m_selectionModel)
|
if (!m_selectionModel)
|
||||||
return QModelIndex();
|
return QModelIndex();
|
@@ -28,8 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef PROFILEOPTIONSPAGE_H
|
#ifndef KITOPTIONSPAGE_H
|
||||||
#define PROFILEOPTIONSPAGE_H
|
#define KITOPTIONSPAGE_H
|
||||||
|
|
||||||
#include "projectexplorer_export.h"
|
#include "projectexplorer_export.h"
|
||||||
|
|
||||||
@@ -45,43 +45,43 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
namespace Internal { class ProfileModel; }
|
namespace Internal { class KitModel; }
|
||||||
|
|
||||||
class Profile;
|
class Kit;
|
||||||
class ProfileConfigWidget;
|
class KitConfigWidget;
|
||||||
class ProfileFactory;
|
class KitFactory;
|
||||||
class ProfileManager;
|
class KitManager;
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// ProfileOptionsPage:
|
// KitOptionsPage:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT ProfileOptionsPage : public Core::IOptionsPage
|
class PROJECTEXPLORER_EXPORT KitOptionsPage : public Core::IOptionsPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProfileOptionsPage();
|
KitOptionsPage();
|
||||||
|
|
||||||
QWidget *createPage(QWidget *parent);
|
QWidget *createPage(QWidget *parent);
|
||||||
void apply();
|
void apply();
|
||||||
void finish();
|
void finish();
|
||||||
bool matches(const QString &) const;
|
bool matches(const QString &) const;
|
||||||
|
|
||||||
void showProfile(Profile *p);
|
void showKit(Kit *k);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void profileSelectionChanged();
|
void kitSelectionChanged();
|
||||||
void addNewProfile();
|
void addNewKit();
|
||||||
void cloneProfile();
|
void cloneKit();
|
||||||
void removeProfile();
|
void removeKit();
|
||||||
void makeDefaultProfile();
|
void makeDefaultKit();
|
||||||
void updateState();
|
void updateState();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QModelIndex currentIndex() const;
|
QModelIndex currentIndex() const;
|
||||||
|
|
||||||
QTreeView *m_profilesView;
|
QTreeView *m_kitsView;
|
||||||
QPushButton *m_addButton;
|
QPushButton *m_addButton;
|
||||||
QPushButton *m_cloneButton;
|
QPushButton *m_cloneButton;
|
||||||
QPushButton *m_delButton;
|
QPushButton *m_delButton;
|
||||||
@@ -90,13 +90,13 @@ private:
|
|||||||
QWidget *m_configWidget;
|
QWidget *m_configWidget;
|
||||||
QString m_searchKeywords;
|
QString m_searchKeywords;
|
||||||
|
|
||||||
Internal::ProfileModel *m_model;
|
Internal::KitModel *m_model;
|
||||||
QItemSelectionModel *m_selectionModel;
|
QItemSelectionModel *m_selectionModel;
|
||||||
QWidget *m_currentWidget;
|
QWidget *m_currentWidget;
|
||||||
|
|
||||||
Profile *m_toShow;
|
Kit *m_toShow;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
#endif // PROFILEOPTIONSPAGE_H
|
#endif // KITOPTIONSPAGE_H
|
@@ -45,7 +45,7 @@
|
|||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/deployconfiguration.h>
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
#include <projectexplorer/profilemanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
#include <projectexplorer/projectmodels.h>
|
#include <projectexplorer/projectmodels.h>
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
|
|
||||||
@@ -559,7 +559,7 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
|
|||||||
grid->addWidget(m_separators[PROJECT], 2, 1);
|
grid->addWidget(m_separators[PROJECT], 2, 1);
|
||||||
|
|
||||||
QStringList titles;
|
QStringList titles;
|
||||||
titles << tr("Target") << tr("Build")
|
titles << tr("Kit") << tr("Build")
|
||||||
<< tr("Deploy") << tr("Run");
|
<< tr("Deploy") << tr("Run");
|
||||||
|
|
||||||
for (int i = TARGET; i < LAST; ++i) {
|
for (int i = TARGET; i < LAST; ++i) {
|
||||||
@@ -589,8 +589,8 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
|
|||||||
this, SLOT(updateActionAndSummary()));
|
this, SLOT(updateActionAndSummary()));
|
||||||
|
|
||||||
// for icon changes:
|
// for icon changes:
|
||||||
connect(ProjectExplorer::ProfileManager::instance(), SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
connect(ProjectExplorer::KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||||
this, SLOT(profileChanged(ProjectExplorer::Profile*)));
|
this, SLOT(kitChanged(ProjectExplorer::Kit*)));
|
||||||
|
|
||||||
connect(m_listWidgets[TARGET], SIGNAL(changeActiveProjectConfiguration(ProjectExplorer::ProjectConfiguration*)),
|
connect(m_listWidgets[TARGET], SIGNAL(changeActiveProjectConfiguration(ProjectExplorer::ProjectConfiguration*)),
|
||||||
this, SLOT(setActiveTarget(ProjectExplorer::ProjectConfiguration*)));
|
this, SLOT(setActiveTarget(ProjectExplorer::ProjectConfiguration*)));
|
||||||
@@ -994,9 +994,9 @@ void MiniProjectTargetSelector::activeTargetChanged(ProjectExplorer::Target *tar
|
|||||||
updateActionAndSummary();
|
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();
|
updateActionAndSummary();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1250,7 +1250,7 @@ void MiniProjectTargetSelector::updateSummary()
|
|||||||
summary.append(tr("Project: <b>%1</b><br/>").arg(startupProject->displayName()));
|
summary.append(tr("Project: <b>%1</b><br/>").arg(startupProject->displayName()));
|
||||||
if (Target *activeTarget = m_sessionManager->startupProject()->activeTarget()) {
|
if (Target *activeTarget = m_sessionManager->startupProject()->activeTarget()) {
|
||||||
if (!m_listWidgets[TARGET]->isVisibleTo(this))
|
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())
|
if (!m_listWidgets[BUILD]->isVisibleTo(this) && activeTarget->activeBuildConfiguration())
|
||||||
summary.append(tr("Build: <b>%1</b><br/>").arg(
|
summary.append(tr("Build: <b>%1</b><br/>").arg(
|
||||||
activeTarget->activeBuildConfiguration()->displayName()));
|
activeTarget->activeBuildConfiguration()->displayName()));
|
||||||
|
@@ -41,7 +41,7 @@ class QStackedWidget;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
class Profile;
|
class Kit;
|
||||||
class Project;
|
class Project;
|
||||||
class Target;
|
class Target;
|
||||||
class BuildConfiguration;
|
class BuildConfiguration;
|
||||||
@@ -134,7 +134,7 @@ private slots:
|
|||||||
|
|
||||||
void changeStartupProject(ProjectExplorer::Project *project);
|
void changeStartupProject(ProjectExplorer::Project *project);
|
||||||
void activeTargetChanged(ProjectExplorer::Target *target);
|
void activeTargetChanged(ProjectExplorer::Target *target);
|
||||||
void profileChanged(ProjectExplorer::Profile *profile);
|
void kitChanged(ProjectExplorer::Kit *k);
|
||||||
void activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc);
|
void activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc);
|
||||||
void activeDeployConfigurationChanged(ProjectExplorer::DeployConfiguration *dc);
|
void activeDeployConfigurationChanged(ProjectExplorer::DeployConfiguration *dc);
|
||||||
void activeRunConfigurationChanged(ProjectExplorer::RunConfiguration *rc);
|
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 <coreplugin/icontext.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <projectexplorer/buildmanager.h>
|
#include <projectexplorer/buildmanager.h>
|
||||||
#include <projectexplorer/profile.h>
|
#include <projectexplorer/kit.h>
|
||||||
#include <projectexplorer/profilemanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ void Project::changeBuildConfigurationEnabled()
|
|||||||
void Project::addTarget(Target *t)
|
void Project::addTarget(Target *t)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(t && !d->m_targets.contains(t), return);
|
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);
|
Q_ASSERT(t->project() == this);
|
||||||
|
|
||||||
// Check that we don't have a configuration with the same displayName
|
// 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Target *Project::target(Profile *p) const
|
Target *Project::target(Kit *k) const
|
||||||
{
|
{
|
||||||
foreach (Target *target, d->m_targets) {
|
foreach (Target *target, d->m_targets) {
|
||||||
if (target->profile() == p)
|
if (target->kit() == k)
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Project::supportsProfile(Profile *p) const
|
bool Project::supportsKit(Kit *k) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(p);
|
Q_UNUSED(k);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Target *Project::createTarget(Profile *p)
|
Target *Project::createTarget(Kit *k)
|
||||||
{
|
{
|
||||||
if (!p || target(p))
|
if (!k || target(k))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
Target *t = new Target(this, p);
|
Target *t = new Target(this, k);
|
||||||
t->createDefaultSetup();
|
t->createDefaultSetup();
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
@@ -269,13 +269,13 @@ Target *Project::restoreTarget(const QVariantMap &data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *p = ProfileManager::instance()->find(id);
|
Kit *k = KitManager::instance()->find(id);
|
||||||
if (!p) {
|
if (!k) {
|
||||||
qWarning("Warning: No profile '%s' found. Continuing.", qPrintable(id.toString()));
|
qWarning("Warning: No profile '%s' found. Continuing.", qPrintable(id.toString()));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Target *t = new Target(this, p);
|
Target *t = new Target(this, k);
|
||||||
if (!t->fromMap(data)) {
|
if (!t->fromMap(data)) {
|
||||||
delete t;
|
delete t;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -339,11 +339,11 @@ QString Project::projectDirectory() const
|
|||||||
return projectDirectory(document()->fileName());
|
return projectDirectory(document()->fileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Project::projectDirectory(const QString &proFile)
|
QString Project::projectDirectory(const QString &top)
|
||||||
{
|
{
|
||||||
if (proFile.isEmpty())
|
if (top.isEmpty())
|
||||||
return QString();
|
return QString();
|
||||||
QFileInfo info(proFile);
|
QFileInfo info(top);
|
||||||
return info.absoluteDir().path();
|
return info.absoluteDir().path();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ class BuildConfigWidget;
|
|||||||
class IProjectManager;
|
class IProjectManager;
|
||||||
class EditorConfiguration;
|
class EditorConfiguration;
|
||||||
class ProjectNode;
|
class ProjectNode;
|
||||||
class Profile;
|
class Kit;
|
||||||
class Target;
|
class Target;
|
||||||
class ProjectPrivate;
|
class ProjectPrivate;
|
||||||
|
|
||||||
@@ -89,10 +89,10 @@ public:
|
|||||||
Target *activeTarget() const;
|
Target *activeTarget() const;
|
||||||
void setActiveTarget(Target *target);
|
void setActiveTarget(Target *target);
|
||||||
Target *target(const Core::Id id) const;
|
Target *target(const Core::Id id) const;
|
||||||
Target *target(Profile *p) const;
|
Target *target(Kit *k) const;
|
||||||
virtual bool supportsProfile(Profile *p) const;
|
virtual bool supportsKit(Kit *k) const;
|
||||||
|
|
||||||
Target *createTarget(Profile *p);
|
Target *createTarget(Kit *k);
|
||||||
Target *restoreTarget(const QVariantMap &data);
|
Target *restoreTarget(const QVariantMap &data);
|
||||||
|
|
||||||
void saveSettings();
|
void saveSettings();
|
||||||
@@ -111,9 +111,9 @@ public:
|
|||||||
|
|
||||||
virtual QVariantMap toMap() const;
|
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;
|
QString projectDirectory() const;
|
||||||
static QString projectDirectory(const QString &proFile);
|
static QString projectDirectory(const QString &top);
|
||||||
|
|
||||||
virtual Core::Context projectContext() const;
|
virtual Core::Context projectContext() const;
|
||||||
virtual Core::Context projectLanguage() const;
|
virtual Core::Context projectLanguage() const;
|
||||||
|
@@ -36,8 +36,8 @@
|
|||||||
#include "gcctoolchainfactories.h"
|
#include "gcctoolchainfactories.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "projectexplorersettings.h"
|
#include "projectexplorersettings.h"
|
||||||
#include "profilemanager.h"
|
#include "kitmanager.h"
|
||||||
#include "profileoptionspage.h"
|
#include "kitoptionspage.h"
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
#include "targetsettingspanel.h"
|
#include "targetsettingspanel.h"
|
||||||
#include "toolchainmanager.h"
|
#include "toolchainmanager.h"
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
#include "processstep.h"
|
#include "processstep.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
#include "customwizard.h"
|
#include "customwizard.h"
|
||||||
#include "profileinformation.h"
|
#include "kitinformation.h"
|
||||||
#include "projectfilewizardextension.h"
|
#include "projectfilewizardextension.h"
|
||||||
#include "projecttreewidget.h"
|
#include "projecttreewidget.h"
|
||||||
#include "projectwindow.h"
|
#include "projectwindow.h"
|
||||||
@@ -244,7 +244,7 @@ struct ProjectExplorerPluginPrivate {
|
|||||||
Core::IMode *m_projectsMode;
|
Core::IMode *m_projectsMode;
|
||||||
|
|
||||||
TaskHub *m_taskHub;
|
TaskHub *m_taskHub;
|
||||||
ProfileManager *m_profileManager;
|
KitManager *m_kitManager;
|
||||||
ToolChainManager *m_toolChainManager;
|
ToolChainManager *m_toolChainManager;
|
||||||
bool m_shuttingDown;
|
bool m_shuttingDown;
|
||||||
};
|
};
|
||||||
@@ -255,7 +255,7 @@ ProjectExplorerPluginPrivate::ProjectExplorerPluginPrivate() :
|
|||||||
m_delayedRunConfiguration(0),
|
m_delayedRunConfiguration(0),
|
||||||
m_runMode(NoRunMode),
|
m_runMode(NoRunMode),
|
||||||
m_projectsMode(0),
|
m_projectsMode(0),
|
||||||
m_profileManager(0),
|
m_kitManager(0),
|
||||||
m_toolChainManager(0),
|
m_toolChainManager(0),
|
||||||
m_shuttingDown(false)
|
m_shuttingDown(false)
|
||||||
{
|
{
|
||||||
@@ -297,7 +297,7 @@ ProjectExplorerPlugin::~ProjectExplorerPlugin()
|
|||||||
delete d->m_welcomePage;
|
delete d->m_welcomePage;
|
||||||
removeObject(this);
|
removeObject(this);
|
||||||
// Force sequence of deletion:
|
// 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->m_toolChainManager;
|
||||||
|
|
||||||
delete d;
|
delete d;
|
||||||
@@ -340,10 +340,10 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
|
|
||||||
addAutoReleasedObject(new Internal::DesktopDeviceFactory);
|
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;
|
d->m_toolChainManager = new ToolChainManager;
|
||||||
addAutoReleasedObject(new Internal::ToolChainOptionsPage);
|
addAutoReleasedObject(new Internal::ToolChainOptionsPage);
|
||||||
addAutoReleasedObject(new ProfileOptionsPage);
|
addAutoReleasedObject(new KitOptionsPage);
|
||||||
|
|
||||||
d->m_taskHub = new TaskHub;
|
d->m_taskHub = new TaskHub;
|
||||||
addAutoReleasedObject(d->m_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 = new QAction(this);
|
||||||
d->m_projectSelectorActionMenu->setEnabled(false);
|
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()));
|
connect(d->m_projectSelectorActionMenu, SIGNAL(triggered()), d->m_targetSelector, SLOT(toggleVisible()));
|
||||||
cmd = Core::ActionManager::registerAction(d->m_projectSelectorActionMenu, ProjectExplorer::Constants::SELECTTARGET,
|
cmd = Core::ActionManager::registerAction(d->m_projectSelectorActionMenu, ProjectExplorer::Constants::SELECTTARGET,
|
||||||
globalcontext);
|
globalcontext);
|
||||||
@@ -1104,10 +1104,10 @@ void ProjectExplorerPlugin::extensionsInitialized()
|
|||||||
|
|
||||||
// Register ProfileInformation:
|
// Register ProfileInformation:
|
||||||
// Only do this now to make sure all device factories were properly initialized.
|
// Only do this now to make sure all device factories were properly initialized.
|
||||||
ProfileManager::instance()->registerProfileInformation(new SysRootProfileInformation);
|
KitManager::instance()->registerKitInformation(new SysRootKitInformation);
|
||||||
ProfileManager::instance()->registerProfileInformation(new DeviceProfileInformation);
|
KitManager::instance()->registerKitInformation(new DeviceKitInformation);
|
||||||
ProfileManager::instance()->registerProfileInformation(new DeviceTypeProfileInformation);
|
KitManager::instance()->registerKitInformation(new DeviceTypeKitInformation);
|
||||||
ProfileManager::instance()->registerProfileInformation(new ToolChainProfileInformation);
|
KitManager::instance()->registerKitInformation(new ToolChainKitInformation);
|
||||||
|
|
||||||
DeviceManager *dm = DeviceManager::instance();
|
DeviceManager *dm = DeviceManager::instance();
|
||||||
if (dm->find(Core::Id(Constants::DESKTOP_DEVICE_ID)).isNull())
|
if (dm->find(Core::Id(Constants::DESKTOP_DEVICE_ID)).isNull())
|
||||||
|
@@ -20,15 +20,15 @@ HEADERS += projectexplorer.h \
|
|||||||
gcctoolchain.h \
|
gcctoolchain.h \
|
||||||
projectexplorer_export.h \
|
projectexplorer_export.h \
|
||||||
projectwindow.h \
|
projectwindow.h \
|
||||||
profile.h \
|
kit.h \
|
||||||
profilechooser.h \
|
kitchooser.h \
|
||||||
profileconfigwidget.h \
|
kitconfigwidget.h \
|
||||||
profileinformation.h \
|
kitinformation.h \
|
||||||
profileinformationconfigwidget.h \
|
kitinformationconfigwidget.h \
|
||||||
profilemanager.h \
|
kitmanager.h \
|
||||||
profilemanagerconfigwidget.h \
|
kitmanagerconfigwidget.h \
|
||||||
profilemodel.h \
|
kitmodel.h \
|
||||||
profileoptionspage.h \
|
kitoptionspage.h \
|
||||||
buildmanager.h \
|
buildmanager.h \
|
||||||
buildsteplist.h \
|
buildsteplist.h \
|
||||||
compileoutputwindow.h \
|
compileoutputwindow.h \
|
||||||
@@ -139,14 +139,14 @@ SOURCES += projectexplorer.cpp \
|
|||||||
clangparser.cpp \
|
clangparser.cpp \
|
||||||
gcctoolchain.cpp \
|
gcctoolchain.cpp \
|
||||||
projectwindow.cpp \
|
projectwindow.cpp \
|
||||||
profile.cpp \
|
kit.cpp \
|
||||||
profilechooser.cpp \
|
kitchooser.cpp \
|
||||||
profileinformation.cpp \
|
kitinformation.cpp \
|
||||||
profileinformationconfigwidget.cpp \
|
kitinformationconfigwidget.cpp \
|
||||||
profilemanager.cpp \
|
kitmanager.cpp \
|
||||||
profilemanagerconfigwidget.cpp \
|
kitmanagerconfigwidget.cpp \
|
||||||
profilemodel.cpp \
|
kitmodel.cpp \
|
||||||
profileoptionspage.cpp \
|
kitoptionspage.cpp \
|
||||||
buildmanager.cpp \
|
buildmanager.cpp \
|
||||||
buildsteplist.cpp \
|
buildsteplist.cpp \
|
||||||
compileoutputwindow.cpp \
|
compileoutputwindow.cpp \
|
||||||
|
@@ -107,23 +107,23 @@ QtcPlugin {
|
|||||||
"processparameters.h",
|
"processparameters.h",
|
||||||
"processstep.cpp",
|
"processstep.cpp",
|
||||||
"processstep.h",
|
"processstep.h",
|
||||||
"profile.cpp",
|
"kit.cpp",
|
||||||
"profile.h",
|
"kit.h",
|
||||||
"profilechooser.cpp",
|
"kitchooser.cpp",
|
||||||
"profilechooser.h",
|
"kitchooser.h",
|
||||||
"profileconfigwidget.h",
|
"kitconfigwidget.h",
|
||||||
"profileinformation.cpp",
|
"kitinformation.cpp",
|
||||||
"profileinformation.h",
|
"kitinformation.h",
|
||||||
"profileinformationconfigwidget.cpp",
|
"kitinformationconfigwidget.cpp",
|
||||||
"profileinformationconfigwidget.h",
|
"kitinformationconfigwidget.h",
|
||||||
"profilemanager.cpp",
|
"kitmanager.cpp",
|
||||||
"profilemanager.h",
|
"kitmanager.h",
|
||||||
"profilemanagerconfigwidget.cpp",
|
"kitmanagerconfigwidget.cpp",
|
||||||
"profilemanagerconfigwidget.h",
|
"kitmanagerconfigwidget.h",
|
||||||
"profilemodel.cpp",
|
"kitmodel.cpp",
|
||||||
"profilemodel.h",
|
"kitmodel.h",
|
||||||
"profileoptionspage.cpp",
|
"kitoptionspage.cpp",
|
||||||
"profileoptionspage.h",
|
"kitoptionspage.h",
|
||||||
"project.cpp",
|
"project.cpp",
|
||||||
"project.h",
|
"project.h",
|
||||||
"projectconfiguration.cpp",
|
"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_CATEGORY_ICON[] = ":/core/images/category_buildrun.png";
|
||||||
const char PROJECTEXPLORER_SETTINGS_ID[] = "A.ProjectExplorer.ProjectExplorer";
|
const char PROJECTEXPLORER_SETTINGS_ID[] = "A.ProjectExplorer.ProjectExplorer";
|
||||||
const char TOOLCHAIN_SETTINGS_PAGE_ID[] = "M.ProjectExplorer.ToolChainOptions";
|
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
|
// Device settings page
|
||||||
const char DEVICE_SETTINGS_CATEGORY[] = "X.Devices";
|
const char DEVICE_SETTINGS_CATEGORY[] = "X.Devices";
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "doubletabwidget.h"
|
#include "doubletabwidget.h"
|
||||||
|
|
||||||
#include "profilemanager.h"
|
#include "kitmanager.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "projectexplorer.h"
|
#include "projectexplorer.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
@@ -261,7 +261,7 @@ ProjectWindow::~ProjectWindow()
|
|||||||
|
|
||||||
void ProjectWindow::extensionsInitialized()
|
void ProjectWindow::extensionsInitialized()
|
||||||
{
|
{
|
||||||
connect(ProfileManager::instance(), SIGNAL(profilesChanged()), this, SLOT(handleProfilesChanges()));
|
connect(KitManager::instance(), SIGNAL(kitsChanged()), this, SLOT(handleKitChanges()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectWindow::aboutToShutdown()
|
void ProjectWindow::aboutToShutdown()
|
||||||
@@ -288,7 +288,7 @@ void ProjectWindow::projectUpdated(Project *p)
|
|||||||
m_tabWidget->setCurrentIndex(index);
|
m_tabWidget->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectWindow::handleProfilesChanges()
|
void ProjectWindow::handleKitChanges()
|
||||||
{
|
{
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
int index = m_tabWidget->currentIndex();
|
int index = m_tabWidget->currentIndex();
|
||||||
@@ -330,7 +330,7 @@ void ProjectWindow::registerProject(ProjectExplorer::Project *project)
|
|||||||
m_hasTarget.insert(project, projectHasTarget);
|
m_hasTarget.insert(project, projectHasTarget);
|
||||||
|
|
||||||
if (projectHasTarget) // Use the Targets page
|
if (projectHasTarget) // Use the Targets page
|
||||||
subtabs << QCoreApplication::translate("TargetSettingsPanelFactory", "Targets");
|
subtabs << QCoreApplication::translate("TargetSettingsPanelFactory", "Build & Run");
|
||||||
|
|
||||||
// Add the project specific pages
|
// Add the project specific pages
|
||||||
QList<IProjectPanelFactory *> factories = ExtensionSystem::PluginManager::getObjects<IProjectPanelFactory>();
|
QList<IProjectPanelFactory *> factories = ExtensionSystem::PluginManager::getObjects<IProjectPanelFactory>();
|
||||||
|
@@ -85,7 +85,7 @@ public slots:
|
|||||||
void projectUpdated(ProjectExplorer::Project *p);
|
void projectUpdated(ProjectExplorer::Project *p);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleProfilesChanges();
|
void handleKitChanges();
|
||||||
void showProperties(int index, int subIndex);
|
void showProperties(int index, int subIndex);
|
||||||
void registerProject(ProjectExplorer::Project*);
|
void registerProject(ProjectExplorer::Project*);
|
||||||
void deregisterProject(ProjectExplorer::Project*);
|
void deregisterProject(ProjectExplorer::Project*);
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
#include "abi.h"
|
#include "abi.h"
|
||||||
#include "buildconfiguration.h"
|
#include "buildconfiguration.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
#include "profileinformation.h"
|
#include "kitinformation.h"
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -357,7 +357,7 @@ ProjectExplorer::Abi RunConfiguration::abi() const
|
|||||||
BuildConfiguration *bc = target()->activeBuildConfiguration();
|
BuildConfiguration *bc = target()->activeBuildConfiguration();
|
||||||
if (!bc)
|
if (!bc)
|
||||||
return Abi::hostAbi();
|
return Abi::hostAbi();
|
||||||
ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile());
|
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
|
||||||
if (!tc)
|
if (!tc)
|
||||||
return Abi::hostAbi();
|
return Abi::hostAbi();
|
||||||
return tc->targetAbi();
|
return tc->targetAbi();
|
||||||
|
@@ -37,8 +37,8 @@
|
|||||||
#include "projectexplorersettings.h"
|
#include "projectexplorersettings.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
#include "profile.h"
|
#include "kit.h"
|
||||||
#include "profilemanager.h"
|
#include "kitmanager.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
@@ -361,10 +361,10 @@ public:
|
|||||||
QVariantMap update(Project *project, const QVariantMap &map);
|
QVariantMap update(Project *project, const QVariantMap &map);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Profile *uniqueProfile(Profile *p);
|
Kit *uniqueProfile(Kit *p);
|
||||||
void addBuildConfiguration(Profile *p, const QVariantMap &bc, int bcPos, int bcCount);
|
void addBuildConfiguration(Kit *p, const QVariantMap &bc, int bcPos, int bcCount);
|
||||||
void addDeployConfiguration(Profile *p, const QVariantMap &dc, int dcPos, int dcActive);
|
void addDeployConfiguration(Kit *p, const QVariantMap &dc, int dcPos, int dcActive);
|
||||||
void addRunConfigurations(Profile *p,
|
void addRunConfigurations(Kit *p,
|
||||||
const QMap<int, QVariantMap> &rcs, int activeRc, const QString &projectDir);
|
const QMap<int, QVariantMap> &rcs, int activeRc, const QString &projectDir);
|
||||||
|
|
||||||
void parseQtversionFile();
|
void parseQtversionFile();
|
||||||
@@ -383,7 +383,7 @@ private:
|
|||||||
QHash<QString, ToolChainExtraData> m_toolChainExtras;
|
QHash<QString, ToolChainExtraData> m_toolChainExtras;
|
||||||
QHash<int, QString> m_qtVersionExtras;
|
QHash<int, QString> m_qtVersionExtras;
|
||||||
|
|
||||||
QHash<Profile *, QVariantMap> m_targets;
|
QHash<Kit *, QVariantMap> m_targets;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
@@ -2225,11 +2225,11 @@ Version11Handler::Version11Handler()
|
|||||||
|
|
||||||
Version11Handler::~Version11Handler()
|
Version11Handler::~Version11Handler()
|
||||||
{
|
{
|
||||||
ProfileManager *pm = ProfileManager::instance();
|
KitManager *pm = KitManager::instance();
|
||||||
if (!pm) // Can happen during teardown!
|
if (!pm) // Can happen during teardown!
|
||||||
return;
|
return;
|
||||||
QList<Profile *> knownProfiles = pm->profiles();
|
QList<Kit *> knownProfiles = pm->kits();
|
||||||
foreach (Profile *p, m_targets.keys()) {
|
foreach (Kit *p, m_targets.keys()) {
|
||||||
if (!knownProfiles.contains(p))
|
if (!knownProfiles.contains(p))
|
||||||
delete p;
|
delete p;
|
||||||
}
|
}
|
||||||
@@ -2248,8 +2248,8 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
|||||||
parseToolChainFile();
|
parseToolChainFile();
|
||||||
|
|
||||||
QVariantMap result;
|
QVariantMap result;
|
||||||
ProfileManager *pm = ProfileManager::instance();
|
KitManager *pm = KitManager::instance();
|
||||||
foreach (Profile *p, pm->profiles())
|
foreach (Kit *p, pm->kits())
|
||||||
m_targets.insert(p, QVariantMap());
|
m_targets.insert(p, QVariantMap());
|
||||||
|
|
||||||
QMapIterator<QString, QVariant> globalIt(map);
|
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();
|
const QString oldTargetId = extraTargetData.value(QLatin1String("ProjectExplorer.ProjectConfiguration.Id")).toString();
|
||||||
|
|
||||||
// Check each BCs/DCs and create profiles as needed
|
// 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);
|
QMapIterator<int, QVariantMap> buildIt(bcs);
|
||||||
while (buildIt.hasNext()) {
|
while (buildIt.hasNext()) {
|
||||||
buildIt.next();
|
buildIt.next();
|
||||||
int bcPos = buildIt.key();
|
int bcPos = buildIt.key();
|
||||||
const QVariantMap &bc = buildIt.value();
|
const QVariantMap &bc = buildIt.value();
|
||||||
Profile *tmpProfile = &rawProfile;
|
Kit *tmpProfile = &rawProfile;
|
||||||
|
|
||||||
if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.AndroidDeviceTarget")) {
|
if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.AndroidDeviceTarget")) {
|
||||||
tmpProfile->setIconPath(QLatin1String(":/android/images/QtAndroid.png"));
|
tmpProfile->setIconPath(QLatin1String(":/android/images/QtAndroid.png"));
|
||||||
@@ -2404,7 +2404,7 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
|||||||
// Set display name last:
|
// Set display name last:
|
||||||
tmpProfile->setDisplayName(extraTargetData.value(QLatin1String("ProjectExplorer.ProjectConfiguration.DisplayName")).toString());
|
tmpProfile->setDisplayName(extraTargetData.value(QLatin1String("ProjectExplorer.ProjectConfiguration.DisplayName")).toString());
|
||||||
|
|
||||||
Profile *p = uniqueProfile(tmpProfile);
|
Kit *p = uniqueProfile(tmpProfile);
|
||||||
|
|
||||||
addBuildConfiguration(p, bc, bcPos, activeBc);
|
addBuildConfiguration(p, bc, bcPos, activeBc);
|
||||||
addDeployConfiguration(p, dc, dcPos, activeDc);
|
addDeployConfiguration(p, dc, dcPos, activeDc);
|
||||||
@@ -2417,12 +2417,12 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
|||||||
|
|
||||||
int newPos = 0;
|
int newPos = 0;
|
||||||
// Generate new target data:
|
// Generate new target data:
|
||||||
foreach (Profile *p, m_targets.keys()) {
|
foreach (Kit *p, m_targets.keys()) {
|
||||||
QVariantMap data = m_targets.value(p);
|
QVariantMap data = m_targets.value(p);
|
||||||
if (data.isEmpty())
|
if (data.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pm->registerProfile(p);
|
pm->registerKit(p);
|
||||||
|
|
||||||
data.insert(QLatin1String("ProjectExplorer.ProjectConfiguration.Id"), p->id().name());
|
data.insert(QLatin1String("ProjectExplorer.ProjectConfiguration.Id"), p->id().name());
|
||||||
data.insert(QLatin1String("ProjectExplorer.Target.Profile"), 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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *Version11Handler::uniqueProfile(Profile *p)
|
Kit *Version11Handler::uniqueProfile(Kit *p)
|
||||||
{
|
{
|
||||||
const QString tc = p->value(Core::Id("PE.Profile.ToolChain")).toString();
|
const QString tc = p->value(Core::Id("PE.Profile.ToolChain")).toString();
|
||||||
const int qt = p->value(Core::Id("QtSupport.QtInformation")).toInt();
|
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 device = p->value(Core::Id("PE.Profile.Device")).toString();
|
||||||
const QString sysroot = p->value(Core::Id("PE.Profile.SysRoot")).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 QString currentTc = i->value(Core::Id("PE.Profile.ToolChain")).toString();
|
||||||
const int currentQt = i->value(Core::Id("QtSupport.QtInformation")).toInt();
|
const int currentQt = i->value(Core::Id("QtSupport.QtInformation")).toInt();
|
||||||
const QString currentDebugger = i->value(Core::Id("Debugger.Information")).toString();
|
const QString currentDebugger = i->value(Core::Id("Debugger.Information")).toString();
|
||||||
@@ -2472,7 +2472,7 @@ Profile *Version11Handler::uniqueProfile(Profile *p)
|
|||||||
return p->clone(true);
|
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);
|
QVariantMap merged = m_targets.value(p);
|
||||||
int internalCount = merged.value(QLatin1String("ProjectExplorer.Target.BuildConfigurationCount"), 0).toInt();
|
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);
|
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);
|
QVariantMap merged = m_targets.value(p);
|
||||||
int internalCount = merged.value(QLatin1String("ProjectExplorer.Target.DeployConfigurationCount"), 0).toInt();
|
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);
|
m_targets.insert(p, merged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Version11Handler::addRunConfigurations(Profile *p,
|
void Version11Handler::addRunConfigurations(Kit *p,
|
||||||
const QMap<int, QVariantMap> &rcs, int activeRc,
|
const QMap<int, QVariantMap> &rcs, int activeRc,
|
||||||
const QString &projectDir)
|
const QString &projectDir)
|
||||||
{
|
{
|
||||||
|
@@ -32,9 +32,9 @@
|
|||||||
|
|
||||||
#include "buildtargetinfo.h"
|
#include "buildtargetinfo.h"
|
||||||
#include "deploymentdata.h"
|
#include "deploymentdata.h"
|
||||||
#include "profile.h"
|
#include "kit.h"
|
||||||
#include "profileinformation.h"
|
#include "kitinformation.h"
|
||||||
#include "profilemanager.h"
|
#include "kitmanager.h"
|
||||||
#include "buildconfiguration.h"
|
#include "buildconfiguration.h"
|
||||||
#include "deployconfiguration.h"
|
#include "deployconfiguration.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
@@ -99,7 +99,7 @@ public:
|
|||||||
QPixmap m_readyToUsePixmap;
|
QPixmap m_readyToUsePixmap;
|
||||||
QPixmap m_disconnectedPixmap;
|
QPixmap m_disconnectedPixmap;
|
||||||
|
|
||||||
Profile *m_profile;
|
Kit *m_profile;
|
||||||
};
|
};
|
||||||
|
|
||||||
TargetPrivate::TargetPrivate() :
|
TargetPrivate::TargetPrivate() :
|
||||||
@@ -119,7 +119,7 @@ QList<DeployConfigurationFactory *> TargetPrivate::deployFactories() const
|
|||||||
return ExtensionSystem::PluginManager::getObjects<DeployConfigurationFactory>();
|
return ExtensionSystem::PluginManager::getObjects<DeployConfigurationFactory>();
|
||||||
}
|
}
|
||||||
|
|
||||||
Target::Target(Project *project, Profile *p) :
|
Target::Target(Project *project, Kit *p) :
|
||||||
ProjectConfiguration(project, p->id()),
|
ProjectConfiguration(project, p->id()),
|
||||||
d(new TargetPrivate)
|
d(new TargetPrivate)
|
||||||
{
|
{
|
||||||
@@ -130,11 +130,11 @@ Target::Target(Project *project, Profile *p) :
|
|||||||
setDisplayName(d->m_profile->displayName());
|
setDisplayName(d->m_profile->displayName());
|
||||||
setIcon(d->m_profile->icon());
|
setIcon(d->m_profile->icon());
|
||||||
|
|
||||||
ProfileManager *pm = ProfileManager::instance();
|
KitManager *pm = KitManager::instance();
|
||||||
connect(pm, SIGNAL(profileUpdated(ProjectExplorer::Profile*)),
|
connect(pm, SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||||
this, SLOT(handleProfileUpdates(ProjectExplorer::Profile*)));
|
this, SLOT(handleKitUpdates(ProjectExplorer::Kit*)));
|
||||||
connect(pm, SIGNAL(profileRemoved(ProjectExplorer::Profile*)),
|
connect(pm, SIGNAL(kitRemoved(ProjectExplorer::Kit*)),
|
||||||
this, SLOT(handleProfileRemoval(ProjectExplorer::Profile*)));
|
this, SLOT(handleKitRemoval(ProjectExplorer::Kit*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Target::~Target()
|
Target::~Target()
|
||||||
@@ -180,7 +180,7 @@ void Target::onBuildDirectoryChanged()
|
|||||||
emit buildDirectoryChanged();
|
emit buildDirectoryChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Target::handleProfileUpdates(Profile *p)
|
void Target::handleKitUpdates(Kit *p)
|
||||||
{
|
{
|
||||||
if (p != d->m_profile)
|
if (p != d->m_profile)
|
||||||
return;
|
return;
|
||||||
@@ -188,10 +188,10 @@ void Target::handleProfileUpdates(Profile *p)
|
|||||||
setDisplayName(p->displayName());
|
setDisplayName(p->displayName());
|
||||||
setIcon(p->icon());
|
setIcon(p->icon());
|
||||||
updateDefaultDeployConfigurations();
|
updateDefaultDeployConfigurations();
|
||||||
emit profileChanged();
|
emit kitChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Target::handleProfileRemoval(Profile *p)
|
void Target::handleKitRemoval(Kit *p)
|
||||||
{
|
{
|
||||||
if (p != d->m_profile)
|
if (p != d->m_profile)
|
||||||
return;
|
return;
|
||||||
@@ -204,7 +204,7 @@ Project *Target::project() const
|
|||||||
return static_cast<Project *>(parent());
|
return static_cast<Project *>(parent());
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile *Target::profile() const
|
Kit *Target::kit() const
|
||||||
{
|
{
|
||||||
return d->m_profile;
|
return d->m_profile;
|
||||||
}
|
}
|
||||||
@@ -674,7 +674,7 @@ static QString formatToolTip(const IDevice::DeviceInfo &input)
|
|||||||
|
|
||||||
void Target::updateDeviceState()
|
void Target::updateDeviceState()
|
||||||
{
|
{
|
||||||
IDevice::ConstPtr current = DeviceProfileInformation::device(profile());
|
IDevice::ConstPtr current = DeviceKitInformation::device(kit());
|
||||||
|
|
||||||
QPixmap overlay;
|
QPixmap overlay;
|
||||||
if (current.isNull()) {
|
if (current.isNull()) {
|
||||||
@@ -728,7 +728,7 @@ bool Target::fromMap(const QVariantMap &map)
|
|||||||
if (!ProjectConfiguration::fromMap(map))
|
if (!ProjectConfiguration::fromMap(map))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
d->m_profile = ProfileManager::instance()->find(id());
|
d->m_profile = KitManager::instance()->find(id());
|
||||||
if (!d->m_profile)
|
if (!d->m_profile)
|
||||||
return false;
|
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