diff options
author | Niels Weber <niels.weber@digia.com> | 2013-03-21 10:32:40 +0100 |
---|---|---|
committer | Niels Weber <niels.weber@digia.com> | 2013-03-21 16:33:27 +0100 |
commit | f65954d9033cbd1d342ecb6c202920a0df992dc7 (patch) | |
tree | ac3632913b3c10ad680254a1c3e55c3d216135d6 /src/libs/installer/settings.cpp | |
parent | 44fc5acd5c44da29306558ef5a081afb0ea92304 (diff) |
Remove previously deprecated Pages config.xml element.
Change-Id: I909c81896186ef5191d1dac799296da26e37072f
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Diffstat (limited to 'src/libs/installer/settings.cpp')
-rw-r--r-- | src/libs/installer/settings.cpp | 65 |
1 files changed, 2 insertions, 63 deletions
diff --git a/src/libs/installer/settings.cpp b/src/libs/installer/settings.cpp index f08989ff7..36a35fc87 100644 --- a/src/libs/installer/settings.cpp +++ b/src/libs/installer/settings.cpp @@ -54,7 +54,6 @@ static const QLatin1String scIcon("Icon"); static const QLatin1String scInstallerApplicationIcon("InstallerApplicationIcon"); static const QLatin1String scInstallerWindowIcon("InstallerWindowIcon"); static const QLatin1String scLogo("Logo"); -static const QLatin1String scPages("Pages"); static const QLatin1String scPrefix("Prefix"); static const QLatin1String scWatermark("Watermark"); static const QLatin1String scProductUrl("ProductUrl"); @@ -116,40 +115,6 @@ static QSet<Repository> readRepositories(QXmlStreamReader &reader, bool isDefaul return set; } -static QVariantHash readTitles(QXmlStreamReader &reader) -{ - QVariantHash hash; - while (reader.readNextStartElement()) - hash.insert(reader.name().toString(), reader.readElementText(QXmlStreamReader::SkipChildElements)); - return hash; -} - -static QHash<QString, QVariantHash> readPages(QXmlStreamReader &reader) -{ - QHash<QString, QVariantHash> hash; - while (reader.readNextStartElement()) { - if (reader.name() == QLatin1String("Page")) { - QVariantHash pageElements; - const QString pageName = reader.attributes().value(QLatin1String("name")).toString(); - if (pageName.isEmpty()) - reader.raiseError(QLatin1String("Expected non-empty attribute 'name' for element 'Page'.")); - - while (reader.readNextStartElement()) { - const QString name = reader.name().toString(); - if (name == QLatin1String("Title") || name == QLatin1String("SubTitle")) { - pageElements.insert(name, readTitles(reader)); - } else { - pageElements.insert(name, reader.readElementText(QXmlStreamReader::SkipChildElements)); - } - } - hash.insert(pageName, pageElements); - } else { - reader.raiseError(QString::fromLatin1("Unexpected element '%1'.").arg(reader.name().toString())); - } - } - return hash; -} - // -- Settings::Private @@ -223,10 +188,10 @@ Settings Settings::fromFileAndPrefix(const QString &path, const QString &prefix) << scDependsOnLocalInstallerBinary << scAllowSpaceInPath << scAllowNonAsciiCharacters << scRepositorySettingsPageVisible << scTargetConfigurationFile - << scRemoteRepositories << scPages; + << scRemoteRepositories; QStringList blackList; - blackList << scRemoteRepositories << scPages; + blackList << scRemoteRepositories; Settings s; s.d->m_data.insert(scPrefix, prefix); @@ -245,14 +210,6 @@ Settings Settings::fromFileAndPrefix(const QString &path, const QString &prefix) if (blackList.contains(name)) { if (name == scRemoteRepositories) s.addDefaultRepositories(readRepositories(reader, true)); - - if (name == scPages) { - qWarning() << "Deprecated element 'Pages'."; - QHash<QString, QVariantHash> pages = readPages(reader); - const QStringList &keys = pages.keys(); - foreach (const QString &key, keys) - s.d->m_data.insert(key, pages.value(key)); - } } else { if (s.d->m_data.contains(name)) reader.raiseError(QString::fromLatin1("Element '%1' has been defined before.").arg(name)); @@ -552,24 +509,6 @@ QVariantList Settings::values(const QString &key, const QVariantList &defaultVal return list.isEmpty() ? defaultValue : list; } -QVariantHash Settings::titlesForPage(const QString &pageName) const -{ - const QVariantHash hash = d->m_data.value(pageName).toHash(); - const QVariant variant = hash.value(QLatin1String("Title"), QVariant()); - if (!variant.canConvert<QVariantHash>()) - return QVariantHash(); - return variant.value<QVariantHash>(); -} - -QVariantHash Settings::subTitlesForPage(const QString &pageName) const -{ - const QVariantHash hash = d->m_data.value(pageName).toHash(); - const QVariant variant = hash.value(QLatin1String("SubTitle"), QVariant()); - if (!variant.canConvert<QVariantHash>()) - return QVariantHash(); - return variant.value<QVariantHash>(); -} - bool Settings::repositorySettingsPageVisible() const { return d->m_data.value(scRepositorySettingsPageVisible, true).toBool(); |