diff options
Diffstat (limited to 'compat/options.cpp')
-rw-r--r-- | compat/options.cpp | 23 |
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) { } |