From 8916293a26e7a79e3bf969aac9895b2678946deb Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 29 Mar 2012 12:08:45 +0200 Subject: 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 --- src/config.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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. */ -- cgit v1.2.3-70-g09d2