summaryrefslogtreecommitdiffhomepage
path: root/options/group.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-09 15:18:26 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-09 18:33:30 +0200
commit078059915bdb39726924ef5bfed159c8dcf2af6c (patch)
tree4772c907c2a4e0c4ab2df0b3b4464e1f848902c9 /options/group.cpp
parent96687dbf37b2aa2fc05a85a312ab573e64923879 (diff)
options/{bundle,group}: don't create QSettings all the time
Diffstat (limited to 'options/group.cpp')
-rw-r--r--options/group.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/options/group.cpp b/options/group.cpp
index 69b79cef..94e111aa 100644
--- a/options/group.cpp
+++ b/options/group.cpp
@@ -6,12 +6,11 @@
namespace options {
-group::group(const QString& name) : name(name)
+group::group(const QString& name, std::shared_ptr<QSettings> conf) : name(name)
{
if (name == "")
return;
- auto conf = ini_file();
conf->beginGroup(name);
for (auto& k_ : conf->childKeys())
{
@@ -22,6 +21,10 @@ group::group(const QString& name) : name(name)
conf->endGroup();
}
+group::group(const QString& name) : group(name, ini_file())
+{
+}
+
void group::save() const
{
save_deferred(*ini_file());