#include "prefs_common.h"
#include "alertpanel.h"
-extern gint _password_store_config_version;
-
static gint starting_config_version = 0;
gboolean _version_check(gint ver)
return 1;
}
-int prefs_update_config_version_password_store()
+int prefs_update_config_version_password_store(gint from_version)
{
- gint ver;
+ gint ver = from_version;
- if (_password_store_config_version == -1) {
+ if (ver == -1) {
/* There was no config_version stored in the config, let's assume
* config_version same as clawsrc started at, to avoid breaking
* the configuration by "upgrading" it unnecessarily. */
debug_print("Password store: config_version not saved, using one from clawsrc: %d\n", starting_config_version);
- _password_store_config_version = starting_config_version;
+ ver = starting_config_version;
}
- ver = _password_store_config_version;
-
debug_print("Starting config update at config_version %d.\n", ver);
if (!_version_check(ver))
while (ver < CLAWS_CONFIG_VERSION) {
_update_config_password_store(ver++);
- _password_store_config_version = ver;
}
debug_print("Config update done.\n");