Commit 05d2c28e authored by Mehdi Fekari's avatar Mehdi Fekari Committed by Mehdi Fekari

Qnx: Remove invalid auto detected kits/qt versions

Change-Id: I9bd528a636ed64b581dad0b20b595451c7b87370
Reviewed-by: Nicolas Arnaud-Cormos's avatarNicolas Arnaud-Cormos <nicolas@kdab.com>
parent fc731a3a
......@@ -180,30 +180,27 @@ void BlackBerryConfigurationManager::saveManualConfigurations()
settings->endGroup();
}
// Remove no longer available 'auo detected' kits
// Remove no longer available/valid 'auto detected' BlackBerry kits and qt versions
void BlackBerryConfigurationManager::clearInvalidConfigurations()
{
QList<NdkInstallInformation> autoNdks = QnxUtils::installedNdks();
foreach (Kit *kit, KitManager::kits()) {
// Deregister invalid auto deteted BlackBerry Kits
foreach (ProjectExplorer::Kit *kit, ProjectExplorer::KitManager::instance()->kits()) {
if (!kit->isAutoDetected())
continue;
if (kit->displayName().contains(QLatin1String("BlackBerry"))) {
// Check if related target is still installed
bool isValid = false;
foreach (const NdkInstallInformation &ndkInfo, autoNdks) {
if (ndkInfo.target == SysRootKitInformation::sysRoot(kit).toString()) {
isValid = true;
break;
}
}
if (!isValid) {
QtSupport::QtVersionManager::removeVersion(QtSupport::QtKitInformation::qtVersion(kit));
ToolChainManager::deregisterToolChain(ToolChainKitInformation::toolChain(kit));
KitManager::deregisterKit(kit);
}
}
if (ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(kit) == Constants::QNX_BB_OS_TYPE
&& !kit->isValid())
ProjectExplorer::KitManager::instance()->deregisterKit(kit);
}
// Remove invalid auto detected BlackBerry qtVerions
foreach (QtSupport::BaseQtVersion *qtVersion, QtSupport::QtVersionManager::versions()) {
if (!qtVersion->isAutodetected())
continue;
if (qtVersion->platformName() == QLatin1String(Constants::QNX_BB_PLATFORM_NAME)
&& !qtVersion->isValid())
QtSupport::QtVersionManager::removeVersion(qtVersion);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment