diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-21 22:22:51 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-23 00:05:15 +0200 |
commit | 321501ad58dad2688bde42992b61adcda5a313e0 (patch) | |
tree | 5024dea40ea91dedf379ae2a7f06fe069a6d3e9d /options/bundle.cpp | |
parent | e425135768da9c18199ebe58e93a5b245db5ee79 (diff) |
options/bundle: simplify mutex const-dropping
Diffstat (limited to 'options/bundle.cpp')
-rw-r--r-- | options/bundle.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/options/bundle.cpp b/options/bundle.cpp index 644fe4c6..aa7d0ea8 100644 --- a/options/bundle.cpp +++ b/options/bundle.cpp @@ -49,7 +49,7 @@ void bundle::store_kv(const QString& name, const QVariant& datum) bool bundle::contains(const QString &name) const { - QMutexLocker l(const_cast<QMutex*>(&mtx)); + QMutexLocker l(mtx); return transient.contains(name); } @@ -80,9 +80,9 @@ void bundle::save() save_deferred(*group::ini_file()); } -bool bundle::modifiedp() const // XXX unused +bool bundle::is_modified() const // XXX unused { - QMutexLocker l(const_cast<QMutex*>(&mtx)); + QMutexLocker l(mtx); return transient != saved; } @@ -155,11 +155,9 @@ OPENTRACK_OPTIONS_EXPORT bundler& singleton() return ret; } -} - -// end options::detail +} // end options::detail -OPENTRACK_OPTIONS_EXPORT bundle make_bundle(const QString& name) +OPENTRACK_OPTIONS_EXPORT std::shared_ptr<bundle_type> make_bundle(const QString& name) { if (name.size()) return detail::singleton().make_bundle(name); @@ -167,5 +165,6 @@ OPENTRACK_OPTIONS_EXPORT bundle make_bundle(const QString& name) return std::make_shared<bundle_type>(QStringLiteral("")); } -} // end options +QMutex* options::detail::bundle::get_mtx() const { return mtx; } +} // end options |