diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 06:11:48 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 07:49:13 +0100 |
commit | 07b45ca4578ccaed91f7f3c70e82dc7ffbdf47ab (patch) | |
tree | 0904b728158414937919f62714358725f52e7400 /spline/axis-opts.hpp | |
parent | 1e04979c3452d4eac633677876a88f9411a1153d (diff) |
spline: fix deadlock, logic error
Tracking rarely deadlocked when saving mappings.
Investigating it further also shown how a wrong bundle was used for
Accela's splines.
Diffstat (limited to 'spline/axis-opts.hpp')
-rw-r--r-- | spline/axis-opts.hpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/spline/axis-opts.hpp b/spline/axis-opts.hpp index b4475502..c773dd61 100644 --- a/spline/axis-opts.hpp +++ b/spline/axis-opts.hpp @@ -9,8 +9,14 @@ namespace axis_opts_impl { using namespace options; -struct OTR_SPLINE_EXPORT axis_opts final +class OTR_SPLINE_EXPORT axis_opts final { + QString prefix_; + Axis axis_; + + static inline QString n(QString const& pfx, QString const& name); + +public: enum max_clamp { r180 = 180, @@ -37,8 +43,8 @@ struct OTR_SPLINE_EXPORT axis_opts final }; // note, these two bundles can be the same value with no issues - bundle b_settings_window = make_bundle("opentrack-ui"); - bundle b_mapping_window = make_bundle("opentrack-mappings"); + bundle b_settings_window{ make_bundle(axis_ == Axis(-1) ? QString() : "opentrack-ui") }; + bundle b_mapping_window{ make_bundle(axis_ == Axis(-1) ? QString() : "opentrack-mappings") }; value<double> zero; value<int> src; value<bool> invert, altp; @@ -49,11 +55,6 @@ struct OTR_SPLINE_EXPORT axis_opts final QString const& prefix() const; Axis axis() const; -private: - static inline QString n(QString const& pfx, QString const& name); - - QString prefix_; - Axis axis_; }; } // ns axis_opts_impl |