01e3d4415f6e462828015d69ff9c1f5d00ae846a
[claws.git] / src / prefs_migration.c
1 /*
2  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2016 the Claws Mail team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  */
19
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #include "claws-features.h"
23 #endif
24
25 #include "prefs_common.h"
26
27 static void _update_config(gint version)
28 {
29         switch (version) {
30                 case 0:
31                 default:
32                         break;
33         }
34 }
35
36 void prefs_update_config_version()
37 {
38         gint ver = prefs_common_get_prefs()->config_version;
39
40         debug_print("Starting config update at config_version %d.\n", ver);
41         if (ver == CLAWS_CONFIG_VERSION) {
42                 debug_print("No update necessary, already at latest config_version.\n");
43                 return;
44         }
45
46         while (ver < CLAWS_CONFIG_VERSION) {
47                 _update_config(ver++);
48                 prefs_common_get_prefs()->config_version = ver;
49         }
50
51         debug_print("Config update done.\n");
52 }