'set as wallpaper': simpler and faster.

* allow path and dev to be handled by eina_stringshare_replace() and
   thus if they were the last reference, we do not remove from share
   to add them again.

 * just call save queue and set as wallpaper if something actually changed.




SVN revision: 44525
This commit is contained in:
Gustavo Sverzut Barbieri 2009-12-17 21:49:18 +00:00
parent b36699e97c
commit 79e6a724e7
1 changed files with 7 additions and 13 deletions

View File

@ -168,22 +168,16 @@ void
e_int_config_wallpaper_handler_set(Evas_Object *obj, const char *path, void *data) e_int_config_wallpaper_handler_set(Evas_Object *obj, const char *path, void *data)
{ {
const char *dev, *fpath; const char *dev, *fpath;
Eina_Bool r1, r2;
if (!path) return; if (!path) return;
e_fm2_path_get(obj, &dev, &fpath); e_fm2_path_get(obj, &dev, &fpath);
if (e_config->wallpaper_import_last_dev)
{ r1 = eina_stringshare_replace(&e_config->wallpaper_import_last_dev, dev);
eina_stringshare_del(e_config->wallpaper_import_last_dev); r2 = eina_stringshare_replace(&e_config->wallpaper_import_last_path, fpath);
e_config->wallpaper_import_last_dev = NULL;
} if ((!r1) && (!r2)) return;
if (dev)
e_config->wallpaper_import_last_dev = eina_stringshare_add(dev);
if (e_config->wallpaper_import_last_path) {
eina_stringshare_del(e_config->wallpaper_import_last_path);
e_config->wallpaper_import_last_path = NULL;
}
if (fpath)
e_config->wallpaper_import_last_path = eina_stringshare_add(fpath);
e_config_save_queue(); e_config_save_queue();
e_int_config_wallpaper_import(NULL, path); e_int_config_wallpaper_import(NULL, path);