summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-01-05 21:45:31 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-01-05 21:45:31 +0100
commit3272306484ee358ee00c1926d88439814e7276bc (patch)
treee6c0e053a3c255859576d2ebd116174d60c23b7e
parent7b81b27f70cb5169bbd61de7cc6628dac5620cc8 (diff)
remove needless settings reload in dialogs
Options handling was fixed to pass the same bundle to all consumers. There's no need to reload it explicitly anymore.
-rw-r--r--ftnoir_protocol_fg/ftnoir_protocol_fg.cpp5
-rw-r--r--ftnoir_protocol_fg/ftnoir_protocol_fg.h10
-rw-r--r--ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp4
-rw-r--r--ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp5
-rw-r--r--ftnoir_protocol_mouse/ftnoir_protocol_mouse.h10
-rw-r--r--ftnoir_protocol_mouse/ftnoir_protocol_mouse_dialog.cpp4
-rw-r--r--ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp2
-rw-r--r--ftnoir_tracker_aruco/ftnoir_tracker_aruco.h1
8 files changed, 6 insertions, 35 deletions
diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp
index b3243f628..85dd46848 100644
--- a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp
+++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp
@@ -30,11 +30,6 @@
// For Todd and Arda Kutlu
-void FTNoIR_Protocol::reloadSettings()
-{
- s.b->reload();
-}
-
void FTNoIR_Protocol::pose(const double* headpose) {
FlightData.x = headpose[TX] * 1e-2;
FlightData.y = headpose[TY] * 1e-2;
diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.h b/ftnoir_protocol_fg/ftnoir_protocol_fg.h
index d35b9fbdd..36768fd57 100644
--- a/ftnoir_protocol_fg/ftnoir_protocol_fg.h
+++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.h
@@ -57,7 +57,6 @@ public:
QString game_name() {
return "FlightGear";
}
- void reloadSettings();
private:
settings s;
TFlightGearData FlightData;
@@ -70,15 +69,10 @@ class FGControls: public IProtocolDialog
Q_OBJECT
public:
FGControls();
- void register_protocol(IProtocol *protocol) {
- theProtocol = (FTNoIR_Protocol *) protocol; // Accept the pointer to the Protocol
- }
- void unregister_protocol() {
- theProtocol = NULL; // Reset the pointer
- }
+ void register_protocol(IProtocol *) {}
+ void unregister_protocol() {}
private:
Ui::UICFGControls ui;
- FTNoIR_Protocol *theProtocol;
settings s;
private slots:
void doOK();
diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp
index 041e99614..d15c94669 100644
--- a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp
+++ b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp
@@ -37,7 +37,7 @@
//
// Constructor for server-settings-dialog
//
-FGControls::FGControls() : theProtocol(nullptr)
+FGControls::FGControls()
{
ui.setupUi( this );
@@ -54,8 +54,6 @@ FGControls::FGControls() : theProtocol(nullptr)
void FGControls::doOK() {
s.b->save();
this->close();
- if (theProtocol)
- theProtocol->reloadSettings();
}
void FGControls::doCancel() {
diff --git a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp
index ac5438122..5e30fca26 100644
--- a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp
+++ b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp
@@ -53,11 +53,6 @@ void FTNoIR_Protocol::pose(const double *headpose ) {
}
}
-void FTNoIR_Protocol::reload()
-{
- s.b->reload();
-}
-
bool FTNoIR_Protocol::correct()
{
return true;
diff --git a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h
index 3d04fa15f..fcc7426ad 100644
--- a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h
+++ b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h
@@ -65,7 +65,6 @@ public:
QString game_name() {
return "Mouse tracker";
}
- void reload();
private:
struct settings s;
};
@@ -75,16 +74,11 @@ class MOUSEControls: public IProtocolDialog
Q_OBJECT
public:
MOUSEControls();
- void register_protocol(IProtocol *protocol) {
- _proto = (FTNoIR_Protocol *) protocol;
- }
- void unregister_protocol() {
- _proto = NULL;
- }
+ void register_protocol(IProtocol *) {}
+ void unregister_protocol() {}
private:
Ui::UICMOUSEControls ui;
settings s;
- FTNoIR_Protocol* _proto;
private slots:
void doOK();
void doCancel();
diff --git a/ftnoir_protocol_mouse/ftnoir_protocol_mouse_dialog.cpp b/ftnoir_protocol_mouse/ftnoir_protocol_mouse_dialog.cpp
index 3303e54c4..f4ecaa483 100644
--- a/ftnoir_protocol_mouse/ftnoir_protocol_mouse_dialog.cpp
+++ b/ftnoir_protocol_mouse/ftnoir_protocol_mouse_dialog.cpp
@@ -25,7 +25,7 @@
#include "ftnoir_protocol_mouse.h"
#include "opentrack/plugin-api.hpp"
-MOUSEControls::MOUSEControls() : _proto(nullptr)
+MOUSEControls::MOUSEControls()
{
ui.setupUi( this );
ui.cbxSelectMouse_X->addItem("None");
@@ -53,8 +53,6 @@ MOUSEControls::MOUSEControls() : _proto(nullptr)
void MOUSEControls::doOK() {
s.b->save();
- if (_proto)
- _proto->reload();
this->close();
}
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
index 47ab96285..27d835f02 100644
--- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
+++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
@@ -492,8 +492,6 @@ void TrackerControls::update_tracker_calibration()
void TrackerControls::doOK()
{
s.b->save();
- if (tracker)
- tracker->reload();
this->close();
}
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h
index ad1391457..ad10f04a8 100644
--- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h
+++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h
@@ -50,7 +50,6 @@ public:
void start_tracker(QFrame* frame);
void data(double *data);
void run();
- void reload() { s.b->reload(); }
void getRT(cv::Matx33d &r, cv::Vec3d &t);
private:
QMutex mtx;