1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Move url/avatar commands from logging to exectuables section

c56d530b67 by peetah moves:
urlopen.cmd from the 'logging' to a new 'executables' section in profrc
avatar.cmd from the 'logging' to a new 'executables' section in profrc

We need to adapt this so that users don't have to set the setting again
themselves.
This commit is contained in:
Michael Vetter 2020-07-01 15:29:57 +02:00
parent 2b5160a351
commit ec7e635e75

View File

@ -161,6 +161,20 @@ static void _prefs_load(void)
}
}
// 0.9.0 introduced /urlopen. It was saved under "logging" section. Now we have a new "executables" section.
if (g_key_file_has_key(prefs, PREF_GROUP_LOGGING, "urlopen.cmd", NULL)) {
char *value = g_key_file_get_string(prefs, PREF_GROUP_LOGGING, "urlopen.cmd", NULL);
g_key_file_set_string(prefs, PREF_GROUP_EXECUTABLES, "url.open.cmd", value);
g_key_file_remove_key(prefs, PREF_GROUP_LOGGING, "urlopen.cmd", NULL);
}
// 0.9.0 introduced configurable /avatar. It was saved under "logging" section. Now we have a new "executables" section.
if (g_key_file_has_key(prefs, PREF_GROUP_LOGGING, "avatar.cmd", NULL)) {
char *value = g_key_file_get_string(prefs, PREF_GROUP_LOGGING, "avatar.cmd", NULL);
g_key_file_set_string(prefs, PREF_GROUP_EXECUTABLES, "avatar.cmd", value);
g_key_file_remove_key(prefs, PREF_GROUP_LOGGING, "avatar.cmd", NULL);
}
_save_prefs();
boolean_choice_ac = autocomplete_new();