From 93d6e7a6b8d135365a0f073098ba97f905d2c550 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 17 Aug 2016 23:50:51 +0200 Subject: 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. --- spline-widget/spline.cpp | 9 +++++++-- spline-widget/spline.hpp | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'spline-widget') diff --git a/spline-widget/spline.cpp b/spline-widget/spline.cpp index da67f0d4..c71076f4 100644 --- a/spline-widget/spline.cpp +++ b/spline-widget/spline.cpp @@ -254,10 +254,15 @@ void spline::reload() s->b->reload(); } -void spline::save() +void spline::save(QSettings& settings) { if (s && s->b) - s->b->save(); + s->b->save_deferred(settings); +} + +void spline::save() +{ + save(*group::ini_file()); } void spline::set_bundle(bundle b) diff --git a/spline-widget/spline.hpp b/spline-widget/spline.hpp index 4f6531b9..5b0b3afc 100644 --- a/spline-widget/spline.hpp +++ b/spline-widget/spline.hpp @@ -70,6 +70,7 @@ private: public: void reload(); + void save(QSettings& s); void save(); void set_bundle(bundle b); -- cgit v1.2.3