aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-03-29 12:08:45 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-03-29 12:14:44 +0200
commit8916293a26e7a79e3bf969aac9895b2678946deb (patch)
tree17290bacbbf4b7ab4b0a58d16989a283a7ceabd9
parent573cccb77879f3ec8741e2f72a119af00ee0a578 (diff)
downloadcalcurse-8916293a26e7a79e3bf969aac9895b2678946deb.tar.gz
calcurse-8916293a26e7a79e3bf969aac9895b2678946deb.zip
src/config.c: Detect legacy configuration files
Check configuration variable names against a list of pre-3.0.0 configuration keys and display a warning if such a variable is found. This reduces the chance of users going wild due to the non-backwards compatible configuration file changes. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r--src/config.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index b6dd036..0e6acb1 100644
--- a/src/config.c
+++ b/src/config.c
@@ -479,6 +479,33 @@ config_file_walk (config_fn_walk_cb_t fn_cb,
value++;
}
+ if (strcmp(key, "auto_save") == 0 ||
+ strcmp(key, "auto_gc") == 0 ||
+ strcmp(key, "periodic_save") == 0 ||
+ strcmp(key, "confirm_quit") == 0 ||
+ strcmp(key, "confirm_delete") == 0 ||
+ strcmp(key, "skip_system_dialogs") == 0 ||
+ strcmp(key, "skip_progress_bar") == 0 ||
+ strcmp(key, "calendar_default_view") == 0 ||
+ strcmp(key, "week_begins_on_monday") == 0 ||
+ strcmp(key, "color-theme") == 0 ||
+ strcmp(key, "layout") == 0 ||
+ strcmp(key, "side-bar_width") == 0 ||
+ strcmp(key, "notify-bar_show") == 0 ||
+ strcmp(key, "notify-bar_date") == 0 ||
+ strcmp(key, "notify-bar_clock") == 0 ||
+ strcmp(key, "notify-bar_warning") == 0 ||
+ strcmp(key, "notify-bar_command") == 0 ||
+ strcmp(key, "notify-all") == 0 ||
+ strcmp(key, "output_datefmt") == 0 ||
+ strcmp(key, "input_datefmt") == 0 ||
+ strcmp(key, "notify-daemon_enable") == 0 ||
+ strcmp(key, "notify-daemon_log") == 0)
+ {
+ WARN_MSG (_("Pre-3.0.0 configuration file format detected, "
+ "please upgrade running `calcurse-upgrade`."));
+ }
+
if (value && (*value == '\0' || *value == '\n'))
{
/* Backward compatibility mode. */