X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtuiapplication.cpp;h=b77d0af25a0dd52d056da29c68d04e7bd19bd9fd;hp=6777a567672e6ae8e97f3e4a5a2c6d211e8ae75a;hb=27fe4e6f46547c45d19fa39c175fa2104a5feb28;hpb=a113f73e5f8ce89c3df5c42d55528404fc7a2294 diff --git a/src/qtui/qtuiapplication.cpp b/src/qtui/qtuiapplication.cpp index 6777a567..b77d0af2 100644 --- a/src/qtui/qtuiapplication.cpp +++ b/src/qtui/qtuiapplication.cpp @@ -210,7 +210,7 @@ bool QtUiApplication::migrateSettings() // -------- // Check minor settings version, handling upgrades/downgrades as needed // Current minor version - const uint VERSION_MINOR_CURRENT = 2; + const uint VERSION_MINOR_CURRENT = 4; // Stored minor version uint versionMinor = s.versionMinor(); @@ -269,12 +269,54 @@ bool QtUiApplication::applySettingsMigration(QtUiSettings settings, const uint n // oldest version. Ignore those, start from 2 and higher. // Each missed version will be called in sequence. E.g. to upgrade from '1' to '3', this // function will be called with '2', then '3'. - case 2: + // Use explicit scope via { ... } to avoid cross-initialization + // + // In most cases, the goal is to preserve the older default values for keys that haven't been + // saved. Exceptions will be noted below. + case 4: + { + // New default changes: system locale used to generate a timestamp format string, deciding + // 24-hour or 12-hour timestamp. + + // -------- + // ChatView settings + const QString useCustomTimestampFormatId = "ChatView/__default__/UseCustomTimestampFormat"; + if (!settings.valueExists(useCustomTimestampFormatId)) { + // New default value is false, preserve previous behavior by setting to true + settings.setValue(useCustomTimestampFormatId, true); + } + // -------- + + // Migration complete! + return true; + } + case 3: { - // Use explicit scope via { ... } to avoid cross-initialization + // New default changes: per-chat history and line wrapping enabled by default. + // -------- + // InputWidget settings + UiSettings settingsInputWidget("InputWidget"); + const QString enableInputPerChatId = "EnablePerChatHistory"; + if (!settingsInputWidget.valueExists(enableInputPerChatId)) { + // New default value is true, preserve previous behavior by setting to false + settingsInputWidget.setValue(enableInputPerChatId, false); + } + + const QString enableInputLinewrap = "EnableLineWrap"; + if (!settingsInputWidget.valueExists(enableInputLinewrap)) { + // New default value is true, preserve previous behavior by setting to false + settingsInputWidget.setValue(enableInputLinewrap, false); + } + // -------- + + // Migration complete! + return true; + } + case 2: + { // New default changes: sender brackets disabled, sender colors and sender CTCP - // colors enabled. Preserve the older default values for keys that haven't been saved. + // colors enabled. // -------- // ChatView settings