diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-17 23:50:51 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-17 23:51:14 +0200 |
commit | 93d6e7a6b8d135365a0f073098ba97f905d2c550 (patch) | |
tree | aae77f89c09521b1d2e19dd2ad00ea28299a0581 /options/group.cpp | |
parent | 1a7b39fcd77ee82450d591357ea336f956d49734 (diff) |
options: support deferred writes when saving bundles
The mapping window has 13 bundles total in use. Setting them all can take up
to a large fraction of a second on some windows filesystems. Do a single
config write instead.
Diffstat (limited to 'options/group.cpp')
-rw-r--r-- | options/group.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/options/group.cpp b/options/group.cpp index 8aa381fc..d710afad 100644 --- a/options/group.cpp +++ b/options/group.cpp @@ -24,14 +24,18 @@ group::group(const QString& name) : name(name) void group::save() const { + save_deferred(*ini_file()); +} + +void group::save_deferred(QSettings& s) const +{ if (name == "") return; - auto s = ini_file(); - s->beginGroup(name); + s.beginGroup(name); for (auto& i : kvs) - s->setValue(i.first, i.second); - s->endGroup(); + s.setValue(i.first, i.second); + s.endGroup(); } void group::put(const QString &s, const QVariant &d) |