From 7fb5503e41f6c20ae1889de9e223f35b9cd90caf Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Thu, 31 Dec 2020 00:07:48 +0100 Subject: [PATCH] Pretty-print serialized mappings. --- src/common/PJoystickHandler.cxx | 2 +- src/common/PKeyboardHandler.cxx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/PJoystickHandler.cxx b/src/common/PJoystickHandler.cxx index 174bb405f..2d4484259 100644 --- a/src/common/PJoystickHandler.cxx +++ b/src/common/PJoystickHandler.cxx @@ -596,7 +596,7 @@ void PhysicalJoystickHandler::saveMapping() if (!map.is_null()) mapping.emplace_back(map); } - myOSystem.settings().setValue("joymap", mapping.dump()); + myOSystem.settings().setValue("joymap", mapping.dump(2)); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/common/PKeyboardHandler.cxx b/src/common/PKeyboardHandler.cxx index 5032afd66..df7fdf6a0 100644 --- a/src/common/PKeyboardHandler.cxx +++ b/src/common/PKeyboardHandler.cxx @@ -377,11 +377,11 @@ void PhysicalKeyboardHandler::eraseMapping(Event::Type event, EventMode mode) void PhysicalKeyboardHandler::saveMapping() { myOSystem.settings().setValue("event_ver", Event::VERSION); - myOSystem.settings().setValue("keymap_emu", myKeyMap.saveMapping(EventMode::kCommonMode).dump()); - myOSystem.settings().setValue("keymap_joy", myKeyMap.saveMapping(EventMode::kJoystickMode).dump()); - myOSystem.settings().setValue("keymap_pad", myKeyMap.saveMapping(EventMode::kPaddlesMode).dump()); - myOSystem.settings().setValue("keymap_key", myKeyMap.saveMapping(EventMode::kKeypadMode).dump()); - myOSystem.settings().setValue("keymap_ui", myKeyMap.saveMapping(EventMode::kMenuMode).dump()); + myOSystem.settings().setValue("keymap_emu", myKeyMap.saveMapping(EventMode::kCommonMode).dump(2)); + myOSystem.settings().setValue("keymap_joy", myKeyMap.saveMapping(EventMode::kJoystickMode).dump(2)); + myOSystem.settings().setValue("keymap_pad", myKeyMap.saveMapping(EventMode::kPaddlesMode).dump(2)); + myOSystem.settings().setValue("keymap_key", myKeyMap.saveMapping(EventMode::kKeypadMode).dump(2)); + myOSystem.settings().setValue("keymap_ui", myKeyMap.saveMapping(EventMode::kMenuMode).dump(2)); enableEmulationMappings(); }