diff options
-rw-r--r-- | qfunctionconfigurator/functionconfig.cpp | 20 | ||||
-rw-r--r-- | qfunctionconfigurator/functionconfig.h | 5 |
2 files changed, 9 insertions, 16 deletions
diff --git a/qfunctionconfigurator/functionconfig.cpp b/qfunctionconfigurator/functionconfig.cpp index f2e81b17..b93a4cbf 100644 --- a/qfunctionconfigurator/functionconfig.cpp +++ b/qfunctionconfigurator/functionconfig.cpp @@ -19,18 +19,12 @@ Map::Map() : _mutex(QMutex::Recursive), activep(false), max_x(0), - max_y(0), - lazy_reload(true) + max_y(0) { } float Map::getValue(float x) { QMutexLocker foo(&_mutex); - if (lazy_reload) - { - lazy_reload = false; - reload(); - } float q = x * precision(); int xi = (int)q; float yi = getValueInternal(xi); @@ -151,14 +145,14 @@ void Map::removePoint(int i) { if (i >= 0 && i < cur.input.size()) { cur.input.removeAt(i); - lazy_reload = true; + reload(); } } void Map::addPoint(QPointF pt) { QMutexLocker foo(&_mutex); cur.input.append(pt); - lazy_reload = true; + reload(); qStableSort(cur.input.begin(), cur.input.end(), sortFn); } @@ -167,8 +161,8 @@ void Map::movePoint(int idx, QPointF pt) { if (idx >= 0 && idx < cur.input.size()) { cur.input[idx] = pt; - lazy_reload = true; - // we don't allow points to be reodered, so no sort here + reload(); + // we don't allow points to be reordered, so no sort here } } @@ -181,7 +175,7 @@ void Map::invalidate_unsaved_settings() { QMutexLocker foo(&_mutex); cur = saved; - lazy_reload = true; + reload(); } void Map::loadSettings(QSettings& settings, const QString& title) { @@ -210,7 +204,7 @@ void Map::loadSettings(QSettings& settings, const QString& title) { points.append(QPointF(maxInput(), maxOutput())); cur.input = points; - lazy_reload = true; + reload(); saved = cur; } diff --git a/qfunctionconfigurator/functionconfig.h b/qfunctionconfigurator/functionconfig.h index 25e072d2..31aebdf6 100644 --- a/qfunctionconfigurator/functionconfig.h +++ b/qfunctionconfigurator/functionconfig.h @@ -37,7 +37,6 @@ private: double max_y; State cur, saved; - bool lazy_reload; public: double maxInput() const { return max_x; } double maxOutput() const { return max_y; } @@ -46,7 +45,7 @@ public: { setMaxInput(maxx); setMaxOutput(maxy); - lazy_reload = true; + reload(); } float getValue(float x); @@ -55,7 +54,7 @@ public: void removeAllPoints() { QMutexLocker foo(&_mutex); cur.input.clear(); - lazy_reload = true; + reload(); } void addPoint(QPointF pt); |