[Commits] [wesnoth/wesnoth] 798a99: Avoid polluting preferences file with null command...

GitHub noreply at github.com
Sun Feb 28 02:35:35 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 798a99b27a86e5c15c6cd21d35e5b3f44332bf7a
      https://github.com/wesnoth/wesnoth/commit/798a99b27a86e5c15c6cd21d35e5b3f44332bf7a
  Author: Wedge009 <wedge009 at wedge009.net>
  Date:   2016-02-27 (Sat, 27 Feb 2016)

  Changed paths:
    M src/hotkey/hotkey_item.cpp

  Log Message:
  -----------
  Avoid polluting preferences file with null commands (Bug #21969)

Only save non-default hot-keys to the preferences file if the hot-key is active (ie command != 'null').

Clearing hot-keys in memory (via the hot-key functions in the game) only sets the command to 'null', which currently gets written to the preferences file if it is a custom, ie non-default, hot-key. Over time, creating and clearing hot-keys results in a lot of redundant hot-key entries. The nice thing about this update is that it will remove redundant command='null' entries for existing preferences files as well as prevent it from being included in future ones..

I am making this change against the sdl2 branch instead of master because the sdl2 branch already contains a lot of rewriting of the hot-key functionality. Testing against master was also hopeless because hot-key handling is still rather broken building against SDL 1.2.


  Commit: 389285e5803a21e62c8a345578a1219201490b79
      https://github.com/wesnoth/wesnoth/commit/389285e5803a21e62c8a345578a1219201490b79
  Author: Wedge009 <wedge009 at wedge009.net>
  Date:   2016-02-27 (Sat, 27 Feb 2016)

  Changed paths:
    M src/hotkey/command_executor.cpp
    M src/hotkey/hotkey_item.cpp
    M src/hotkey/hotkey_item.hpp

  Log Message:
  -----------
  Add disabled flag to allow clearing of default hot-keys (Bugs #21983/#22218/#23981)

The original design of using a "null" command to indicate a disabled hot-key is ambiguous with regards to when to save a user hot-key to preferences as well as when a default hot-key should be flagged as disabled. So introduce a separate disabled flag to resolve the ambiguity.
Where the disabled flag is set to true, the hot-key should not be written to preferences unless it is a default hot-key.


  Commit: 807d78a0b18d75ec5cdb3c3fd8b37288ad4a69be
      https://github.com/wesnoth/wesnoth/commit/807d78a0b18d75ec5cdb3c3fd8b37288ad4a69be
  Author: Wedge009 <wedge009 at wedge009.net>
  Date:   2016-02-27 (Sat, 27 Feb 2016)

  Changed paths:
    M changelog

  Log Message:
  -----------
  Update change log.


  Commit: a3f6abfc85a750927b8e484f4bd1d64364584af6
      https://github.com/wesnoth/wesnoth/commit/a3f6abfc85a750927b8e484f4bd1d64364584af6
  Author: Andreas <andreas at alternating.net>
  Date:   2016-02-28 (Sun, 28 Feb 2016)

  Changed paths:
    M changelog
    M src/hotkey/command_executor.cpp
    M src/hotkey/hotkey_item.cpp
    M src/hotkey/hotkey_item.hpp

  Log Message:
  -----------
  Merge pull request #564 from Wedge009/bug_21969_fix

Resolve preferences file polluted with null-command hot-keys (Bug #21969)


Compare: https://github.com/wesnoth/wesnoth/compare/1e7abb4615cf...a3f6abfc85a7


More information about the Commits mailing list