Commit f32b6fd3 authored by El Mehdi Fekari's avatar El Mehdi Fekari Committed by Mehdi Fekari

Qnx: Correctly restore BlackBerry kits from previous QTC builds

* When setting autoDetection source to old pre-existing kits, the
setKitsAutoDetectionSource() was mistakenly comparing the kits device type id
to QNX_BB_CATEGORY_ICON instead of QNX_BB_OS_TYPE.

* The setKitsAutoDetectionSource() method was called earlier before
the API levels are loaded/restored, so previous BlackBerry kits
were not updated (i.e auto detection source is set).

Task-number: QTCREATORBUG-11807

Change-Id: Id349f192e577af3e4e54d4269079be0e8ec8f44a
Reviewed-by: default avatarDavid Kaspar <dkaspar@blackberry.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 1c13798c
......@@ -51,6 +51,7 @@
#include <qtsupport/qtkitinformation.h>
#include <debugger/debuggerkitinformation.h>
#include <qmakeprojectmanager/qmakekitinformation.h>
#include <QMessageBox>
#include <QFileInfo>
......@@ -261,14 +262,22 @@ void BlackBerryConfigurationManager::setKitsAutoDetectionSource()
{
foreach (Kit *kit, KitManager::kits()) {
if (kit->isAutoDetected() &&
(DeviceTypeKitInformation::deviceTypeId(kit) == Constants::QNX_BB_CATEGORY_ICON) &&
(DeviceTypeKitInformation::deviceTypeId(kit) == Constants::QNX_BB_OS_TYPE) &&
kit->autoDetectionSource().isEmpty()) {
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
foreach (BlackBerryApiLevelConfiguration *config, m_apiLevels) {
if ((version &&
(version->qmakeCommand() == config->qmake4BinaryFile() || version->qmakeCommand() == config->qmake5BinaryFile()))
&& (SysRootKitInformation::sysRoot(kit) == config->sysRoot()))
&& (SysRootKitInformation::sysRoot(kit) == config->sysRoot())) {
kit->setAutoDetectionSource(config->ndkEnvFile().toString());
// Set stickyness since not necessary saved for those kits
kit->setSticky(QtSupport::QtKitInformation::id(), true);
kit->setSticky(ToolChainKitInformation::id(), true);
kit->setSticky(DeviceTypeKitInformation::id(), true);
kit->setSticky(SysRootKitInformation::id(), true);
kit->setSticky(Debugger::DebuggerKitInformation::id(), true);
kit->setSticky(QmakeProjectManager::QmakeKitInformation::id(), true);
}
}
}
}
......@@ -449,10 +458,6 @@ QList<Utils::EnvironmentItem> BlackBerryConfigurationManager::defaultConfigurati
void BlackBerryConfigurationManager::loadSettings()
{
// Backward compatibility: Set kit's auto detection source
// for existing BlackBerry kits that do not have it set yet.
setKitsAutoDetectionSource();
restoreConfigurations();
// For backward compatibility
loadManualConfigurations();
......@@ -460,6 +465,10 @@ void BlackBerryConfigurationManager::loadSettings()
loadAutoDetectedRuntimes();
checkToolChainConfiguration();
// Backward compatibility: Set kit's auto detection source
// for existing BlackBerry kits that do not have it set yet.
setKitsAutoDetectionSource();
emit settingsLoaded();
emit settingsChanged();
}
......
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