theme: make config_theme_path_default_get() private
This commit is contained in:
parent
2e266906f0
commit
09cd15a1e0
|
@ -1024,8 +1024,7 @@ elm_main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
elm_theme_overlay_add(NULL,
|
elm_theme_overlay_add(NULL, theme_path_get("default"));
|
||||||
config_theme_path_default_get(instance.config));
|
|
||||||
elm_theme_overlay_add(NULL, config_theme_path_get(instance.config));
|
elm_theme_overlay_add(NULL, config_theme_path_get(instance.config));
|
||||||
|
|
||||||
if ((!single) && (instance.config->multi_instance))
|
if ((!single) && (instance.config->multi_instance))
|
||||||
|
|
|
@ -2286,8 +2286,7 @@ _block_edje_activate(Evas_Object *obj, Termblock *blk)
|
||||||
else if (!strcmp(blk->path, "THEME"))
|
else if (!strcmp(blk->path, "THEME"))
|
||||||
{
|
{
|
||||||
ok = edje_object_file_set(blk->obj,
|
ok = edje_object_file_set(blk->obj,
|
||||||
config_theme_path_default_get
|
config_theme_path_get(sd->config),
|
||||||
(sd->config),
|
|
||||||
blk->link);
|
blk->link);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -16,13 +16,14 @@ theme_path_get(const char *name)
|
||||||
static char path1[PATH_MAX] = "";
|
static char path1[PATH_MAX] = "";
|
||||||
static char path2[PATH_MAX] = "";
|
static char path2[PATH_MAX] = "";
|
||||||
|
|
||||||
/* use the newer file */
|
/* use the file from home if available */
|
||||||
struct stat s2;
|
struct stat s2;
|
||||||
|
|
||||||
snprintf(path2, sizeof(path2) - 1, "%s/terminology/themes/%s",
|
snprintf(path2, sizeof(path2) - 1, "%s/terminology/themes/%s",
|
||||||
efreet_config_home_get(), name);
|
efreet_config_home_get(), name);
|
||||||
|
|
||||||
if (stat(path2, &s2) == 0) return path2;
|
if (stat(path2, &s2) == 0)
|
||||||
|
return path2;
|
||||||
snprintf(path1, sizeof(path1) - 1, "%s/themes/%s",
|
snprintf(path1, sizeof(path1) - 1, "%s/themes/%s",
|
||||||
elm_app_data_dir_get(), name);
|
elm_app_data_dir_get(), name);
|
||||||
return path1;
|
return path1;
|
||||||
|
@ -40,14 +41,11 @@ config_theme_path_get(const Config *config)
|
||||||
return theme_path_get(config->theme);
|
return theme_path_get(config->theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
static const char *
|
||||||
config_theme_path_default_get(const Config *config)
|
_theme_path_default_get(void)
|
||||||
{
|
{
|
||||||
static char path[PATH_MAX] = "";
|
static char path[PATH_MAX] = "";
|
||||||
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(config, NULL);
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(config->theme, NULL);
|
|
||||||
|
|
||||||
if (path[0]) return path;
|
if (path[0]) return path;
|
||||||
|
|
||||||
snprintf(path, sizeof(path), "%s/themes/default.edj",
|
snprintf(path, sizeof(path), "%s/themes/default.edj",
|
||||||
|
@ -76,7 +74,7 @@ theme_apply(Evas_Object *edje, const Config *config, const char *group)
|
||||||
config_theme_path_get(config), group, errmsg);
|
config_theme_path_get(config), group, errmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (edje_object_file_set(edje, config_theme_path_default_get(config), group))
|
if (edje_object_file_set(edje, _theme_path_default_get(), group))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
errmsg = edje_load_error_str(edje_object_load_error_get(edje));
|
errmsg = edje_load_error_str(edje_object_load_error_get(edje));
|
||||||
|
@ -112,7 +110,7 @@ theme_apply_elm(Evas_Object *layout, const Config *config, const char *group)
|
||||||
INF(_("Could not find theme: file=%s group=%s error='%s', trying default theme"),
|
INF(_("Could not find theme: file=%s group=%s error='%s', trying default theme"),
|
||||||
config_theme_path_get(config), group, errmsg);
|
config_theme_path_get(config), group, errmsg);
|
||||||
|
|
||||||
if (elm_layout_file_set(layout, config_theme_path_default_get(config), group))
|
if (elm_layout_file_set(layout, _theme_path_default_get(), group))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
errmsg = edje_load_error_str(edje_object_load_error_get(edje));
|
errmsg = edje_load_error_str(edje_object_load_error_get(edje));
|
||||||
|
@ -133,7 +131,7 @@ theme_apply_default(Evas_Object *edje, const Config *config, const char *group)
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(config, EINA_FALSE);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(config, EINA_FALSE);
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(group, EINA_FALSE);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(group, EINA_FALSE);
|
||||||
|
|
||||||
if (edje_object_file_set(edje, config_theme_path_default_get(config), group))
|
if (edje_object_file_set(edje, _theme_path_default_get(), group))
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
||||||
errmsg = edje_load_error_str(edje_object_load_error_get(edje));
|
errmsg = edje_load_error_str(edje_object_load_error_get(edje));
|
||||||
|
|
Loading…
Reference in New Issue