use eina str has extension.

SVN revision: 62343
This commit is contained in:
Carsten Haitzler 2011-08-11 11:07:12 +00:00
parent 28d6049319
commit cc3c3bf07c
2 changed files with 3 additions and 10 deletions

View File

@ -118,7 +118,6 @@ e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y)
EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg) EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
{ {
int spec; int spec;
const char *ext;
if (!cfbg) continue; if (!cfbg) continue;
spec = 0; spec = 0;
@ -143,8 +142,7 @@ e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y)
if (bf) bgfile = bf; if (bf) bgfile = bf;
} }
} }
ext = strrchr(bgfile, '.'); if (eina_str_has_extension(bgfile, ".edj"))
if ((ext) && (!strcasecmp(ext, ".edj")))
{ {
entries = edje_file_collection_list(bgfile); entries = edje_file_collection_list(bgfile);
if (entries) if (entries)
@ -198,8 +196,6 @@ e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y)
} }
else else
{ {
const char *ext;
bgfile = e_config->desktop_default_background; bgfile = e_config->desktop_default_background;
if (bgfile) if (bgfile)
{ {
@ -211,8 +207,7 @@ e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y)
if (bf) bgfile = bf; if (bf) bgfile = bf;
} }
} }
ext = strrchr(bgfile, '.'); if (eina_str_has_extension(bgfile, ".edj"))
if ((ext) && (!strcasecmp(ext, ".edj")))
{ {
entries = edje_file_collection_list(bgfile); entries = edje_file_collection_list(bgfile);
if (entries) if (entries)

View File

@ -114,9 +114,7 @@ _bg_set(E_Config_Dialog_Data *cfdata)
if (!cfdata->o_preview) return; if (!cfdata->o_preview) return;
if (cfdata->bg) if (cfdata->bg)
{ {
const char *ext = strrchr(cfdata->bg, '.'); if (eina_str_has_extension(cfdata->bg, ".edj"))
if ((ext) && (!strcasecmp(ext, ".edj")))
e_widget_preview_edje_set(cfdata->o_preview, cfdata->bg, e_widget_preview_edje_set(cfdata->o_preview, cfdata->bg,
"e/desktop/background"); "e/desktop/background");
else else