summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-10-22 19:56:20 +0100
committerAndy Williams <andy@andywilliams.me>2017-10-22 19:56:20 +0100
commite5cf2632530b52785a735dfbd87e04e7ec062cbc (patch)
tree2d0100d692c838c1180b2abfc75d995105527959
parent86e6ed85ca4f33a773f7c28551dc188b5b8aa311 (diff)
config: Mark EFL and Efler as installed - we know they are :)
This means if we come from an old version or a bootstrap the probable version installed is in our initial config.
-rw-r--r--src/lib/efler.c2
-rw-r--r--src/lib/efler_config.c24
2 files changed, 25 insertions, 1 deletions
diff --git a/src/lib/efler.c b/src/lib/efler.c
index 45f094c..7d76080 100644
--- a/src/lib/efler.c
+++ b/src/lib/efler.c
@@ -50,7 +50,6 @@ efler_init(void)
50 EINA_LOG_ERR("efler can not create its log domain."); 50 EINA_LOG_ERR("efler can not create its log domain.");
51 goto shutdown_eina; 51 goto shutdown_eina;
52 } 52 }
53 _efler_config_init();
54 53
55 _efler_apps_add("efl", "EFL", "v1.20.4", "core/efl", "autogen", 54 _efler_apps_add("efl", "EFL", "v1.20.4", "core/efl", "autogen",
56 "The EFL package - good to keep this up to date first :)"); 55 "The EFL package - good to keep this up to date first :)");
@@ -84,6 +83,7 @@ efler_init(void)
84 _efler_apps_add("terminology", "Terminology", "v1.1.1", "apps/terminology", "autogen", 83 _efler_apps_add("terminology", "Terminology", "v1.1.1", "apps/terminology", "autogen",
85 "The EFL terminal app - full of bling and smoothness"); 84 "The EFL terminal app - full of bling and smoothness");
86 85
86 _efler_config_init();
87 eina_log_timing(_efler_lib_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT); 87 eina_log_timing(_efler_lib_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT);
88 88
89 return _efler_init; 89 return _efler_init;
diff --git a/src/lib/efler_config.c b/src/lib/efler_config.c
index f2289a1..a40273c 100644
--- a/src/lib/efler_config.c
+++ b/src/lib/efler_config.c
@@ -138,6 +138,26 @@ _efler_config_domain_save(const char *dir, const char *domain, Eet_Data_Descript
138 return EINA_FALSE; 138 return EINA_FALSE;
139} 139}
140 140
141/**
142 * Ensure that the current version of the app is marked as installed
143 *
144 * @param id the ID of an app that we should mark as installed, if it exists
145 */
146static void
147_efler_config_ensure(const char *id)
148{
149 Efler_App *app;
150
151 app = efler_app_get(id);
152 if (!app)
153 return;
154
155 if (_efler_config_app_installed_get(app))
156 return;
157
158 _efler_config_app_installed_version_set(app);
159}
160
141/* external functions */ 161/* external functions */
142Eina_Bool 162Eina_Bool
143_efler_config_init(void) 163_efler_config_init(void)
@@ -164,6 +184,10 @@ _efler_config_init(void)
164 184
165 _efler_config_load(); 185 _efler_config_load();
166 186
187 // we obviously have EFL and efler installed, let's get a sensible config
188 _efler_config_ensure("efl");
189 _efler_config_ensure("efler");
190
167 return EINA_TRUE; 191 return EINA_TRUE;
168} 192}
169 193