forked from qt-creator/qt-creator
Rename some more profiles to kit
Change-Id: I898e7d4dec9b4de2c6f244f7b41ce71c82a4eee0 Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
committed by
Eike Ziller
parent
203b03f823
commit
371e6f59bc
@@ -1102,7 +1102,7 @@ void ProjectExplorerPlugin::extensionsInitialized()
|
|||||||
}
|
}
|
||||||
d->m_buildManager->extensionsInitialized();
|
d->m_buildManager->extensionsInitialized();
|
||||||
|
|
||||||
// Register ProfileInformation:
|
// Register KitInformation:
|
||||||
// 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.
|
||||||
KitManager::instance()->registerKitInformation(new SysRootKitInformation);
|
KitManager::instance()->registerKitInformation(new SysRootKitInformation);
|
||||||
KitManager::instance()->registerKitInformation(new DeviceKitInformation);
|
KitManager::instance()->registerKitInformation(new DeviceKitInformation);
|
||||||
@@ -2594,7 +2594,7 @@ void ProjectExplorerPlugin::addNewFile()
|
|||||||
QList<Core::Id> profileIds;
|
QList<Core::Id> profileIds;
|
||||||
foreach (Target *target, d->m_currentProject->targets())
|
foreach (Target *target, d->m_currentProject->targets())
|
||||||
profileIds << target->id();
|
profileIds << target->id();
|
||||||
map.insert(QLatin1String(Constants::PROJECT_PROFILE_IDS), QVariant::fromValue(profileIds));
|
map.insert(QLatin1String(Constants::PROJECT_KIT_IDS), QVariant::fromValue(profileIds));
|
||||||
}
|
}
|
||||||
Core::ICore::showNewItemDialog(tr("New File", "Title of dialog"),
|
Core::ICore::showNewItemDialog(tr("New File", "Title of dialog"),
|
||||||
Core::IWizard::wizardsOfKind(Core::IWizard::FileWizard)
|
Core::IWizard::wizardsOfKind(Core::IWizard::FileWizard)
|
||||||
@@ -2616,7 +2616,7 @@ void ProjectExplorerPlugin::addNewSubproject()
|
|||||||
QList<Core::Id> profileIds;
|
QList<Core::Id> profileIds;
|
||||||
foreach (Target *target, d->m_currentProject->targets())
|
foreach (Target *target, d->m_currentProject->targets())
|
||||||
profileIds << target->id();
|
profileIds << target->id();
|
||||||
map.insert(QLatin1String(Constants::PROJECT_PROFILE_IDS), QVariant::fromValue(profileIds));
|
map.insert(QLatin1String(Constants::PROJECT_KIT_IDS), QVariant::fromValue(profileIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::ICore::showNewItemDialog(tr("New Subproject", "Title of dialog"),
|
Core::ICore::showNewItemDialog(tr("New Subproject", "Title of dialog"),
|
||||||
|
@@ -208,7 +208,7 @@ const char IMPORT_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer
|
|||||||
|
|
||||||
// Wizard extra values
|
// Wizard extra values
|
||||||
const char PREFERED_PROJECT_NODE[] = "ProjectExplorer.PreferedProjectNode";
|
const char PREFERED_PROJECT_NODE[] = "ProjectExplorer.PreferedProjectNode";
|
||||||
const char PROJECT_PROFILE_IDS[] = "ProjectExplorer.Profile.Ids";
|
const char PROJECT_KIT_IDS[] = "ProjectExplorer.Profile.Ids";
|
||||||
|
|
||||||
// Build step lists ids:
|
// Build step lists ids:
|
||||||
const char BUILDSTEPS_CLEAN[] = "ProjectExplorer.BuildSteps.Clean";
|
const char BUILDSTEPS_CLEAN[] = "ProjectExplorer.BuildSteps.Clean";
|
||||||
|
@@ -361,10 +361,10 @@ public:
|
|||||||
QVariantMap update(Project *project, const QVariantMap &map);
|
QVariantMap update(Project *project, const QVariantMap &map);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Kit *uniqueProfile(Kit *p);
|
Kit *uniqueKit(Kit *k);
|
||||||
void addBuildConfiguration(Kit *p, const QVariantMap &bc, int bcPos, int bcCount);
|
void addBuildConfiguration(Kit *k, const QVariantMap &bc, int bcPos, int bcCount);
|
||||||
void addDeployConfiguration(Kit *p, const QVariantMap &dc, int dcPos, int dcActive);
|
void addDeployConfiguration(Kit *k, const QVariantMap &dc, int dcPos, int dcActive);
|
||||||
void addRunConfigurations(Kit *p,
|
void addRunConfigurations(Kit *k,
|
||||||
const QMap<int, QVariantMap> &rcs, int activeRc, const QString &projectDir);
|
const QMap<int, QVariantMap> &rcs, int activeRc, const QString &projectDir);
|
||||||
|
|
||||||
void parseQtversionFile();
|
void parseQtversionFile();
|
||||||
@@ -2228,10 +2228,10 @@ Version11Handler::~Version11Handler()
|
|||||||
KitManager *pm = KitManager::instance();
|
KitManager *pm = KitManager::instance();
|
||||||
if (!pm) // Can happen during teardown!
|
if (!pm) // Can happen during teardown!
|
||||||
return;
|
return;
|
||||||
QList<Kit *> knownProfiles = pm->kits();
|
QList<Kit *> knownKits = pm->kits();
|
||||||
foreach (Kit *p, m_targets.keys()) {
|
foreach (Kit *k, m_targets.keys()) {
|
||||||
if (!knownProfiles.contains(p))
|
if (!knownKits.contains(k))
|
||||||
delete p;
|
delete k;
|
||||||
}
|
}
|
||||||
m_targets.clear();
|
m_targets.clear();
|
||||||
}
|
}
|
||||||
@@ -2249,8 +2249,8 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
|||||||
|
|
||||||
QVariantMap result;
|
QVariantMap result;
|
||||||
KitManager *pm = KitManager::instance();
|
KitManager *pm = KitManager::instance();
|
||||||
foreach (Kit *p, pm->kits())
|
foreach (Kit *k, pm->kits())
|
||||||
m_targets.insert(p, QVariantMap());
|
m_targets.insert(k, QVariantMap());
|
||||||
|
|
||||||
QMapIterator<QString, QVariant> globalIt(map);
|
QMapIterator<QString, QVariant> globalIt(map);
|
||||||
int activeTarget = map.value(QLatin1String("ProjectExplorer.Project.ActiveTarget"), 0).toInt();
|
int activeTarget = map.value(QLatin1String("ProjectExplorer.Project.ActiveTarget"), 0).toInt();
|
||||||
@@ -2317,46 +2317,46 @@ 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 Kit rawProfile; // Do not needlessly use Core::Ids
|
static Kit rawKit; // 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();
|
||||||
Kit *tmpProfile = &rawProfile;
|
Kit *tmpKit = &rawKit;
|
||||||
|
|
||||||
if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.AndroidDeviceTarget")) {
|
if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.AndroidDeviceTarget")) {
|
||||||
tmpProfile->setIconPath(QLatin1String(":/android/images/QtAndroid.png"));
|
tmpKit->setIconPath(QLatin1String(":/android/images/QtAndroid.png"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Desktop"));
|
tmpKit->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Desktop"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString());
|
tmpKit->setValue(Core::Id("PE.Profile.Device"), QString());
|
||||||
} else if (oldTargetId == QLatin1String("RemoteLinux.EmbeddedLinuxTarget")) {
|
} else if (oldTargetId == QLatin1String("RemoteLinux.EmbeddedLinuxTarget")) {
|
||||||
tmpProfile->setIconPath(QLatin1String(":///DESKTOP///"));
|
tmpKit->setIconPath(QLatin1String(":///DESKTOP///"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("GenericLinuxOsType"));
|
tmpKit->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("GenericLinuxOsType"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString());
|
tmpKit->setValue(Core::Id("PE.Profile.Device"), QString());
|
||||||
} else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.HarmattanDeviceTarget")) {
|
} else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.HarmattanDeviceTarget")) {
|
||||||
tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/MaemoDevice.png"));
|
tmpKit->setIconPath(QLatin1String(":/projectexplorer/images/MaemoDevice.png"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("HarmattanOsType"));
|
tmpKit->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("HarmattanOsType"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString());
|
tmpKit->setValue(Core::Id("PE.Profile.Device"), QString());
|
||||||
} else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.MaemoDeviceTarget")) {
|
} else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.MaemoDeviceTarget")) {
|
||||||
tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/MaemoDevice.png"));
|
tmpKit->setIconPath(QLatin1String(":/projectexplorer/images/MaemoDevice.png"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Maemo5OsType"));
|
tmpKit->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Maemo5OsType"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString());
|
tmpKit->setValue(Core::Id("PE.Profile.Device"), QString());
|
||||||
} else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.MeegoDeviceTarget")) {
|
} else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.MeegoDeviceTarget")) {
|
||||||
tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/MaemoDevice.png"));
|
tmpKit->setIconPath(QLatin1String(":/projectexplorer/images/MaemoDevice.png"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("MeegoOsType"));
|
tmpKit->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("MeegoOsType"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString());
|
tmpKit->setValue(Core::Id("PE.Profile.Device"), QString());
|
||||||
} else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.S60DeviceTarget")) {
|
} else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.S60DeviceTarget")) {
|
||||||
tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/SymbianDevice.png"));
|
tmpKit->setIconPath(QLatin1String(":/projectexplorer/images/SymbianDevice.png"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Qt4ProjectManager.SymbianDevice"));
|
tmpKit->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Qt4ProjectManager.SymbianDevice"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString::fromLatin1("Symbian Device"));
|
tmpKit->setValue(Core::Id("PE.Profile.Device"), QString::fromLatin1("Symbian Device"));
|
||||||
} else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.QtSimulatorTarget")) {
|
} else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.QtSimulatorTarget")) {
|
||||||
tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/Simulator.png"));
|
tmpKit->setIconPath(QLatin1String(":/projectexplorer/images/Simulator.png"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Desktop"));
|
tmpKit->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Desktop"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString::fromLatin1("Desktop Device"));
|
tmpKit->setValue(Core::Id("PE.Profile.Device"), QString::fromLatin1("Desktop Device"));
|
||||||
} else {
|
} else {
|
||||||
tmpProfile->setIconPath(QLatin1String(":///DESKTOP///"));
|
tmpKit->setIconPath(QLatin1String(":///DESKTOP///"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Desktop"));
|
tmpKit->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Desktop"));
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString::fromLatin1("Desktop Device"));
|
tmpKit->setValue(Core::Id("PE.Profile.Device"), QString::fromLatin1("Desktop Device"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tool chain
|
// Tool chain
|
||||||
@@ -2366,11 +2366,11 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
|||||||
const QString origTcId = tcId;
|
const QString origTcId = tcId;
|
||||||
tcId.replace(QLatin1String("Qt4ProjectManager.ToolChain.Maemo:"),
|
tcId.replace(QLatin1String("Qt4ProjectManager.ToolChain.Maemo:"),
|
||||||
QLatin1String("ProjectExplorer.ToolChain.Gcc:")); // convert Maemo to GCC
|
QLatin1String("ProjectExplorer.ToolChain.Gcc:")); // convert Maemo to GCC
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.ToolChain"), tcId);
|
tmpKit->setValue(Core::Id("PE.Profile.ToolChain"), tcId);
|
||||||
|
|
||||||
// QtVersion
|
// QtVersion
|
||||||
int qtVersionId = bc.value(QLatin1String("Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId"), -1).toInt();
|
int qtVersionId = bc.value(QLatin1String("Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId"), -1).toInt();
|
||||||
tmpProfile->setValue(Core::Id("QtSupport.QtInformation"), qtVersionId);
|
tmpKit->setValue(Core::Id("QtSupport.QtInformation"), qtVersionId);
|
||||||
|
|
||||||
// Debugger + mkspec
|
// Debugger + mkspec
|
||||||
QString debugger;
|
QString debugger;
|
||||||
@@ -2382,11 +2382,11 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
|||||||
debugger = env.searchInPath(debugger);
|
debugger = env.searchInPath(debugger);
|
||||||
mkspec = m_toolChainExtras.value(origTcId).m_mkspec;
|
mkspec = m_toolChainExtras.value(origTcId).m_mkspec;
|
||||||
}
|
}
|
||||||
tmpProfile->setValue(Core::Id("Debugger.Information"), debugger);
|
tmpKit->setValue(Core::Id("Debugger.Information"), debugger);
|
||||||
tmpProfile->setValue(Core::Id("QtPM4.mkSpecInformation"), mkspec);
|
tmpKit->setValue(Core::Id("QtPM4.mkSpecInformation"), mkspec);
|
||||||
|
|
||||||
// SysRoot
|
// SysRoot
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.SysRoot"), m_qtVersionExtras.value(qtVersionId));
|
tmpKit->setValue(Core::Id("PE.Profile.SysRoot"), m_qtVersionExtras.value(qtVersionId));
|
||||||
|
|
||||||
QMapIterator<int, QVariantMap> deployIt(dcs);
|
QMapIterator<int, QVariantMap> deployIt(dcs);
|
||||||
while (deployIt.hasNext()) {
|
while (deployIt.hasNext()) {
|
||||||
@@ -2399,35 +2399,35 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
|||||||
devId = QByteArray("Desktop Device");
|
devId = QByteArray("Desktop Device");
|
||||||
if (!devId.isEmpty() && !DeviceManager::instance()->find(Core::Id(devId))) // We do not know that device
|
if (!devId.isEmpty() && !DeviceManager::instance()->find(Core::Id(devId))) // We do not know that device
|
||||||
devId.clear();
|
devId.clear();
|
||||||
tmpProfile->setValue(Core::Id("PE.Profile.Device"), devId);
|
tmpKit->setValue(Core::Id("PE.Profile.Device"), devId);
|
||||||
|
|
||||||
// Set display name last:
|
// Set display name last:
|
||||||
tmpProfile->setDisplayName(extraTargetData.value(QLatin1String("ProjectExplorer.ProjectConfiguration.DisplayName")).toString());
|
tmpKit->setDisplayName(extraTargetData.value(QLatin1String("ProjectExplorer.ProjectConfiguration.DisplayName")).toString());
|
||||||
|
|
||||||
Kit *p = uniqueProfile(tmpProfile);
|
Kit *k = uniqueKit(tmpKit);
|
||||||
|
|
||||||
addBuildConfiguration(p, bc, bcPos, activeBc);
|
addBuildConfiguration(k, bc, bcPos, activeBc);
|
||||||
addDeployConfiguration(p, dc, dcPos, activeDc);
|
addDeployConfiguration(k, dc, dcPos, activeDc);
|
||||||
addRunConfigurations(p, rcs, activeRc, project->projectDirectory());
|
addRunConfigurations(k, rcs, activeRc, project->projectDirectory());
|
||||||
if (targetPos == activeTarget && bcPos == activeBc && dcPos == activeDc)
|
if (targetPos == activeTarget && bcPos == activeBc && dcPos == activeDc)
|
||||||
m_targets[p].insert(QLatin1String("Update.IsActive"), true);
|
m_targets[k].insert(QLatin1String("Update.IsActive"), true);
|
||||||
} // dcs
|
} // dcs
|
||||||
} // bcs
|
} // bcs
|
||||||
} // read in map data
|
} // read in map data
|
||||||
|
|
||||||
int newPos = 0;
|
int newPos = 0;
|
||||||
// Generate new target data:
|
// Generate new target data:
|
||||||
foreach (Kit *p, m_targets.keys()) {
|
foreach (Kit *k, m_targets.keys()) {
|
||||||
QVariantMap data = m_targets.value(p);
|
QVariantMap data = m_targets.value(k);
|
||||||
if (data.isEmpty())
|
if (data.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pm->registerKit(p);
|
pm->registerKit(k);
|
||||||
|
|
||||||
data.insert(QLatin1String("ProjectExplorer.ProjectConfiguration.Id"), p->id().name());
|
data.insert(QLatin1String("ProjectExplorer.ProjectConfiguration.Id"), k->id().name());
|
||||||
data.insert(QLatin1String("ProjectExplorer.Target.Profile"), p->id().name());
|
data.insert(QLatin1String("ProjectExplorer.Target.Profile"), k->id().name());
|
||||||
data.insert(QLatin1String("ProjectExplorer.ProjectConfiguration.DisplayName"), p->displayName());
|
data.insert(QLatin1String("ProjectExplorer.ProjectConfiguration.DisplayName"), k->displayName());
|
||||||
data.insert(QLatin1String("ProjectExplorer.ProjectConfiguration.DefaultDisplayName"), p->displayName());
|
data.insert(QLatin1String("ProjectExplorer.ProjectConfiguration.DefaultDisplayName"), k->displayName());
|
||||||
|
|
||||||
result.insert(QString::fromLatin1("ProjectExplorer.Project.Target.") + QString::number(newPos), data);
|
result.insert(QString::fromLatin1("ProjectExplorer.Project.Target.") + QString::number(newPos), data);
|
||||||
if (data.value(QLatin1String("Update.IsActive"), false).toBool())
|
if (data.value(QLatin1String("Update.IsActive"), false).toBool())
|
||||||
@@ -2439,15 +2439,15 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Kit *Version11Handler::uniqueProfile(Kit *p)
|
Kit *Version11Handler::uniqueKit(Kit *k)
|
||||||
{
|
{
|
||||||
const QString tc = p->value(Core::Id("PE.Profile.ToolChain")).toString();
|
const QString tc = k->value(Core::Id("PE.Profile.ToolChain")).toString();
|
||||||
const int qt = p->value(Core::Id("QtSupport.QtInformation")).toInt();
|
const int qt = k->value(Core::Id("QtSupport.QtInformation")).toInt();
|
||||||
const QString debugger = p->value(Core::Id("Debugger.Information")).toString();
|
const QString debugger = k->value(Core::Id("Debugger.Information")).toString();
|
||||||
const QString mkspec = p->value(Core::Id("QtPM4.mkSpecInformation")).toString();
|
const QString mkspec = k->value(Core::Id("QtPM4.mkSpecInformation")).toString();
|
||||||
const QString deviceType = p->value(Core::Id("PE.Profile.DeviceType")).toString();
|
const QString deviceType = k->value(Core::Id("PE.Profile.DeviceType")).toString();
|
||||||
const QString device = p->value(Core::Id("PE.Profile.Device")).toString();
|
const QString device = k->value(Core::Id("PE.Profile.Device")).toString();
|
||||||
const QString sysroot = p->value(Core::Id("PE.Profile.SysRoot")).toString();
|
const QString sysroot = k->value(Core::Id("PE.Profile.SysRoot")).toString();
|
||||||
|
|
||||||
foreach (Kit *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();
|
||||||
@@ -2469,12 +2469,12 @@ Kit *Version11Handler::uniqueProfile(Kit *p)
|
|||||||
if (deviceTypeOk && deviceOk && tcOk && qtOk && debuggerOk && mkspecOk && sysrootOk)
|
if (deviceTypeOk && deviceOk && tcOk && qtOk && debuggerOk && mkspecOk && sysrootOk)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
return p->clone(true);
|
return k->clone(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Version11Handler::addBuildConfiguration(Kit *p, const QVariantMap &bc, int bcPos, int bcActive)
|
void Version11Handler::addBuildConfiguration(Kit *k, const QVariantMap &bc, int bcPos, int bcActive)
|
||||||
{
|
{
|
||||||
QVariantMap merged = m_targets.value(p);
|
QVariantMap merged = m_targets.value(k);
|
||||||
int internalCount = merged.value(QLatin1String("ProjectExplorer.Target.BuildConfigurationCount"), 0).toInt();
|
int internalCount = merged.value(QLatin1String("ProjectExplorer.Target.BuildConfigurationCount"), 0).toInt();
|
||||||
|
|
||||||
for (int i = 0; i < internalCount; ++i) {
|
for (int i = 0; i < internalCount; ++i) {
|
||||||
@@ -2490,12 +2490,12 @@ void Version11Handler::addBuildConfiguration(Kit *p, const QVariantMap &bc, int
|
|||||||
merged.insert(QLatin1String("ProjectExplorer.Target.ActiveBuildConfiguration"), internalCount);
|
merged.insert(QLatin1String("ProjectExplorer.Target.ActiveBuildConfiguration"), internalCount);
|
||||||
merged.insert(QLatin1String("ProjectExplorer.Target.BuildConfigurationCount"), internalCount + 1);
|
merged.insert(QLatin1String("ProjectExplorer.Target.BuildConfigurationCount"), internalCount + 1);
|
||||||
|
|
||||||
m_targets.insert(p, merged);
|
m_targets.insert(k, merged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Version11Handler::addDeployConfiguration(Kit *p, const QVariantMap &dc, int dcPos, int dcActive)
|
void Version11Handler::addDeployConfiguration(Kit *k, const QVariantMap &dc, int dcPos, int dcActive)
|
||||||
{
|
{
|
||||||
QVariantMap merged = m_targets.value(p);
|
QVariantMap merged = m_targets.value(k);
|
||||||
int internalCount = merged.value(QLatin1String("ProjectExplorer.Target.DeployConfigurationCount"), 0).toInt();
|
int internalCount = merged.value(QLatin1String("ProjectExplorer.Target.DeployConfigurationCount"), 0).toInt();
|
||||||
|
|
||||||
for (int i = 0; i < internalCount; ++i) {
|
for (int i = 0; i < internalCount; ++i) {
|
||||||
@@ -2511,14 +2511,14 @@ void Version11Handler::addDeployConfiguration(Kit *p, const QVariantMap &dc, int
|
|||||||
merged.insert(QLatin1String("ProjectExplorer.Target.ActiveDeployConfiguration"), internalCount);
|
merged.insert(QLatin1String("ProjectExplorer.Target.ActiveDeployConfiguration"), internalCount);
|
||||||
merged.insert(QLatin1String("ProjectExplorer.Target.DeployConfigurationCount"), internalCount + 1);
|
merged.insert(QLatin1String("ProjectExplorer.Target.DeployConfigurationCount"), internalCount + 1);
|
||||||
|
|
||||||
m_targets.insert(p, merged);
|
m_targets.insert(k, merged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Version11Handler::addRunConfigurations(Kit *p,
|
void Version11Handler::addRunConfigurations(Kit *k,
|
||||||
const QMap<int, QVariantMap> &rcs, int activeRc,
|
const QMap<int, QVariantMap> &rcs, int activeRc,
|
||||||
const QString &projectDir)
|
const QString &projectDir)
|
||||||
{
|
{
|
||||||
QVariantMap data = m_targets.value(p);
|
QVariantMap data = m_targets.value(k);
|
||||||
data.insert(QLatin1String("ProjectExplorer.Target.RunConfigurationCount"), rcs.count());
|
data.insert(QLatin1String("ProjectExplorer.Target.RunConfigurationCount"), rcs.count());
|
||||||
QMapIterator<int, QVariantMap> runIt(rcs);
|
QMapIterator<int, QVariantMap> runIt(rcs);
|
||||||
while (runIt.hasNext()) {
|
while (runIt.hasNext()) {
|
||||||
@@ -2539,7 +2539,7 @@ void Version11Handler::addRunConfigurations(Kit *p,
|
|||||||
}
|
}
|
||||||
data.insert(QLatin1String("ProjectExplorer.Target.ActiveRunConfiguration"), activeRc);
|
data.insert(QLatin1String("ProjectExplorer.Target.ActiveRunConfiguration"), activeRc);
|
||||||
|
|
||||||
m_targets.insert(p, data);
|
m_targets.insert(k, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString targetRoot(const QString &qmakePath)
|
static QString targetRoot(const QString &qmakePath)
|
||||||
|
@@ -99,7 +99,7 @@ public:
|
|||||||
QPixmap m_readyToUsePixmap;
|
QPixmap m_readyToUsePixmap;
|
||||||
QPixmap m_disconnectedPixmap;
|
QPixmap m_disconnectedPixmap;
|
||||||
|
|
||||||
Kit *m_profile;
|
Kit *m_kit;
|
||||||
};
|
};
|
||||||
|
|
||||||
TargetPrivate::TargetPrivate() :
|
TargetPrivate::TargetPrivate() :
|
||||||
@@ -110,7 +110,7 @@ TargetPrivate::TargetPrivate() :
|
|||||||
m_connectedPixmap(QLatin1String(":/projectexplorer/images/DeviceConnected.png")),
|
m_connectedPixmap(QLatin1String(":/projectexplorer/images/DeviceConnected.png")),
|
||||||
m_readyToUsePixmap(QLatin1String(":/projectexplorer/images/DeviceReadyToUse.png")),
|
m_readyToUsePixmap(QLatin1String(":/projectexplorer/images/DeviceReadyToUse.png")),
|
||||||
m_disconnectedPixmap(QLatin1String(":/projectexplorer/images/DeviceDisconnected.png")),
|
m_disconnectedPixmap(QLatin1String(":/projectexplorer/images/DeviceDisconnected.png")),
|
||||||
m_profile(0)
|
m_kit(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,10 +125,10 @@ Target::Target(Project *project, Kit *p) :
|
|||||||
{
|
{
|
||||||
connect(DeviceManager::instance(), SIGNAL(updated()), this, SLOT(updateDeviceState()));
|
connect(DeviceManager::instance(), SIGNAL(updated()), this, SLOT(updateDeviceState()));
|
||||||
|
|
||||||
d->m_profile = p;
|
d->m_kit = p;
|
||||||
|
|
||||||
setDisplayName(d->m_profile->displayName());
|
setDisplayName(d->m_kit->displayName());
|
||||||
setIcon(d->m_profile->icon());
|
setIcon(d->m_kit->icon());
|
||||||
|
|
||||||
KitManager *pm = KitManager::instance();
|
KitManager *pm = KitManager::instance();
|
||||||
connect(pm, SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
connect(pm, SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
|
||||||
@@ -182,7 +182,7 @@ void Target::onBuildDirectoryChanged()
|
|||||||
|
|
||||||
void Target::handleKitUpdates(Kit *p)
|
void Target::handleKitUpdates(Kit *p)
|
||||||
{
|
{
|
||||||
if (p != d->m_profile)
|
if (p != d->m_kit)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setDisplayName(p->displayName());
|
setDisplayName(p->displayName());
|
||||||
@@ -193,9 +193,9 @@ void Target::handleKitUpdates(Kit *p)
|
|||||||
|
|
||||||
void Target::handleKitRemoval(Kit *p)
|
void Target::handleKitRemoval(Kit *p)
|
||||||
{
|
{
|
||||||
if (p != d->m_profile)
|
if (p != d->m_kit)
|
||||||
return;
|
return;
|
||||||
d->m_profile = 0;
|
d->m_kit = 0;
|
||||||
project()->removeTarget(this);
|
project()->removeTarget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ Project *Target::project() const
|
|||||||
|
|
||||||
Kit *Target::kit() const
|
Kit *Target::kit() const
|
||||||
{
|
{
|
||||||
return d->m_profile;
|
return d->m_kit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Target::addBuildConfiguration(BuildConfiguration *configuration)
|
void Target::addBuildConfiguration(BuildConfiguration *configuration)
|
||||||
@@ -488,7 +488,7 @@ void Target::setToolTip(const QString &text)
|
|||||||
|
|
||||||
QVariantMap Target::toMap() const
|
QVariantMap Target::toMap() const
|
||||||
{
|
{
|
||||||
if (!d->m_profile) // Profile was deleted, target is only around to be copied.
|
if (!d->m_kit) // Kit was deleted, target is only around to be copied.
|
||||||
return QVariantMap();
|
return QVariantMap();
|
||||||
|
|
||||||
QVariantMap map(ProjectConfiguration::toMap());
|
QVariantMap map(ProjectConfiguration::toMap());
|
||||||
@@ -728,8 +728,8 @@ bool Target::fromMap(const QVariantMap &map)
|
|||||||
if (!ProjectConfiguration::fromMap(map))
|
if (!ProjectConfiguration::fromMap(map))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
d->m_profile = KitManager::instance()->find(id());
|
d->m_kit = KitManager::instance()->find(id());
|
||||||
if (!d->m_profile)
|
if (!d->m_kit)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
|
@@ -80,7 +80,7 @@ CustomWidgetWizardDialog::CustomWidgetWizardDialog(const QString &templateName,
|
|||||||
setIntroDescription(tr("This wizard generates a Qt4 Designer Custom Widget "
|
setIntroDescription(tr("This wizard generates a Qt4 Designer Custom Widget "
|
||||||
"or a Qt4 Designer Custom Widget Collection project."));
|
"or a Qt4 Designer Custom Widget Collection project."));
|
||||||
|
|
||||||
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS))
|
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_KIT_IDS))
|
||||||
addTargetSetupPage();
|
addTargetSetupPage();
|
||||||
m_widgetPageId = addPage(m_widgetsPage);
|
m_widgetPageId = addPage(m_widgetsPage);
|
||||||
m_pluginPageId = addPage(m_pluginPage);
|
m_pluginPageId = addPage(m_pluginPage);
|
||||||
|
@@ -124,7 +124,7 @@ ProjectExplorer::Kit *Qt4TargetSetupWidget::profile()
|
|||||||
return m_kit;
|
return m_kit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4TargetSetupWidget::clearProfile()
|
void Qt4TargetSetupWidget::clearKit()
|
||||||
{
|
{
|
||||||
m_kit = 0;
|
m_kit = 0;
|
||||||
}
|
}
|
||||||
|
@@ -68,7 +68,7 @@ public:
|
|||||||
~Qt4TargetSetupWidget();
|
~Qt4TargetSetupWidget();
|
||||||
|
|
||||||
ProjectExplorer::Kit *profile();
|
ProjectExplorer::Kit *profile();
|
||||||
void clearProfile();
|
void clearKit();
|
||||||
|
|
||||||
bool isKitSelected() const;
|
bool isKitSelected() const;
|
||||||
void setKitSelected(bool b);
|
void setKitSelected(bool b);
|
||||||
|
@@ -64,9 +64,9 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent,
|
|||||||
, m_genericItem(0)
|
, m_genericItem(0)
|
||||||
, m_maemoItem(0)
|
, m_maemoItem(0)
|
||||||
, m_harmattanItem(0)
|
, m_harmattanItem(0)
|
||||||
, m_kitIds(parameters.extraValues().value(ProjectExplorer::Constants::PROJECT_PROFILE_IDS).value<QList<Core::Id> >())
|
, m_kitIds(parameters.extraValues().value(ProjectExplorer::Constants::PROJECT_KIT_IDS).value<QList<Core::Id> >())
|
||||||
{
|
{
|
||||||
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS)) {
|
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_KIT_IDS)) {
|
||||||
m_targetsPage = new TargetSetupPage;
|
m_targetsPage = new TargetSetupPage;
|
||||||
m_targetsPage->setPreferredKitMatcher(new QtSupport::QtPlatformKitMatcher(selectedPlatform()));
|
m_targetsPage->setPreferredKitMatcher(new QtSupport::QtPlatformKitMatcher(selectedPlatform()));
|
||||||
m_targetsPage->setRequiredKitMatcher(new QtSupport::QtVersionKitMatcher(requiredFeatures(),
|
m_targetsPage->setRequiredKitMatcher(new QtSupport::QtVersionKitMatcher(requiredFeatures(),
|
||||||
|
@@ -54,7 +54,7 @@ ConsoleAppWizardDialog::ConsoleAppWizardDialog(const QString &templateName,
|
|||||||
"provide a GUI."));
|
"provide a GUI."));
|
||||||
|
|
||||||
addModulesPage();
|
addModulesPage();
|
||||||
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS))
|
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_KIT_IDS))
|
||||||
addTargetSetupPage();
|
addTargetSetupPage();
|
||||||
|
|
||||||
addExtensionPages(parameters.extensionPages());
|
addExtensionPages(parameters.extensionPages());
|
||||||
|
@@ -46,7 +46,7 @@ EmptyProjectWizardDialog::EmptyProjectWizardDialog(const QString &templateName,
|
|||||||
setIntroDescription(tr("This wizard generates an empty Qt4 project. "
|
setIntroDescription(tr("This wizard generates an empty Qt4 project. "
|
||||||
"Add files to it later on by using the other wizards."));
|
"Add files to it later on by using the other wizards."));
|
||||||
|
|
||||||
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS))
|
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_KIT_IDS))
|
||||||
addTargetSetupPage();
|
addTargetSetupPage();
|
||||||
|
|
||||||
addExtensionPages(parameters.extensionPages());
|
addExtensionPages(parameters.extensionPages());
|
||||||
|
@@ -65,7 +65,7 @@ GuiAppWizardDialog::GuiAppWizardDialog(const QString &templateName,
|
|||||||
"and includes an empty widget."));
|
"and includes an empty widget."));
|
||||||
|
|
||||||
addModulesPage();
|
addModulesPage();
|
||||||
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS))
|
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_KIT_IDS))
|
||||||
addTargetSetupPage(isMobile);
|
addTargetSetupPage(isMobile);
|
||||||
|
|
||||||
m_filesPage->setFormInputCheckable(true);
|
m_filesPage->setFormInputCheckable(true);
|
||||||
|
@@ -153,7 +153,7 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
|
|||||||
// Use the intro page instead, set up initially
|
// Use the intro page instead, set up initially
|
||||||
setIntroDescription(tr("This wizard generates a C++ library project."));
|
setIntroDescription(tr("This wizard generates a C++ library project."));
|
||||||
|
|
||||||
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS)) {
|
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_KIT_IDS)) {
|
||||||
m_targetPageId = addTargetSetupPage();
|
m_targetPageId = addTargetSetupPage();
|
||||||
m_mobilePageId = addPage(m_mobilePage);
|
m_mobilePageId = addPage(m_mobilePage);
|
||||||
}
|
}
|
||||||
|
@@ -169,7 +169,7 @@ CustomQt4ProjectWizard::CustomQt4ProjectWizard(const Core::BaseFileWizardParamet
|
|||||||
{
|
{
|
||||||
BaseQt4ProjectWizardDialog *wizard = new BaseQt4ProjectWizardDialog(false, parent, wizardDialogParameters);
|
BaseQt4ProjectWizardDialog *wizard = new BaseQt4ProjectWizardDialog(false, parent, wizardDialogParameters);
|
||||||
|
|
||||||
if (!wizardDialogParameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS))
|
if (!wizardDialogParameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_KIT_IDS))
|
||||||
wizard->addTargetSetupPage(false, targetPageId);
|
wizard->addTargetSetupPage(false, targetPageId);
|
||||||
|
|
||||||
initProjectWizardDialog(wizard, wizardDialogParameters.defaultPath(),
|
initProjectWizardDialog(wizard, wizardDialogParameters.defaultPath(),
|
||||||
@@ -193,7 +193,7 @@ BaseQt4ProjectWizardDialog::BaseQt4ProjectWizardDialog(bool showModulesPage, QWi
|
|||||||
ProjectExplorer::BaseProjectWizardDialog(parent, parameters),
|
ProjectExplorer::BaseProjectWizardDialog(parent, parameters),
|
||||||
m_modulesPage(0),
|
m_modulesPage(0),
|
||||||
m_targetSetupPage(0),
|
m_targetSetupPage(0),
|
||||||
m_profileIds(parameters.extraValues().value(ProjectExplorer::Constants::PROJECT_PROFILE_IDS).value<QList<Core::Id> >())
|
m_profileIds(parameters.extraValues().value(ProjectExplorer::Constants::PROJECT_KIT_IDS).value<QList<Core::Id> >())
|
||||||
{
|
{
|
||||||
init(showModulesPage);
|
init(showModulesPage);
|
||||||
}
|
}
|
||||||
@@ -205,7 +205,7 @@ BaseQt4ProjectWizardDialog::BaseQt4ProjectWizardDialog(bool showModulesPage,
|
|||||||
ProjectExplorer::BaseProjectWizardDialog(introPage, introId, parent, parameters),
|
ProjectExplorer::BaseProjectWizardDialog(introPage, introId, parent, parameters),
|
||||||
m_modulesPage(0),
|
m_modulesPage(0),
|
||||||
m_targetSetupPage(0),
|
m_targetSetupPage(0),
|
||||||
m_profileIds(parameters.extraValues().value(ProjectExplorer::Constants::PROJECT_PROFILE_IDS).value<QList<Core::Id> >())
|
m_profileIds(parameters.extraValues().value(ProjectExplorer::Constants::PROJECT_KIT_IDS).value<QList<Core::Id> >())
|
||||||
{
|
{
|
||||||
init(showModulesPage);
|
init(showModulesPage);
|
||||||
}
|
}
|
||||||
@@ -258,7 +258,7 @@ int BaseQt4ProjectWizardDialog::addTargetSetupPage(bool mobile, int id)
|
|||||||
setPage(id, m_targetSetupPage);
|
setPage(id, m_targetSetupPage);
|
||||||
else
|
else
|
||||||
id = addPage(m_targetSetupPage);
|
id = addPage(m_targetSetupPage);
|
||||||
wizardProgress()->item(id)->setTitle(tr("Targets"));
|
wizardProgress()->item(id)->setTitle(tr("Kits"));
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
@@ -86,7 +86,7 @@ bool SubdirsProjectWizard::postGenerateFiles(const QWizard *w, const Core::Gener
|
|||||||
const QString profileName = Core::BaseFileWizard::buildFileName(projectPath, params.fileName, profileSuffix());
|
const QString profileName = Core::BaseFileWizard::buildFileName(projectPath, params.fileName, profileSuffix());
|
||||||
QVariantMap map;
|
QVariantMap map;
|
||||||
map.insert(QLatin1String(ProjectExplorer::Constants::PREFERED_PROJECT_NODE), profileName);
|
map.insert(QLatin1String(ProjectExplorer::Constants::PREFERED_PROJECT_NODE), profileName);
|
||||||
map.insert(QLatin1String(ProjectExplorer::Constants::PROJECT_PROFILE_IDS), QVariant::fromValue(wizard->selectedKits()));
|
map.insert(QLatin1String(ProjectExplorer::Constants::PROJECT_KIT_IDS), QVariant::fromValue(wizard->selectedKits()));
|
||||||
Core::ICore::showNewItemDialog(tr("New Subproject", "Title of dialog"),
|
Core::ICore::showNewItemDialog(tr("New Subproject", "Title of dialog"),
|
||||||
Core::IWizard::wizardsOfKind(Core::IWizard::ProjectWizard),
|
Core::IWizard::wizardsOfKind(Core::IWizard::ProjectWizard),
|
||||||
wizard->parameters().projectPath(),
|
wizard->parameters().projectPath(),
|
||||||
|
@@ -47,7 +47,7 @@ SubdirsProjectWizardDialog::SubdirsProjectWizardDialog(const QString &templateNa
|
|||||||
setIntroDescription(tr("This wizard generates a Qt4 subdirs project. "
|
setIntroDescription(tr("This wizard generates a Qt4 subdirs project. "
|
||||||
"Add subprojects to it later on by using the other wizards."));
|
"Add subprojects to it later on by using the other wizards."));
|
||||||
|
|
||||||
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS))
|
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_KIT_IDS))
|
||||||
addTargetSetupPage();
|
addTargetSetupPage();
|
||||||
|
|
||||||
addExtensionPages(parameters.extensionPages());
|
addExtensionPages(parameters.extensionPages());
|
||||||
|
@@ -62,7 +62,7 @@ namespace Qt4ProjectManager {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
static const Core::Id QT_IS_TEMPORARY("Qt4PM.TempQt");
|
static const Core::Id QT_IS_TEMPORARY("Qt4PM.TempQt");
|
||||||
static const Core::Id PROFILE_IS_TEMPORARY("Qt4PM.TempProfile");
|
static const Core::Id KIT_IS_TEMPORARY("Qt4PM.TempKit");
|
||||||
static const Core::Id TEMPORARY_OF_PROJECTS("Qt4PM.TempProject");
|
static const Core::Id TEMPORARY_OF_PROJECTS("Qt4PM.TempProject");
|
||||||
|
|
||||||
class TargetSetupPageUi
|
class TargetSetupPageUi
|
||||||
@@ -80,7 +80,7 @@ public:
|
|||||||
descriptionLabel = new QLabel(setupTargetPage);
|
descriptionLabel = new QLabel(setupTargetPage);
|
||||||
descriptionLabel->setWordWrap(true);
|
descriptionLabel->setWordWrap(true);
|
||||||
descriptionLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
descriptionLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
descriptionLabel->setText(TargetSetupPage::tr("Qt Creator can set up the following targets:"));
|
descriptionLabel->setText(TargetSetupPage::tr("Qt Creator can use the following kits:"));
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
QString hint = TargetSetupPage::tr(
|
QString hint = TargetSetupPage::tr(
|
||||||
@@ -98,10 +98,10 @@ public:
|
|||||||
" or via the maintenance tool of the SDK.</p></body></html>");
|
" or via the maintenance tool of the SDK.</p></body></html>");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QLabel *noValidProfileLabel = new QLabel(setupTargetPage);
|
QLabel *noValidKitLabel = new QLabel(setupTargetPage);
|
||||||
noValidProfileLabel->setWordWrap(true);
|
noValidKitLabel->setWordWrap(true);
|
||||||
noValidProfileLabel->setText(hint);
|
noValidKitLabel->setText(hint);
|
||||||
noValidProfileLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
noValidKitLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
|
|
||||||
centralWidget = new QWidget(setupTargetPage);
|
centralWidget = new QWidget(setupTargetPage);
|
||||||
QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||||
@@ -126,7 +126,7 @@ public:
|
|||||||
|
|
||||||
QVBoxLayout *verticalLayout_2 = new QVBoxLayout(setupTargetPage);
|
QVBoxLayout *verticalLayout_2 = new QVBoxLayout(setupTargetPage);
|
||||||
verticalLayout_2->addWidget(descriptionLabel);
|
verticalLayout_2->addWidget(descriptionLabel);
|
||||||
verticalLayout_2->addWidget(noValidProfileLabel);
|
verticalLayout_2->addWidget(noValidKitLabel);
|
||||||
verticalLayout_2->addWidget(centralWidget);
|
verticalLayout_2->addWidget(centralWidget);
|
||||||
verticalLayout_2->addWidget(scrollAreaWidget);
|
verticalLayout_2->addWidget(scrollAreaWidget);
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ public:
|
|||||||
verticalLayout_3->setContentsMargins(0, 0, 0, -1);
|
verticalLayout_3->setContentsMargins(0, 0, 0, -1);
|
||||||
verticalLayout_3->addWidget(setupTargetPage);
|
verticalLayout_3->addWidget(setupTargetPage);
|
||||||
|
|
||||||
QObject::connect(noValidProfileLabel, SIGNAL(linkActivated(QString)),
|
QObject::connect(noValidKitLabel, SIGNAL(linkActivated(QString)),
|
||||||
q, SIGNAL(noteTextLinkActivated()));
|
q, SIGNAL(noteTextLinkActivated()));
|
||||||
QObject::connect(descriptionLabel, SIGNAL(linkActivated(QString)),
|
QObject::connect(descriptionLabel, SIGNAL(linkActivated(QString)),
|
||||||
q, SIGNAL(noteTextLinkActivated()));
|
q, SIGNAL(noteTextLinkActivated()));
|
||||||
@@ -158,7 +158,7 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) :
|
|||||||
m_spacer(new QSpacerItem(0,0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding))
|
m_spacer(new QSpacerItem(0,0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding))
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("TargetSetupPage"));
|
setObjectName(QLatin1String("TargetSetupPage"));
|
||||||
setWindowTitle(tr("Set up Targets for Your Project"));
|
setWindowTitle(tr("Select Kits for Your Project"));
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||||
@@ -176,7 +176,7 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) :
|
|||||||
setUseScrollArea(true);
|
setUseScrollArea(true);
|
||||||
setImportSearch(false);
|
setImportSearch(false);
|
||||||
|
|
||||||
setTitle(tr("Target Setup"));
|
setTitle(tr("Kit Selection"));
|
||||||
|
|
||||||
ProjectExplorer::KitManager *km = ProjectExplorer::KitManager::instance();
|
ProjectExplorer::KitManager *km = ProjectExplorer::KitManager::instance();
|
||||||
connect(km, SIGNAL(kitAdded(ProjectExplorer::Kit*)),
|
connect(km, SIGNAL(kitAdded(ProjectExplorer::Kit*)),
|
||||||
@@ -195,7 +195,7 @@ void TargetSetupPage::initializePage()
|
|||||||
|
|
||||||
setupWidgets();
|
setupWidgets();
|
||||||
setupImports();
|
setupImports();
|
||||||
selectAtLeastOneTarget();
|
selectAtLeastOneKit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSetupPage::setRequiredKitMatcher(ProjectExplorer::KitMatcher *matcher)
|
void TargetSetupPage::setRequiredKitMatcher(ProjectExplorer::KitMatcher *matcher)
|
||||||
@@ -261,7 +261,7 @@ void TargetSetupPage::setupWidgets()
|
|||||||
{
|
{
|
||||||
// Known profiles:
|
// Known profiles:
|
||||||
foreach (ProjectExplorer::Kit *k, ProjectExplorer::KitManager::instance()->kits(m_requiredMatcher)) {
|
foreach (ProjectExplorer::Kit *k, ProjectExplorer::KitManager::instance()->kits(m_requiredMatcher)) {
|
||||||
cleanProfile(k); // clean up broken profiles added by some development versions of QtC
|
cleanKit(k); // clean up broken kit added by some development versions of QtC
|
||||||
addWidget(k);
|
addWidget(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,9 +289,9 @@ void TargetSetupPage::reset()
|
|||||||
m_firstWidget = 0;
|
m_firstWidget = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::Kit *TargetSetupPage::createTemporaryProfile(QtSupport::BaseQtVersion *version,
|
ProjectExplorer::Kit *TargetSetupPage::createTemporaryKit(QtSupport::BaseQtVersion *version,
|
||||||
bool temporaryVersion,
|
bool temporaryVersion,
|
||||||
const Utils::FileName &parsedSpec)
|
const Utils::FileName &parsedSpec)
|
||||||
{
|
{
|
||||||
ProjectExplorer::Kit *k = new ProjectExplorer::Kit;
|
ProjectExplorer::Kit *k = new ProjectExplorer::Kit;
|
||||||
QtSupport::QtKitInformation::setQtVersion(k, version);
|
QtSupport::QtKitInformation::setQtVersion(k, version);
|
||||||
@@ -299,7 +299,7 @@ ProjectExplorer::Kit *TargetSetupPage::createTemporaryProfile(QtSupport::BaseQtV
|
|||||||
QmakeKitInformation::setMkspec(k, parsedSpec);
|
QmakeKitInformation::setMkspec(k, parsedSpec);
|
||||||
|
|
||||||
k->setDisplayName(version->displayName());
|
k->setDisplayName(version->displayName());
|
||||||
k->setValue(PROFILE_IS_TEMPORARY, true);
|
k->setValue(KIT_IS_TEMPORARY, true);
|
||||||
k->setValue(TEMPORARY_OF_PROJECTS, QStringList() << m_proFilePath);
|
k->setValue(TEMPORARY_OF_PROJECTS, QStringList() << m_proFilePath);
|
||||||
if (temporaryVersion)
|
if (temporaryVersion)
|
||||||
k->setValue(QT_IS_TEMPORARY, version->uniqueId());
|
k->setValue(QT_IS_TEMPORARY, version->uniqueId());
|
||||||
@@ -311,10 +311,10 @@ ProjectExplorer::Kit *TargetSetupPage::createTemporaryProfile(QtSupport::BaseQtV
|
|||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSetupPage::cleanProfile(ProjectExplorer::Kit *k)
|
void TargetSetupPage::cleanKit(ProjectExplorer::Kit *k)
|
||||||
{
|
{
|
||||||
m_ignoreUpdates = true;
|
m_ignoreUpdates = true;
|
||||||
k->removeKey(PROFILE_IS_TEMPORARY);
|
k->removeKey(KIT_IS_TEMPORARY);
|
||||||
k->removeKey(QT_IS_TEMPORARY);
|
k->removeKey(QT_IS_TEMPORARY);
|
||||||
k->removeKey(TEMPORARY_OF_PROJECTS);
|
k->removeKey(TEMPORARY_OF_PROJECTS);
|
||||||
m_ignoreUpdates = false;
|
m_ignoreUpdates = false;
|
||||||
@@ -329,19 +329,19 @@ void TargetSetupPage::makeQtPersistent(ProjectExplorer::Kit *k)
|
|||||||
|
|
||||||
void TargetSetupPage::addProject(ProjectExplorer::Kit *k, const QString &path)
|
void TargetSetupPage::addProject(ProjectExplorer::Kit *k, const QString &path)
|
||||||
{
|
{
|
||||||
if (!k->hasValue(PROFILE_IS_TEMPORARY))
|
if (!k->hasValue(KIT_IS_TEMPORARY))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QStringList profiles = k->value(TEMPORARY_OF_PROJECTS, QStringList()).toStringList();
|
QStringList profiles = k->value(TEMPORARY_OF_PROJECTS, QStringList()).toStringList();
|
||||||
profiles.append(path);
|
profiles.append(path);
|
||||||
m_ignoreUpdates = true;
|
m_ignoreUpdates = true;
|
||||||
k->setValue(PROFILE_IS_TEMPORARY, profiles);
|
k->setValue(KIT_IS_TEMPORARY, profiles);
|
||||||
m_ignoreUpdates = false;
|
m_ignoreUpdates = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSetupPage::removeProject(ProjectExplorer::Kit *k, const QString &path)
|
void TargetSetupPage::removeProject(ProjectExplorer::Kit *k, const QString &path)
|
||||||
{
|
{
|
||||||
if (!k->hasValue(PROFILE_IS_TEMPORARY) || path.isEmpty())
|
if (!k->hasValue(KIT_IS_TEMPORARY) || path.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QStringList projects = k->value(TEMPORARY_OF_PROJECTS, QStringList()).toStringList();
|
QStringList projects = k->value(TEMPORARY_OF_PROJECTS, QStringList()).toStringList();
|
||||||
@@ -359,7 +359,7 @@ void TargetSetupPage::setProFilePath(const QString &path)
|
|||||||
{
|
{
|
||||||
m_proFilePath = path;
|
m_proFilePath = path;
|
||||||
if (!m_proFilePath.isEmpty()) {
|
if (!m_proFilePath.isEmpty()) {
|
||||||
m_ui->descriptionLabel->setText(tr("Qt Creator can set up the following targets for project <b>%1</b>:",
|
m_ui->descriptionLabel->setText(tr("Qt Creator can use the following kits for project <b>%1</b>:",
|
||||||
"%1: Project name").arg(QFileInfo(m_proFilePath).baseName()));
|
"%1: Project name").arg(QFileInfo(m_proFilePath).baseName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -446,7 +446,7 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
|
|||||||
kit = k;
|
kit = k;
|
||||||
}
|
}
|
||||||
if (!kit)
|
if (!kit)
|
||||||
kit = createTemporaryProfile(version, temporaryVersion, parsedSpec);
|
kit = createTemporaryKit(version, temporaryVersion, parsedSpec);
|
||||||
else
|
else
|
||||||
addProject(kit, m_proFilePath);
|
addProject(kit, m_proFilePath);
|
||||||
|
|
||||||
@@ -481,7 +481,7 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
|
|||||||
void TargetSetupPage::handleQtUpdate(const QList<int> &add, const QList<int> &rm, const QList<int> &mod)
|
void TargetSetupPage::handleQtUpdate(const QList<int> &add, const QList<int> &rm, const QList<int> &mod)
|
||||||
{
|
{
|
||||||
Q_UNUSED(add);
|
Q_UNUSED(add);
|
||||||
// Update Profile to no longer claim a Qt version is temporary once it is modified/removed.
|
// Update kit to no longer claim a Qt version is temporary once it is modified/removed.
|
||||||
foreach (ProjectExplorer::Kit *k, ProjectExplorer::KitManager::instance()->kits()) {
|
foreach (ProjectExplorer::Kit *k, ProjectExplorer::KitManager::instance()->kits()) {
|
||||||
if (!k->hasValue(QT_IS_TEMPORARY))
|
if (!k->hasValue(QT_IS_TEMPORARY))
|
||||||
continue;
|
continue;
|
||||||
@@ -541,7 +541,7 @@ void TargetSetupPage::handleKitUpdate(ProjectExplorer::Kit *k)
|
|||||||
if (m_ignoreUpdates)
|
if (m_ignoreUpdates)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cleanProfile(k);
|
cleanKit(k);
|
||||||
Qt4TargetSetupWidget *widget = m_widgets.value(k->id());
|
Qt4TargetSetupWidget *widget = m_widgets.value(k->id());
|
||||||
|
|
||||||
bool acceptable = true;
|
bool acceptable = true;
|
||||||
@@ -556,17 +556,17 @@ void TargetSetupPage::handleKitUpdate(ProjectExplorer::Kit *k)
|
|||||||
updateVisibility();
|
updateVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSetupPage::selectAtLeastOneTarget()
|
void TargetSetupPage::selectAtLeastOneKit()
|
||||||
{
|
{
|
||||||
bool atLeastOneTargetSelected = false;
|
bool atLeastOneKitSelected = false;
|
||||||
foreach (Qt4TargetSetupWidget *w, m_widgets.values()) {
|
foreach (Qt4TargetSetupWidget *w, m_widgets.values()) {
|
||||||
if (w->isKitSelected()) {
|
if (w->isKitSelected()) {
|
||||||
atLeastOneTargetSelected = true;
|
atLeastOneKitSelected = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!atLeastOneTargetSelected) {
|
if (!atLeastOneKitSelected) {
|
||||||
Qt4TargetSetupWidget *widget = m_firstWidget;
|
Qt4TargetSetupWidget *widget = m_firstWidget;
|
||||||
ProjectExplorer::Kit *defaultKit = ProjectExplorer::KitManager::instance()->defaultKit();
|
ProjectExplorer::Kit *defaultKit = ProjectExplorer::KitManager::instance()->defaultKit();
|
||||||
if (defaultKit)
|
if (defaultKit)
|
||||||
@@ -627,33 +627,34 @@ Qt4TargetSetupWidget *TargetSetupPage::addWidget(ProjectExplorer::Kit *k)
|
|||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ProfileBuildInfo
|
class KitBuildInfo
|
||||||
{
|
{
|
||||||
ProfileBuildInfo(ProjectExplorer::Kit *p, const QList<BuildConfigurationInfo> &il) :
|
public:
|
||||||
profile(p), infoList(il)
|
KitBuildInfo(ProjectExplorer::Kit *k, const QList<BuildConfigurationInfo> &il) :
|
||||||
|
kit(k), infoList(il)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
ProjectExplorer::Kit *profile;
|
ProjectExplorer::Kit *kit;
|
||||||
QList<BuildConfigurationInfo> infoList;
|
QList<BuildConfigurationInfo> infoList;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project)
|
bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project)
|
||||||
{
|
{
|
||||||
QList<ProfileBuildInfo> toRegister;
|
QList<KitBuildInfo> toRegister;
|
||||||
foreach (Qt4TargetSetupWidget *widget, m_widgets.values()) {
|
foreach (Qt4TargetSetupWidget *widget, m_widgets.values()) {
|
||||||
if (!widget->isKitSelected())
|
if (!widget->isKitSelected())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ProjectExplorer::Kit *p = widget->profile();
|
ProjectExplorer::Kit *p = widget->profile();
|
||||||
cleanProfile(p);
|
cleanKit(p);
|
||||||
toRegister.append(ProfileBuildInfo(p, widget->selectedBuildConfigurationInfoList()));
|
toRegister.append(KitBuildInfo(p, widget->selectedBuildConfigurationInfoList()));
|
||||||
widget->clearProfile();
|
widget->clearKit();
|
||||||
}
|
}
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
// only register targets after we are done cleaning up
|
// only register kits after we are done cleaning up
|
||||||
foreach (const ProfileBuildInfo &data, toRegister)
|
foreach (const KitBuildInfo &data, toRegister)
|
||||||
project->addTarget(project->createTarget(data.profile, data.infoList));
|
project->addTarget(project->createTarget(data.kit, data.infoList));
|
||||||
|
|
||||||
// Select active target
|
// Select active target
|
||||||
// a) Simulator target
|
// a) Simulator target
|
||||||
|
@@ -93,7 +93,7 @@ private slots:
|
|||||||
void updateVisibility();
|
void updateVisibility();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void selectAtLeastOneTarget();
|
void selectAtLeastOneKit();
|
||||||
void import(const Utils::FileName &path, const bool silent);
|
void import(const Utils::FileName &path, const bool silent);
|
||||||
void removeWidget(ProjectExplorer::Kit *k);
|
void removeWidget(ProjectExplorer::Kit *k);
|
||||||
Qt4TargetSetupWidget *addWidget(ProjectExplorer::Kit *k);
|
Qt4TargetSetupWidget *addWidget(ProjectExplorer::Kit *k);
|
||||||
@@ -102,8 +102,8 @@ private:
|
|||||||
|
|
||||||
void setupWidgets();
|
void setupWidgets();
|
||||||
void reset();
|
void reset();
|
||||||
ProjectExplorer::Kit *createTemporaryProfile(QtSupport::BaseQtVersion *version, bool temporaryVersion, const Utils::FileName &parsedSpec);
|
ProjectExplorer::Kit *createTemporaryKit(QtSupport::BaseQtVersion *version, bool temporaryVersion, const Utils::FileName &parsedSpec);
|
||||||
void cleanProfile(ProjectExplorer::Kit *k);
|
void cleanKit(ProjectExplorer::Kit *k);
|
||||||
void makeQtPersistent(ProjectExplorer::Kit *k);
|
void makeQtPersistent(ProjectExplorer::Kit *k);
|
||||||
void addProject(ProjectExplorer::Kit *k, const QString &path);
|
void addProject(ProjectExplorer::Kit *k, const QString &path);
|
||||||
void removeProject(ProjectExplorer::Kit *k, const QString &path);
|
void removeProject(ProjectExplorer::Kit *k, const QString &path);
|
||||||
|
@@ -62,7 +62,7 @@ TestWizardDialog::TestWizardDialog(const QString &templateName,
|
|||||||
setWindowIcon(icon);
|
setWindowIcon(icon);
|
||||||
setWindowTitle(templateName);
|
setWindowTitle(templateName);
|
||||||
setSelectedModules(QLatin1String("core testlib"), true);
|
setSelectedModules(QLatin1String("core testlib"), true);
|
||||||
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS))
|
if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_KIT_IDS))
|
||||||
addTargetSetupPage();
|
addTargetSetupPage();
|
||||||
m_modulesPageId = addModulesPage();
|
m_modulesPageId = addModulesPage();
|
||||||
m_testPageId = addPage(m_testPage);
|
m_testPageId = addPage(m_testPage);
|
||||||
|
Reference in New Issue
Block a user