mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
parent
9359977d8b
commit
3a9f2f9e78
@ -25,8 +25,9 @@ QzSettings* Settings::s_qzSettings = 0;
|
|||||||
|
|
||||||
Settings::Settings()
|
Settings::Settings()
|
||||||
{
|
{
|
||||||
|
// Save currently opened group
|
||||||
if (!s_settings->group().isEmpty()) {
|
if (!s_settings->group().isEmpty()) {
|
||||||
qDebug("Settings: Creating object with opened group!");
|
m_openedGroup = s_settings->group();
|
||||||
s_settings->endGroup();
|
s_settings->endGroup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,7 +79,11 @@ QzSettings* Settings::staticSettings()
|
|||||||
Settings::~Settings()
|
Settings::~Settings()
|
||||||
{
|
{
|
||||||
if (!s_settings->group().isEmpty()) {
|
if (!s_settings->group().isEmpty()) {
|
||||||
qDebug("Settings: Deleting object with opened group!");
|
qDebug() << "Settings: Deleting object with opened group!";
|
||||||
s_settings->endGroup();
|
s_settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restore opened group
|
||||||
|
if (!m_openedGroup.isEmpty())
|
||||||
|
s_settings->beginGroup(m_openedGroup);
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#ifndef SETTINGS_H
|
#ifndef SETTINGS_H
|
||||||
#define SETTINGS_H
|
#define SETTINGS_H
|
||||||
|
|
||||||
#include <qglobal.h>
|
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
#include "qzcommon.h"
|
#include "qzcommon.h"
|
||||||
@ -45,14 +44,12 @@ public:
|
|||||||
void beginGroup(const QString &prefix);
|
void beginGroup(const QString &prefix);
|
||||||
void endGroup();
|
void endGroup();
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static QSettings* s_settings;
|
static QSettings* s_settings;
|
||||||
static QzSettings* s_qzSettings;
|
static QzSettings* s_qzSettings;
|
||||||
|
|
||||||
|
QString m_openedGroup;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SETTINGS_H
|
#endif // SETTINGS_H
|
||||||
|
Loading…
Reference in New Issue
Block a user