about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-07-01 15:29:57 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-07-01 15:29:57 +0200
commitec7e635e752bdfef851fd177596c1d73d97afb42 (patch)
treee253fec7c9d2126814bde17116fb33499e830b53 /src/config
parent2b5160a35130b2575f1a322f44bc366b6e9dac0f (diff)
downloadprofani-tty-ec7e635e752bdfef851fd177596c1d73d97afb42.tar.gz
Move url/avatar commands from logging to exectuables section
c56d530b67d09267eb46cba029217e4b84b32cef 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.
Diffstat (limited to 'src/config')
-rw-r--r--src/config/preferences.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c
index 9d3b8e30..721ead46 100644
--- a/src/config/preferences.c
+++ b/src/config/preferences.c
@@ -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();