summaryrefslogtreecommitdiffhomepage
path: root/compat/options.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-08-15 15:30:53 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-08-16 00:03:40 +0200
commit7f840a7bfd4d89c2f31464922beee9331de81a08 (patch)
treeb21ace6bf6a193a5114a8c04d39e4643b55683f9 /compat/options.cpp
parent558491c9ee7262b4f84e192b0627194a39e884dc (diff)
compat/options: add option to reload all bundles
Diffstat (limited to 'compat/options.cpp')
-rw-r--r--compat/options.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/compat/options.cpp b/compat/options.cpp
index 8c6e6c65..9ff696ac 100644
--- a/compat/options.cpp
+++ b/compat/options.cpp
@@ -204,6 +204,29 @@ void opt_singleton::bundle_decf(const opt_singleton::k& key)
}
}
+void opt_singleton::after_profile_changed_()
+{
+ QMutexLocker l(&implsgl_mtx);
+
+ for (auto& kv : implsgl_data)
+ {
+ tt& tuple = kv.second;
+ std::weak_ptr<v>& bundle = std::get<1>(tuple);
+
+ mem<v> bundle_ = bundle.lock();
+ if (bundle_)
+ {
+ qDebug() << "bundle: reverting" << kv.first << "due to profile change";
+ bundle_->reload();
+ }
+ }
+}
+
+void opt_singleton::refresh_all_bundles()
+{
+ singleton().after_profile_changed_();
+}
+
opt_singleton::opt_singleton() : implsgl_mtx(QMutex::Recursive)
{
}