forked from enlightenment/enlightenment
use module version check util function instead of copying the same code everywhere
SVN revision: 75849
This commit is contained in:
parent
b011625092
commit
f6914dfb6e
|
@ -27,7 +27,6 @@ static void _cb_action_conf(void *data, Evas_Object *obj, const char
|
||||||
|
|
||||||
static void _conf_new(void);
|
static void _conf_new(void);
|
||||||
static void _conf_free(void);
|
static void _conf_free(void);
|
||||||
static Eina_Bool _conf_timer(void *data);
|
|
||||||
|
|
||||||
static E_Module *conf_module = NULL;
|
static E_Module *conf_module = NULL;
|
||||||
static E_Action *act = NULL;
|
static E_Action *act = NULL;
|
||||||
|
@ -295,38 +294,8 @@ e_modapi_init(E_Module *m)
|
||||||
conf = e_config_domain_load("module.conf", conf_edd);
|
conf = e_config_domain_load("module.conf", conf_edd);
|
||||||
if (conf)
|
if (conf)
|
||||||
{
|
{
|
||||||
if ((conf->version >> 16) < MOD_CONFIG_FILE_EPOCH)
|
if (!e_util_module_config_check("Configuration Panel", conf->version, MOD_CONFIG_FILE_VERSION))
|
||||||
{
|
|
||||||
_conf_free();
|
_conf_free();
|
||||||
ecore_timer_add(1.0, _conf_timer,
|
|
||||||
_("Configuration Panel Module Configuration data needed "
|
|
||||||
"upgrading. Your old configuration<br> has been"
|
|
||||||
" wiped and a new set of defaults initialized. "
|
|
||||||
"This<br>will happen regularly during "
|
|
||||||
"development, so don't report a<br>bug. "
|
|
||||||
"This simply means the module needs "
|
|
||||||
"new configuration<br>data by default for "
|
|
||||||
"usable functionality that your old<br>"
|
|
||||||
"configuration simply lacks. This new set of "
|
|
||||||
"defaults will fix<br>that by adding it in. "
|
|
||||||
"You can re-configure things now to your<br>"
|
|
||||||
"liking. Sorry for the inconvenience.<br>"));
|
|
||||||
}
|
|
||||||
else if (conf->version > MOD_CONFIG_FILE_VERSION)
|
|
||||||
{
|
|
||||||
_conf_free();
|
|
||||||
ecore_timer_add(1.0, _conf_timer,
|
|
||||||
_("Your Configuration Panel Module configuration is NEWER "
|
|
||||||
"than the module version. This is "
|
|
||||||
"very<br>strange. This should not happen unless"
|
|
||||||
" you downgraded<br>the module or "
|
|
||||||
"copied the configuration from a place where"
|
|
||||||
"<br>a newer version of the module "
|
|
||||||
"was running. This is bad and<br>as a "
|
|
||||||
"precaution your configuration has been now "
|
|
||||||
"restored to<br>defaults. Sorry for the "
|
|
||||||
"inconvenience.<br>"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!conf) _conf_new();
|
if (!conf) _conf_new();
|
||||||
|
@ -510,12 +479,3 @@ _conf_free(void)
|
||||||
{
|
{
|
||||||
E_FREE(conf);
|
E_FREE(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
|
||||||
_conf_timer(__UNUSED__ void *data)
|
|
||||||
{
|
|
||||||
e_util_dialog_show(_("Configuration Panel Configuration Updated"),
|
|
||||||
"%s", (char *)data);
|
|
||||||
return ECORE_CALLBACK_CANCEL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ static void _e_mod_menu_add(void *data,
|
||||||
E_Menu *m);
|
E_Menu *m);
|
||||||
static void _e_mod_fileman_config_load(void);
|
static void _e_mod_fileman_config_load(void);
|
||||||
static void _e_mod_fileman_config_free(void);
|
static void _e_mod_fileman_config_free(void);
|
||||||
static Eina_Bool _e_mod_cb_config_timer(void *data);
|
|
||||||
static Eina_Bool _e_mod_zone_add(void *data,
|
static Eina_Bool _e_mod_zone_add(void *data,
|
||||||
int type,
|
int type,
|
||||||
void *event);
|
void *event);
|
||||||
|
@ -703,30 +702,8 @@ _e_mod_fileman_config_load(void)
|
||||||
fileman_config = e_config_domain_load("module.fileman", conf_edd);
|
fileman_config = e_config_domain_load("module.fileman", conf_edd);
|
||||||
if (fileman_config)
|
if (fileman_config)
|
||||||
{
|
{
|
||||||
if ((fileman_config->config_version >> 16) < MOD_CONFIG_FILE_EPOCH)
|
if (!e_util_module_config_check("Fileman", fileman_config->config_version, MOD_CONFIG_FILE_VERSION))
|
||||||
{
|
|
||||||
_e_mod_fileman_config_free();
|
_e_mod_fileman_config_free();
|
||||||
ecore_timer_add(1.0, _e_mod_cb_config_timer,
|
|
||||||
_("Fileman Module Settings data needed upgrading. Your old configuration<br>"
|
|
||||||
"has been wiped and a new set of defaults initialized. This<br>"
|
|
||||||
"will happen regularly during development, so don't report a<br>"
|
|
||||||
"bug. This simply means Fileman module needs new configuration<br>"
|
|
||||||
"data by default for usable functionality that your old<br>"
|
|
||||||
"configuration simply lacks. This new set of defaults will fix<br>"
|
|
||||||
"that by adding it in. You can re-configure things now to your<br>"
|
|
||||||
"liking. Sorry for the hiccup in your configuration.<br>"));
|
|
||||||
}
|
|
||||||
else if (fileman_config->config_version > MOD_CONFIG_FILE_VERSION)
|
|
||||||
{
|
|
||||||
_e_mod_fileman_config_free();
|
|
||||||
ecore_timer_add(1.0, _e_mod_cb_config_timer,
|
|
||||||
_("Your Fileman Module configuration is NEWER than Fileman Module version. This is very<br>"
|
|
||||||
"strange. This should not happen unless you downgraded<br>"
|
|
||||||
"the Fileman Module or copied the configuration from a place where<br>"
|
|
||||||
"a newer version of the Fileman Module was running. This is bad and<br>"
|
|
||||||
"as a precaution your configuration has been now restored to<br>"
|
|
||||||
"defaults. Sorry for the inconvenience.<br>"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fileman_config)
|
if (!fileman_config)
|
||||||
|
@ -819,13 +796,6 @@ _e_mod_fileman_config_free(void)
|
||||||
E_FREE(fileman_config);
|
E_FREE(fileman_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
|
||||||
_e_mod_cb_config_timer(void *data)
|
|
||||||
{
|
|
||||||
e_util_dialog_show(_("Fileman Settings Updated"), "%s", (char *)data);
|
|
||||||
return ECORE_CALLBACK_CANCEL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_e_mod_zone_add(__UNUSED__ void *data,
|
_e_mod_zone_add(__UNUSED__ void *data,
|
||||||
int type,
|
int type,
|
||||||
|
|
|
@ -14,13 +14,6 @@ EAPI E_Module_Api e_modapi =
|
||||||
"Physics"
|
"Physics"
|
||||||
};
|
};
|
||||||
|
|
||||||
static Eina_Bool
|
|
||||||
_e_mod_cb_config_timer(void *data)
|
|
||||||
{
|
|
||||||
e_util_dialog_show(_("Physics Settings Updated"), "%s", (char *)data);
|
|
||||||
return ECORE_CALLBACK_CANCEL;
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI void *
|
EAPI void *
|
||||||
e_modapi_init(E_Module *m)
|
e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
|
@ -59,30 +52,9 @@ e_modapi_init(E_Module *m)
|
||||||
mod->conf = e_config_domain_load("module.physics", mod->conf_edd);
|
mod->conf = e_config_domain_load("module.physics", mod->conf_edd);
|
||||||
if (mod->conf)
|
if (mod->conf)
|
||||||
{
|
{
|
||||||
if ((mod->conf->config_version >> 16) < MOD_CONFIG_FILE_EPOCH)
|
if (!e_util_module_config_check("Physics", mod->conf->config_version, MOD_CONFIG_FILE_VERSION))
|
||||||
{
|
{
|
||||||
e_mod_cfdata_config_free(mod->conf);
|
e_mod_cfdata_config_free(mod->conf);
|
||||||
ecore_timer_add(1.0, _e_mod_cb_config_timer,
|
|
||||||
_("Physics module settings data needed upgrading. Your old configuration<br>"
|
|
||||||
"has been wiped and a new set of defaults initialized. This<br>"
|
|
||||||
"will happen regularly during development, so don't report a<br>"
|
|
||||||
"bug. This simply means Physics module needs new configuration<br>"
|
|
||||||
"data by default for usable functionality that your old<br>"
|
|
||||||
"configuration simply lacks. This new set of defaults will fix<br>"
|
|
||||||
"that by adding it in. You can re-configure things now to your<br>"
|
|
||||||
"liking. Sorry for the hiccup in your configuration.<br>"));
|
|
||||||
mod->conf = NULL;
|
|
||||||
}
|
|
||||||
else if (mod->conf->config_version > MOD_CONFIG_FILE_VERSION)
|
|
||||||
{
|
|
||||||
e_mod_cfdata_config_free(mod->conf);
|
|
||||||
ecore_timer_add(1.0, _e_mod_cb_config_timer,
|
|
||||||
_("Your Physics module configuration is NEWER than Fileman Module version. This is very<br>"
|
|
||||||
"strange. This should not happen unless you downgraded<br>"
|
|
||||||
"the Physics Module or copied the configuration from a place where<br>"
|
|
||||||
"a newer version of the Physics module was running. This is bad and<br>"
|
|
||||||
"as a precaution your configuration has been now restored to<br>"
|
|
||||||
"defaults. Sorry for the inconvenience.<br>"));
|
|
||||||
mod->conf = NULL;
|
mod->conf = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,13 +25,6 @@ Config *qa_config = NULL;
|
||||||
|
|
||||||
EAPI E_Module_Api e_modapi = {E_MODULE_API_VERSION, "Quickaccess"};
|
EAPI E_Module_Api e_modapi = {E_MODULE_API_VERSION, "Quickaccess"};
|
||||||
|
|
||||||
static Eina_Bool
|
|
||||||
_e_mod_cb_config_timer(void *data)
|
|
||||||
{
|
|
||||||
e_util_dialog_show(_("Quickaccess Settings Updated"), "%s", (char *)data);
|
|
||||||
return ECORE_CALLBACK_CANCEL;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
EAPI void *
|
EAPI void *
|
||||||
e_modapi_init(E_Module *m)
|
e_modapi_init(E_Module *m)
|
||||||
|
@ -51,31 +44,10 @@ e_modapi_init(E_Module *m)
|
||||||
qa_config = e_config_domain_load("module.quickaccess", conf_edd);
|
qa_config = e_config_domain_load("module.quickaccess", conf_edd);
|
||||||
if (qa_config)
|
if (qa_config)
|
||||||
{
|
{
|
||||||
if ((qa_config->config_version >> 16) < MOD_CONFIG_FILE_EPOCH)
|
if (!e_util_module_config_check("Quickaccess", qa_config->config_version, MOD_CONFIG_FILE_VERSION))
|
||||||
{
|
{
|
||||||
e_qa_config_free(qa_config);
|
e_qa_config_free(qa_config);
|
||||||
qa_config = NULL;
|
qa_config = NULL;
|
||||||
ecore_timer_add(1.0, _e_mod_cb_config_timer,
|
|
||||||
_("Quickaccess module settings data needed upgrading. Your old configuration<br>"
|
|
||||||
"has been wiped and a new set of defaults initialized. This<br>"
|
|
||||||
"will happen regularly during development, so don't report a<br>"
|
|
||||||
"bug. This means Quickaccess module needs new configuration<br>"
|
|
||||||
"data by default for usable functionality that your old<br>"
|
|
||||||
"configuration lacked. This new set of defaults will fix<br>"
|
|
||||||
"that by adding it in. You can re-configure things now to your<br>"
|
|
||||||
"liking. Sorry for the hiccup in your configuration.<br>"));
|
|
||||||
}
|
|
||||||
else if (qa_config->config_version > MOD_CONFIG_FILE_VERSION)
|
|
||||||
{
|
|
||||||
e_qa_config_free(qa_config);
|
|
||||||
qa_config = NULL;
|
|
||||||
ecore_timer_add(1.0, _e_mod_cb_config_timer,
|
|
||||||
_("Your Quickaccess module configuration is NEWER than Quickaccess module version. This is very<br>"
|
|
||||||
"strange. This should not happen unless you downgraded<br>"
|
|
||||||
"the Quickaccess Module or copied the configuration from a place where<br>"
|
|
||||||
"a newer version of the Quickaccess Module was running. This is bad and<br>"
|
|
||||||
"as a precaution your configuration has been now restored to<br>"
|
|
||||||
"defaults. Sorry for the inconvenience.<br>"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue