mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-30 20:56:22 +00:00
Migrate old time display format settings
This commit is contained in:
@@ -103,6 +103,28 @@ prefs_load(void)
|
|||||||
g_error_free(err);
|
g_error_free(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// migrate pre 0.4.7 time settings format
|
||||||
|
if (g_key_file_has_key(prefs, PREF_GROUP_UI, "time", NULL)) {
|
||||||
|
char *time = g_key_file_get_string(prefs, PREF_GROUP_UI, "time", NULL);
|
||||||
|
if (g_strcmp0(time, "minutes") == 0) {
|
||||||
|
g_key_file_set_string(prefs, PREF_GROUP_UI, "time", "%H:%M");
|
||||||
|
} else if (g_strcmp0(time, "seconds") == 0) {
|
||||||
|
g_key_file_set_string(prefs, PREF_GROUP_UI, "time", "%H:%M:%S");
|
||||||
|
} else if (g_strcmp0(time, "off") == 0) {
|
||||||
|
g_key_file_set_string(prefs, PREF_GROUP_UI, "time", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (g_key_file_has_key(prefs, PREF_GROUP_UI, "time.statusbar", NULL)) {
|
||||||
|
char *time = g_key_file_get_string(prefs, PREF_GROUP_UI, "time.statusbar", NULL);
|
||||||
|
if (g_strcmp0(time, "minutes") == 0) {
|
||||||
|
g_key_file_set_string(prefs, PREF_GROUP_UI, "time.statusbar", "%H:%M");
|
||||||
|
} else if (g_strcmp0(time, "seconds") == 0) {
|
||||||
|
g_key_file_set_string(prefs, PREF_GROUP_UI, "time.statusbar", "%H:%M:%S");
|
||||||
|
} else if (g_strcmp0(time, "off") == 0) {
|
||||||
|
g_key_file_set_string(prefs, PREF_GROUP_UI, "time.statusbar", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_save_prefs();
|
_save_prefs();
|
||||||
|
|
||||||
boolean_choice_ac = autocomplete_new();
|
boolean_choice_ac = autocomplete_new();
|
||||||
|
|||||||
Reference in New Issue
Block a user