Settings upgrade logic, classic for old installs
authorShane Synan <digitalcircuit36939@gmail.com>
Mon, 27 Jun 2016 23:54:21 +0000 (19:54 -0400)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 6 Sep 2016 20:14:48 +0000 (22:14 +0200)
commitd2ac8f78a0e050d2efa397c434b249d6b3391576
treedc0f821c8aa43e5b01eba9794538a75791a804dc
parentb7cf37ec77eccfde8e515c6638ef8d996c71019f
Settings upgrade logic, classic for old installs

Add "VersionMinor" to Settings for backwards/forwards-compatible
changes.  Existing installs without this setting are distinguished by
checking if other settings keys exist.

Add upgrade logic to QtUiApplication to preserve previous settings
when changing defaults.  This avoids unwanted surprises if someone
likes the defaults, doesn't save them, then upgrades their client.
Otherwise, Qt would only save settings when changed.

(Core currently does not need version-compatible settings migration
 logic, but it can be added in the future if needed.)

Add a method to settings to check if a key exists, used when checking
if a non-default value was chosen.

Upgrading settings to version 2 will preserve Quassel's UI for those
with the classic look, but new installs default to modern style.  In
the future, this can be used to implement any other default changes.
src/common/settings.cpp
src/common/settings.h
src/qtui/qtuiapplication.cpp
src/qtui/qtuiapplication.h
src/uisupport/uisettings.h