diff --git a/src/bin/main.c b/src/bin/main.c index 276fb58b..0cf4796d 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -207,14 +207,21 @@ elm_main(int argc, char **argv) if (theme) { + char path[PATH_MAX]; + char name[PATH_MAX]; + if (eina_str_has_suffix(theme, ".edj")) - eina_stringshare_replace(&(config->theme), theme); + eina_strlcpy(name, theme, sizeof(name)); else - { - char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), "%s.edj", theme); - eina_stringshare_replace(&(config->theme), buf); - } + snprintf(name, sizeof(name), "%s.edj", theme); + + if (strchr(name, '/')) + eina_strlcpy(path, name, sizeof(path)); + else + snprintf(path, sizeof(path), "%s/themes/%s", + elm_app_data_dir_get(), name); + + eina_stringshare_replace(&(config->theme), path); config_tmp = EINA_TRUE; } @@ -250,15 +257,7 @@ elm_main(int argc, char **argv) bg = o = edje_object_add(evas_object_evas_get(win)); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); - if (strchr(config->theme, '/')) - edje_object_file_set(o, config->theme, "terminology/background"); - else - { - char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), "%s/themes/%s", - elm_app_data_dir_get(), config->theme); - edje_object_file_set(o, buf, "terminology/background"); - } + edje_object_file_set(o, config->theme, "terminology/background"); elm_win_resize_object_add(win, o); evas_object_show(o); diff --git a/src/bin/options_font.c b/src/bin/options_font.c index b2bb6568..42f07c4a 100644 --- a/src/bin/options_font.c +++ b/src/bin/options_font.c @@ -120,12 +120,9 @@ _cb_op_font_content_get(void *data, Evas_Object *obj, const char *part) (!strcmp(part, "elm.swallow.end"))) { Evas_Object *o; - char buf[4096]; - + o = edje_object_add(evas_object_evas_get(obj)); - snprintf(buf, sizeof(buf), "%s/themes/%s", - elm_app_data_dir_get(), config->theme); - edje_object_file_set(o, buf, "terminology/fontpreview"); + edje_object_file_set(o, config->theme, "terminology/fontpreview"); evas_object_size_hint_min_set(o, 40 * elm_config_scale_get(), 40 * elm_config_scale_get()); diff --git a/src/bin/termio.c b/src/bin/termio.c index 32271c5a..25fda4ac 100644 --- a/src/bin/termio.c +++ b/src/bin/termio.c @@ -720,9 +720,7 @@ _smart_add(Evas_Object *obj) evas_object_propagate_events_set(o, EINA_FALSE); evas_object_smart_member_add(o, obj); sd->cur.obj = o; - snprintf(buf, sizeof(buf), "%s/themes/%s", - elm_app_data_dir_get(), config->theme); - edje_object_file_set(o, buf, "terminology/cursor"); + edje_object_file_set(o, config->theme, "terminology/cursor"); evas_object_resize(o, sd->font.chw, sd->font.chh); evas_object_show(o);