Commit 4eecf479 authored by Daniel Teske's avatar Daniel Teske
Browse files

Android: Preserve settings on upgrading the qt sdk on windows



Only override a setting from the sdk provided settings file if the
sdk settings file contains the setting.

Change-Id: I29a0f88d5075bfe432eb89c90fb959ef984e17b6
Reviewed-by: default avatarBogDan Vatra <bogdan@kde.org>
parent 113bdf11
......@@ -339,11 +339,11 @@ PersistentSettingsReader::PersistentSettingsReader()
{
}
QVariant PersistentSettingsReader::restoreValue(const QString &variable) const
QVariant PersistentSettingsReader::restoreValue(const QString &variable, const QVariant &defaultValue) const
{
if (m_valueMap.contains(variable))
return m_valueMap.value(variable);
return QVariant();
return defaultValue;
}
QVariantMap PersistentSettingsReader::restoreValues() const
......
......@@ -45,7 +45,7 @@ class QTCREATOR_UTILS_EXPORT PersistentSettingsReader
{
public:
PersistentSettingsReader();
QVariant restoreValue(const QString &variable) const;
QVariant restoreValue(const QString &variable, const QVariant &defaultValue = QVariant()) const;
QVariantMap restoreValues() const;
bool load(const FileName &fileName);
......
......@@ -224,15 +224,13 @@ void AndroidConfig::load(const QSettings &settings)
if (reader.load(FileName::fromString(sdkSettingsFileName()))
&& settings.value(changeTimeStamp).toInt() != QFileInfo(sdkSettingsFileName()).lastModified().toMSecsSinceEpoch() / 1000) {
// persisten settings
m_sdkLocation = FileName::fromString(reader.restoreValue(SDKLocationKey).toString());
m_ndkLocation = FileName::fromString(reader.restoreValue(NDKLocationKey).toString());
m_antLocation = FileName::fromString(reader.restoreValue(AntLocationKey).toString());
m_openJDKLocation = FileName::fromString(reader.restoreValue(OpenJDKLocationKey).toString());
m_keystoreLocation = FileName::fromString(reader.restoreValue(KeystoreLocationKey).toString());
m_toolchainHost = reader.restoreValue(ToolchainHostKey).toString();
QVariant v = reader.restoreValue(AutomaticKitCreationKey);
if (v.isValid())
m_automaticKitCreation = v.toBool();
m_sdkLocation = FileName::fromString(reader.restoreValue(SDKLocationKey, m_sdkLocation.toString()).toString());
m_ndkLocation = FileName::fromString(reader.restoreValue(NDKLocationKey, m_ndkLocation.toString()).toString());
m_antLocation = FileName::fromString(reader.restoreValue(AntLocationKey, m_antLocation.toString()).toString());
m_openJDKLocation = FileName::fromString(reader.restoreValue(OpenJDKLocationKey, m_openJDKLocation.toString()).toString());
m_keystoreLocation = FileName::fromString(reader.restoreValue(KeystoreLocationKey, m_keystoreLocation.toString()).toString());
m_toolchainHost = reader.restoreValue(ToolchainHostKey, m_toolchainHost).toString();
m_automaticKitCreation = reader.restoreValue(AutomaticKitCreationKey, m_automaticKitCreation).toBool();
QString extraDirectory = reader.restoreValue(MakeExtraSearchDirectory).toString();
m_makeExtraSearchDirectories.clear();
if (!extraDirectory.isEmpty())
......
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