Add a sanity check, if there is no group of interest found, then this is

not a .desktop that anybody would be interested in.


SVN revision: 26111
This commit is contained in:
David Walter Seikel 2006-09-24 19:55:06 +00:00
parent 1027e2004c
commit e43d359810
1 changed files with 9 additions and 2 deletions

View File

@ -454,7 +454,14 @@ _ecore_desktop_get(const char *file, const char *lang)
}
}
ecore_hash_set(desktop_cache, strdup(result->original_path), result);
/* Final sanity check. */
if ((result->data) && (!result->group))
{
_ecore_desktop_destroy(result);
result = NULL;
}
else
ecore_hash_set(desktop_cache, strdup(result->original_path), result);
}
error:
@ -489,7 +496,7 @@ ecore_desktop_save(Ecore_Desktop * desktop)
{
if ((desktop->ondisk) && (desktop->original_path))
{
if (!desktop->data) desktop->data = ecore_desktop_ini_get(desktop->original_path);
desktop->data = ecore_desktop_ini_get(desktop->original_path);
desktop->group =
(Ecore_Hash *) ecore_hash_get(desktop->data, "Desktop Entry");
if (!desktop->group)