diff --git a/src/lib/app/settings.cpp b/src/lib/app/settings.cpp index f708bc4b6..ffcaafb97 100644 --- a/src/lib/app/settings.cpp +++ b/src/lib/app/settings.cpp @@ -25,8 +25,9 @@ QzSettings* Settings::s_qzSettings = 0; Settings::Settings() { + // Save currently opened group if (!s_settings->group().isEmpty()) { - qDebug("Settings: Creating object with opened group!"); + m_openedGroup = s_settings->group(); s_settings->endGroup(); } } @@ -78,7 +79,11 @@ QzSettings* Settings::staticSettings() Settings::~Settings() { if (!s_settings->group().isEmpty()) { - qDebug("Settings: Deleting object with opened group!"); + qDebug() << "Settings: Deleting object with opened group!"; s_settings->endGroup(); } + + // Restore opened group + if (!m_openedGroup.isEmpty()) + s_settings->beginGroup(m_openedGroup); } diff --git a/src/lib/app/settings.h b/src/lib/app/settings.h index aa9baa719..8bb2e29cd 100644 --- a/src/lib/app/settings.h +++ b/src/lib/app/settings.h @@ -18,7 +18,6 @@ #ifndef SETTINGS_H #define SETTINGS_H -#include #include #include "qzcommon.h" @@ -45,14 +44,12 @@ public: void beginGroup(const QString &prefix); void endGroup(); -signals: - -public slots: - private: static QSettings* s_settings; static QzSettings* s_qzSettings; + QString m_openedGroup; + }; #endif // SETTINGS_H