From f82e3b55e353987fedea0785e0a80e8a5be524d3 Mon Sep 17 00:00:00 2001 From: Juraj Oravec Date: Sun, 24 Nov 2024 00:50:15 +0100 Subject: [PATCH] Add missing settings.endGroup() when needed Signed-off-by: Juraj Oravec --- src/lib/plugins/plugins.cpp | 1 + src/plugins/GreaseMonkey/gm_downloader.cpp | 1 + src/plugins/GreaseMonkey/gm_manager.cpp | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/lib/plugins/plugins.cpp b/src/lib/plugins/plugins.cpp index e7006fd01..622a3d32c 100644 --- a/src/lib/plugins/plugins.cpp +++ b/src/lib/plugins/plugins.cpp @@ -189,6 +189,7 @@ PluginSpec Plugins::createSpec(const QJsonObject &metaData) settings.setValue(it.key(), it.value().toString()); } } + settings.endGroup(); settings.sync(); return createSpec(DesktopFile(tempMetadata)); } diff --git a/src/plugins/GreaseMonkey/gm_downloader.cpp b/src/plugins/GreaseMonkey/gm_downloader.cpp index dd84cb526..83cd6c7d4 100644 --- a/src/plugins/GreaseMonkey/gm_downloader.cpp +++ b/src/plugins/GreaseMonkey/gm_downloader.cpp @@ -150,6 +150,7 @@ void GM_Downloader::requireDownloaded() file.close(); settings.setValue(m_reply->request().url().toString(), QFileInfo(m_fileName).fileName()); + settings.endGroup(); Q_EMIT finished(m_fileName); } diff --git a/src/plugins/GreaseMonkey/gm_manager.cpp b/src/plugins/GreaseMonkey/gm_manager.cpp index 1656ba70b..08017b6f3 100644 --- a/src/plugins/GreaseMonkey/gm_manager.cpp +++ b/src/plugins/GreaseMonkey/gm_manager.cpp @@ -119,6 +119,7 @@ QString GM_Manager::requireScripts(const QStringList &urlList) const } } } + settings.endGroup(); return script; } @@ -276,6 +277,7 @@ void GM_Manager::load() QSettings settings(m_settingsPath + QL1S("/extensions.ini"), QSettings::IniFormat); settings.beginGroup(QSL("GreaseMonkey")); m_disabledScripts = settings.value(QSL("disabledScripts"), QStringList()).toStringList(); + settings.endGroup(); const auto fileNames = gmDir.entryList(QStringList(QSL("*.js")), QDir::Files); for (const QString &fileName : fileNames) {