From f5662b59896917512f0d4e5f1e853ba6c6b20d38 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 3 Feb 2019 12:12:35 +0100 Subject: opentrack: fix profile list storage The authoritative source for profile names is now a vector rather than a user interface element. Add some sanity checks to `main_window::set_profile'. Remove the `config_listed' abomination. --- variant/default/main-window.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'variant/default/main-window.hpp') diff --git a/variant/default/main-window.hpp b/variant/default/main-window.hpp index e6b2ed2e..49dda590 100644 --- a/variant/default/main-window.hpp +++ b/variant/default/main-window.hpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -64,6 +65,8 @@ class main_window final : public QMainWindow, private State process_detector_worker det; QMenu profile_menu; + QList profile_list; + QAction menu_action_header { &tray_menu }, menu_action_show { &tray_menu }, menu_action_exit { &tray_menu }, @@ -118,8 +121,7 @@ class main_window final : public QMainWindow, private State void set_profile(const QString& new_name, bool migrate = true); void set_profile_in_registry(const QString& profile); - void refresh_config_list(); - bool config_listed(const QString& name); + void refresh_profile_list(); void die_on_config_not_writable(); void maybe_start_profile_from_executable(); [[nodiscard]] static bool get_new_config_name_from_dialog(QString &ret); -- cgit v1.2.3