Utils, all: Standardize on QtcSettings

Change-Id: Id222016f15b1c3bfe6710fe5d0297666d4565ef1
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2023-09-22 16:15:27 +02:00
parent 4629b0f69e
commit 342e066886
172 changed files with 955 additions and 874 deletions

View File

@@ -480,7 +480,7 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document,
setDocumentMode(true);
setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::TabPosition::South);
document->setWindowStateCallback([this] { return windowStateCallback(); });
document->setWindowStateCallback([this] { return storeFromMap(windowStateCallback()); });
document->settings()->m_sources.setItemAddedCallback<SourceSettings>(
[this](const std::shared_ptr<SourceSettings> &source) { addSourceEditor(source); });
@@ -544,15 +544,15 @@ QVariantMap EditorWidget::windowStateCallback()
auto settings = saveSettings();
QVariantMap result;
for (const auto &key : settings.keys()) {
for (const Key &key : settings.keys()) {
// QTBUG-116339
if (key != "State") {
result.insert(key, settings.value(key));
if (stringFromKey(key) != "State") {
result.insert(stringFromKey(key), settings.value(key));
} else {
QVariantMap m;
m["type"] = "Base64";
m["value"] = settings.value(key).toByteArray().toBase64();
result.insert(key, m);
result.insert(stringFromKey(key), m);
}
}
@@ -646,12 +646,12 @@ void EditorWidget::recreateEditors()
m_document->settings()->m_sources.forEachItem<SourceSettings>(
[this](const auto &sourceSettings) { addSourceEditor(sourceSettings); });
QVariantMap windowState = m_document->settings()->windowState.value();
Store windowState = m_document->settings()->windowState.value();
if (!windowState.isEmpty()) {
QHash<QString, QVariant> hashMap;
QHash<Key, QVariant> hashMap;
for (const auto &key : windowState.keys()) {
if (key != "State")
if (key.view() != "State")
hashMap.insert(key, windowState.value(key));
else {
QVariant v = windowState.value(key);