From 396577a4c64df13aa0a858929ec4dacb63d88631 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 25 Oct 2024 14:10:09 +0200 Subject: [PATCH] QtSupport: remove unused from/toMap/Store Change-Id: I42ae0c20c73da20dde01a2f5815ec9c7806b033b Reviewed-by: hjk Reviewed-by: Christian Stenger --- src/plugins/qtsupport/baseqtversion.cpp | 98 ------------------------- 1 file changed, 98 deletions(-) diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 2528912b757..dcba04ce024 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -78,9 +78,6 @@ const char MKSPEC_VALUE_NAMESPACE[] = "QT_NAMESPACE"; class QtVersionData { public: - // Update version if you add data members! - static const int version = 3; - bool installed = true; bool hasExamples = false; bool hasDemos = false; @@ -117,101 +114,6 @@ public: QHash versionInfo; bool versionInfoUpToDate = false; - - static QHash fromStore(const Store &map) - { - QHash result; - for (auto it = map.constBegin(); it != map.constEnd(); ++it) - result.insert(ProKey(it.key().toByteArray()), ProString(it.value().toString())); - return result; - } - - static Store toStore(const QHash &map) - { - Store result; - for (auto it = map.constBegin(); it != map.constEnd(); ++it) - result.insert(it.key().toString().toQString().toUtf8(), it.value().toQString()); - return result; - } - - Store toMap() - { - Store result; - result.insert("CacheDataVersion", version); - result.insert("Installed", installed); - result.insert("HasExamples", hasExamples); - result.insert("HasDemos", hasDemos); - result.insert("HasDocumentation", hasDocumentation); - result.insert("VersionInfoUpToDate", versionInfoUpToDate); - - unexpandedDisplayName.toMap(result, "UnexpandedDisplayName"); - - result.insert("QtVersionString", qtVersionString); - result.insert("SourcePath", sourcePath.toSettings()); - result.insert("Prefix", prefix.toSettings()); - result.insert("BinPath", binPath.toSettings()); - result.insert("LibExecPath", libExecPath.toSettings()); - result.insert("ConfigurationPath", configurationPath.toSettings()); - result.insert("DataPath", dataPath.toSettings()); - result.insert("DemosPath", demosPath.toSettings()); - result.insert("DocsPath", docsPath.toSettings()); - result.insert("ExamplesPath", examplesPath.toSettings()); - result.insert("HeaderPath", headerPath.toSettings()); - result.insert("ImportsPath", importsPath.toSettings()); - result.insert("LibraryPath", libraryPath.toSettings()); - result.insert("PluginPath", pluginPath.toSettings()); - result.insert("QmlPath", qmlPath.toSettings()); - result.insert("TranslationsPath", translationsPath.toSettings()); - result.insert("HostBinPath", hostBinPath.toSettings()); - result.insert("HostLibexecPath", hostLibexecPath.toSettings()); - result.insert("HostDataPath", hostDataPath.toSettings()); - result.insert("HostPrefixPath", hostPrefixPath.toSettings()); - if (qtAbis) - result.insert("QtAbis", Utils::transform(*qtAbis, &Abi::toString)); - result.insert("VersionInfo", QVariant::fromValue(toStore(versionInfo))); - - return result; - } - - void fromMap(Store map) - { - if (map.value("CacheDataVersion").toInt() < version) - return; - - installed = map.value("Installed").toBool(); - hasExamples = map.value("HasExamples").toBool(); - hasDemos = map.value("HasDemos").toBool(); - hasDocumentation = map.value("HasDocumentation").toBool(); - versionInfoUpToDate = map.value("VersionInfoUpToDate", false).toBool(); - unexpandedDisplayName.fromMap(map, "UnexpandedDisplayName"); - qtVersionString = map.value("QtVersionString").toString(); - sourcePath = FilePath::fromSettings(map.value("SourcePath")); - prefix = FilePath::fromSettings(map.value("Prefix")); - binPath = FilePath::fromSettings(map.value("BinPath")); - libExecPath = FilePath::fromSettings(map.value("LibExecPath")); - configurationPath = FilePath::fromSettings(map.value("ConfigurationPath")); - dataPath = FilePath::fromSettings(map.value("DataPath")); - demosPath = FilePath::fromSettings(map.value("DemosPath")); - docsPath = FilePath::fromSettings(map.value("DocsPath")); - examplesPath = FilePath::fromSettings(map.value("ExamplesPath")); - headerPath = FilePath::fromSettings(map.value("HeaderPath")); - importsPath = FilePath::fromSettings(map.value("ImportsPath")); - libraryPath = FilePath::fromSettings(map.value("LibraryPath")); - pluginPath = FilePath::fromSettings(map.value("PluginPath")); - qmlPath = FilePath::fromSettings(map.value("QmlPath")); - translationsPath = FilePath::fromSettings(map.value("TranslationsPath")); - hostBinPath = FilePath::fromSettings(map.value("HostBinPath")); - hostLibexecPath = FilePath::fromSettings(map.value("HostLibexecPath")); - hostDataPath = FilePath::fromSettings(map.value("HostDataPath")); - hostPrefixPath = FilePath::fromSettings(map.value("HostPrefixPath")); - auto it = map.find("QtAbis"); - if (it != map.end()) { - const auto qtAbisList = it.value().toStringList(); - if (!qtAbisList.isEmpty()) - qtAbis = Utils::transform(qtAbisList, &Abi::fromString); - } - versionInfo = fromStore(map.value("VersionInfo").value()); - } }; // --------------------------------------------------------------------