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/bundle.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/bundle.cpp')
-rw-r--r-- | options/bundle.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/options/bundle.cpp b/options/bundle.cpp index a60810c5..fa1a214c 100644 --- a/options/bundle.cpp +++ b/options/bundle.cpp @@ -37,7 +37,7 @@ bool bundle::contains(const QString &name) const return transient.contains(name); } -void bundle::save() +void bundle::save_deferred(QSettings& s) { if (group_name == "") return; @@ -51,7 +51,7 @@ void bundle::save() qDebug() << "bundle" << group_name << "changed, saving"; modified_ = true; saved = transient; - saved.save(); + saved.save_deferred(s); } } @@ -59,6 +59,11 @@ void bundle::save() emit saving(); } +void bundle::save() +{ + save_deferred(*group::ini_file()); +} + bool bundle::modifiedp() const // XXX unused { QMutexLocker l(const_cast<QMutex*>(&mtx)); |