diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index 4bdfdfa..0fd6542 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -27,7 +27,7 @@ MainWindow::MainWindow(QUrl ws_url, QWidget *parent) continue; } auto widget = loaded_ui(m_web_socket.get(), this); - m_sims.insert(std::make_pair(widget->sim_name(), widget)); + m_sims.insert(std::make_pair(widget->name(), widget)); lib.unload(); } // Insert debug sims here diff --git a/client/simulator_base.cpp b/client/simulator_base.cpp index 10deb60..870f217 100644 --- a/client/simulator_base.cpp +++ b/client/simulator_base.cpp @@ -7,13 +7,13 @@ #include "web_socket_wrapper.hpp" #include -Simulator_base::Simulator_base(QString sim_name, Web_socket_wrapper *web_socket, QWidget *parent) +Simulator_base::Simulator_base(QString name, Web_socket_wrapper *web_socket, QWidget *parent) : QMainWindow{parent}, m_error_dialog(new NetworkError(this)), m_timer_update(new QTimer()), - m_web_socket(web_socket), m_sim_name(sim_name) + m_web_socket(web_socket), m_name(name) { - if (windowTitle() != m_sim_name) + if (windowTitle() != m_name) { - setWindowTitle(m_sim_name); + setWindowTitle(m_name); } m_error_dialog->set_error("Connection timed out\nCheck if the server is running"); m_ui_lookup.reserve(40); @@ -24,9 +24,9 @@ QWidget *Simulator_base::id_to_ui(size_t id) return m_ui_lookup.at(id); } -QString Simulator_base::sim_name() const +QString Simulator_base::name() const { - return m_sim_name; + return m_name; } void Simulator_base::showEvent(QShowEvent *event) diff --git a/client/simulator_base.hpp b/client/simulator_base.hpp index 8814f4e..360d8cf 100644 --- a/client/simulator_base.hpp +++ b/client/simulator_base.hpp @@ -24,9 +24,9 @@ class Simulator_base : public QMainWindow { Q_OBJECT public: - explicit Simulator_base(QString sim_name, Web_socket_wrapper *api, QWidget *parent = nullptr); + explicit Simulator_base(QString name, Web_socket_wrapper *api, QWidget *parent = nullptr); void sim_update(void); - QString sim_name() const; + QString name() const; QWidget *id_to_ui(size_t id); virtual QLabel *id_to_label(size_t name) { @@ -77,7 +77,7 @@ class Simulator_base : public QMainWindow private: Web_socket_wrapper *m_web_socket; - QString m_sim_name; + QString m_name; QTimer *m_timer_update; uint32_t m_refresh_rate;