forked from enlightenment/enlightenment
hokay, last commit made bg_file_get leak, so now let's simplify and clean it up
SVN revision: 81621
This commit is contained in:
parent
32c5b6e9fd
commit
8cd8b27f96
|
@ -156,7 +156,17 @@ e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y)
|
|||
/* fall back to default */
|
||||
if (cfbg)
|
||||
{
|
||||
const char *bf;
|
||||
|
||||
bgfile = eina_stringshare_ref(cfbg->file);
|
||||
if (!bgfile) return NULL;
|
||||
if (bgfile[0] == '/') return bgfile;
|
||||
bf = e_path_find(path_backgrounds, bgfile);
|
||||
if (!bf) return bgfile;
|
||||
eina_stringshare_del(bgfile);
|
||||
return bf;
|
||||
}
|
||||
bgfile = e_config->desktop_default_background;
|
||||
if (bgfile)
|
||||
{
|
||||
if (bgfile[0] != '/')
|
||||
|
@ -164,24 +174,10 @@ e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y)
|
|||
const char *bf;
|
||||
|
||||
bf = e_path_find(path_backgrounds, bgfile);
|
||||
if (bf)
|
||||
eina_stringshare_replace(&bgfile, bf);
|
||||
}
|
||||
}
|
||||
if (bf) bgfile = bf;
|
||||
}
|
||||
else
|
||||
{
|
||||
bgfile = eina_stringshare_ref(e_config->desktop_default_background);
|
||||
if (bgfile)
|
||||
{
|
||||
if (bgfile[0] != '/')
|
||||
{
|
||||
const char *bf;
|
||||
|
||||
bf = e_path_find(path_backgrounds, bgfile);
|
||||
if (bf)
|
||||
eina_stringshare_replace(&bgfile, bf);
|
||||
}
|
||||
eina_stringshare_ref(bgfile);
|
||||
}
|
||||
if (bgfile && eina_str_has_extension(bgfile, ".edj"))
|
||||
{
|
||||
|
@ -192,7 +188,6 @@ e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y)
|
|||
if (!ok)
|
||||
eina_stringshare_replace(&bgfile, e_theme_edje_file_get("base/theme/background",
|
||||
"e/desktop/background"));
|
||||
}
|
||||
|
||||
return bgfile;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue