summaryrefslogtreecommitdiffhomepage
path: root/options/bundle.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-12-20 18:23:14 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-12-24 19:31:24 +0100
commite81df263f4123a39fe6d4d50fb21f47dd242e796 (patch)
tree4b8cd13da31ac3fb3a2d2695b65595d7c5570439 /options/bundle.cpp
parent2613beb8028ecac53548d311b27ff38559763f6c (diff)
remove const correctness violations
This is possibly related to a livelock where several threads do const removal in their respective code paths. Use the `mutable' specifier for the mutexes and spline's cached data. Now using the `mutable' specifier, get rid of <optional> in compat/mutex.
Diffstat (limited to 'options/bundle.cpp')
-rw-r--r--options/bundle.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/options/bundle.cpp b/options/bundle.cpp
index 8db4f906..938639b3 100644
--- a/options/bundle.cpp
+++ b/options/bundle.cpp
@@ -20,15 +20,7 @@ using namespace options::globals;
namespace options::detail {
-mutex::mutex(QMutex::RecursionMode mode) : QMutex(mode) {}
-
-mutex::operator QMutex*() const
-{
- return const_cast<QMutex*>(static_cast<const QMutex*>(this));
-}
-
bundle::bundle(const QString& group_name) :
- mtx(QMutex::Recursive),
group_name(group_name),
saved(group_name),
transient(saved)
@@ -82,13 +74,13 @@ void bundle::store_kv(const QString& name, const QVariant& new_value)
QVariant bundle::get_variant(const QString& name) const
{
- QMutexLocker l(mtx);
+ QMutexLocker l(&mtx);
return transient.get_variant(name);
}
bool bundle::contains(const QString &name) const
{
- QMutexLocker l(mtx);
+ QMutexLocker l(&mtx);
return transient.contains(name);
}