Skip to content

Commit e9ad4dd

Browse files
committed
Hacky fix to color profiles not saving unless you load the settings panel.
1 parent 792912a commit e9ad4dd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

SerialPrograms/Source/NintendoSwitch/Controllers/NintendoSwitch_ControllerSettings.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#include <chrono>
88
#include "Common/CRC32.h"
99
#include "CommonFramework/Logging/Logger.h"
10+
//#include "CommonFramework/PersistentSettings.h"
11+
#include "CommonFramework/Panels/PanelTools.h"
12+
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1013
#include "NintendoSwitch_ControllerSettings.h"
1114

1215
//#include <iostream>
@@ -478,6 +481,12 @@ ControllerProfile ControllerSettingsTable::get_or_make_profile(
478481
row->set_profile(profile);
479482

480483
this->append_row(std::move(row));
484+
// PERSISTENT_SETTINGS().write();
485+
486+
// This is brutal (tech-debt). The only way to force the settings to save
487+
// is to load the panel. TODO: Redesign panels to allow external editing.
488+
// This is also coming in from a different thread (not the main Qt thread).
489+
PanelDescriptorWrapper<ConsoleSettings_Descriptor, ConsoleSettingsPanel>().make_panel()->save_settings();
481490

482491
return profile;
483492
}

0 commit comments

Comments
 (0)