summaryrefslogtreecommitdiffhomepage
path: root/options/bundle.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-16 17:39:15 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-16 17:54:12 +0200
commitaf8d6f769c26d4d260d6fc430165b51aebbd0733 (patch)
tree2129d44b18bc919b339d7bfd9de9da6b3c921669 /options/bundle.cpp
parenta781170550b4354e0f5551e0b20560d84e4108ce (diff)
gui/main-window: exit program when config not writable
Note, it opens the config in read-write mode to check if it's writable. This might present a race condition when config is saved. However, we're expecting all config saving to be done in the user interface thread. Add a check for it however.
Diffstat (limited to 'options/bundle.cpp')
-rw-r--r--options/bundle.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/options/bundle.cpp b/options/bundle.cpp
index e4c0ffbd..482e46d1 100644
--- a/options/bundle.cpp
+++ b/options/bundle.cpp
@@ -1,6 +1,9 @@
#include "bundle.hpp"
#include "value.hpp"
+#include <QThread>
+#include <QApplication>
+
using options::base_value;
namespace options
@@ -58,6 +61,9 @@ bool bundle::contains(const QString &name) const
void bundle::save_deferred(QSettings& s)
{
+ if (QThread::currentThread() != qApp->thread())
+ qCritical() << "group::save - current thread not ui thread";
+
if (group_name.size() == 0)
return;