summaryrefslogtreecommitdiff
path: root/src/bin/e_bg.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-21 23:06:11 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-21 23:06:11 +0000
commit8cd8b27f96abea8627a815787d3bb10273bc6d96 (patch)
tree921b0538e74ad4321bfaab857bd5a841afee4e10 /src/bin/e_bg.c
parent32c5b6e9fd7b4c84be61f01e26613521a49f4f67 (diff)
hokay, last commit made bg_file_get leak, so now let's simplify and clean it up
SVN revision: 81621
Diffstat (limited to 'src/bin/e_bg.c')
-rw-r--r--src/bin/e_bg.c55
1 files changed, 25 insertions, 30 deletions
diff --git a/src/bin/e_bg.c b/src/bin/e_bg.c
index 5bbd2a5..e0ccf4a 100644
--- a/src/bin/e_bg.c
+++ b/src/bin/e_bg.c
@@ -156,43 +156,38 @@ e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y)
156 /* fall back to default */ 156 /* fall back to default */
157 if (cfbg) 157 if (cfbg)
158 { 158 {
159 bgfile = eina_stringshare_ref(cfbg->file); 159 const char *bf;
160 if (bgfile)
161 {
162 if (bgfile[0] != '/')
163 {
164 const char *bf;
165 160
166 bf = e_path_find(path_backgrounds, bgfile); 161 bgfile = eina_stringshare_ref(cfbg->file);
167 if (bf) 162 if (!bgfile) return NULL;
168 eina_stringshare_replace(&bgfile, bf); 163 if (bgfile[0] == '/') return bgfile;
169 } 164 bf = e_path_find(path_backgrounds, bgfile);
170 } 165 if (!bf) return bgfile;
166 eina_stringshare_del(bgfile);
167 return bf;
171 } 168 }
172 else 169 bgfile = e_config->desktop_default_background;
170 if (bgfile)
173 { 171 {
174 bgfile = eina_stringshare_ref(e_config->desktop_default_background); 172 if (bgfile[0] != '/')
175 if (bgfile)
176 { 173 {
177 if (bgfile[0] != '/') 174 const char *bf;
178 {
179 const char *bf;
180 175
181 bf = e_path_find(path_backgrounds, bgfile); 176 bf = e_path_find(path_backgrounds, bgfile);
182 if (bf) 177 if (bf) bgfile = bf;
183 eina_stringshare_replace(&bgfile, bf);
184 }
185 }
186 if (bgfile && eina_str_has_extension(bgfile, ".edj"))
187 {
188 ok = edje_file_group_exists(bgfile, "e/desktop/background");
189 } 178 }
190 else if ((bgfile) && (bgfile[0])) 179 else
191 ok = 1; 180 eina_stringshare_ref(bgfile);
192 if (!ok) 181 }
193 eina_stringshare_replace(&bgfile, e_theme_edje_file_get("base/theme/background", 182 if (bgfile && eina_str_has_extension(bgfile, ".edj"))
194 "e/desktop/background")); 183 {
184 ok = edje_file_group_exists(bgfile, "e/desktop/background");
195 } 185 }
186 else if ((bgfile) && (bgfile[0]))
187 ok = 1;
188 if (!ok)
189 eina_stringshare_replace(&bgfile, e_theme_edje_file_get("base/theme/background",
190 "e/desktop/background"));
196 191
197 return bgfile; 192 return bgfile;
198} 193}