Skip to content

Commit 87433e3

Browse files
committed
kconfig: qconf: confine {begin,end}Group to constructor and destructor
Call beginGroup() in the the constructor and endGroup() in the destructor. This looks cleaner. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 721bfe5 commit 87433e3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

scripts/kconfig/qconf.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ QAction *ConfigMainWindow::saveAction;
3737
ConfigSettings::ConfigSettings()
3838
: QSettings("kernel.org", "qconf")
3939
{
40+
beginGroup("/kconfig/qconf");
41+
}
42+
43+
ConfigSettings::~ConfigSettings()
44+
{
45+
endGroup();
4046
}
4147

4248
/**
@@ -1829,15 +1835,13 @@ int main(int ac, char** av)
18291835
configApp = new QApplication(ac, av);
18301836

18311837
configSettings = new ConfigSettings();
1832-
configSettings->beginGroup("/kconfig/qconf");
18331838
v = new ConfigMainWindow();
18341839

18351840
//zconfdump(stdout);
18361841

18371842
v->show();
18381843
configApp->exec();
18391844

1840-
configSettings->endGroup();
18411845
delete configSettings;
18421846
delete v;
18431847
delete configApp;

scripts/kconfig/qconf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class ConfigMainWindow;
2424
class ConfigSettings : public QSettings {
2525
public:
2626
ConfigSettings();
27+
~ConfigSettings(void);
2728
QList<int> readSizes(const QString& key, bool *ok);
2829
bool writeSizes(const QString& key, const QList<int>& value);
2930
};

0 commit comments

Comments
 (0)