prefs_logging.c \
prefs_matcher.c \
prefs_message.c \
+ prefs_migration.c \
prefs_msg_colors.c \
prefs_other.c \
prefs_quote.c \
prefs_logging.h \
prefs_matcher.h \
prefs_message.h \
+ prefs_migration.h \
prefs_msg_colors.h \
prefs_other.h \
prefs_quote.h \
#include "prefs_fonts.h"
#include "prefs_image_viewer.h"
#include "prefs_message.h"
+#include "prefs_migration.h"
#include "prefs_receive.h"
#include "prefs_msg_colors.h"
#include "prefs_quote.h"
g_slist_free(plug_list);
}
+ prefs_update_config_version();
+
if (never_ran) {
prefs_common_write_config();
plugin_load_standard_plugins ();
*/
static PrefParam param[] = {
+ {"config_version", "0",
+ &prefs_common.config_version, P_INT, NULL, NULL, NULL},
+
/* Receive */
{"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL,
NULL, NULL, NULL},
#include "prefs_msg_colors.h"
#include "prefs_summary_open.h"
+#define CLAWS_CONFIG_VERSION 0
+
typedef struct _PrefsCommon PrefsCommon;
typedef enum {
struct _PrefsCommon
{
+ gint config_version;
+
/* Receive */
gboolean use_extinc;
gchar *extinc_cmd;
--- /dev/null
+/*
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2016 the Claws Mail team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#include "claws-features.h"
+#endif
+
+#include "prefs_common.h"
+
+static void _update_config(gint version)
+{
+ switch (version) {
+ case 0:
+ default:
+ break;
+ }
+}
+
+void prefs_update_config_version()
+{
+ gint ver = prefs_common_get_prefs()->config_version;
+
+ debug_print("Starting config update at config_version %d.\n", ver);
+ if (ver == CLAWS_CONFIG_VERSION) {
+ debug_print("No update necessary, already at latest config_version.\n");
+ return;
+ }
+
+ while (ver < CLAWS_CONFIG_VERSION) {
+ _update_config(ver++);
+ prefs_common_get_prefs()->config_version = ver;
+ }
+
+ debug_print("Config update done.\n");
+}
--- /dev/null
+/*
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2016 the Claws Mail team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef __PREFS_MIGRATION_H__
+#define __PREFS_MIGRATION_H__
+
+void prefs_update_config_version();
+
+#endif /* __PREFS_MIGRATION_H__ */