Enlightenment CVS committal

Author  : englebass
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fm.c 


Log Message:
Clean up error handling.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.c,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -3 -r1.137 -r1.138
--- e_fm.c      25 Mar 2007 13:13:34 -0000      1.137
+++ e_fm.c      25 Mar 2007 14:12:50 -0000      1.138
@@ -2509,32 +2509,27 @@
    snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file);
 
    desktop = efreet_desktop_get(buf);
-   if (desktop)
+   if (!desktop) goto error;
+   if (desktop->type != EFREET_DESKTOP_TYPE_LINK) goto error;
+
+   if (desktop->name)         ic->info.label   = 
evas_stringshare_add(desktop->name);
+   if (desktop->generic_name) ic->info.generic = 
evas_stringshare_add(desktop->generic_name);
+   if (desktop->comment)      ic->info.comment = 
evas_stringshare_add(desktop->comment);
+   if (desktop->icon) ic->info.icon = evas_stringshare_add(desktop->icon);
+   if (desktop->url)
+     ic->info.link = _e_fm2_icon_desktop_url_eval(desktop->url);
+   if (desktop->x)
      {
-       if (desktop->name)         ic->info.label   = 
evas_stringshare_add(desktop->name);
-       if (desktop->generic_name) ic->info.generic = 
evas_stringshare_add(desktop->generic_name);
-       if (desktop->comment)      ic->info.comment = 
evas_stringshare_add(desktop->comment);
-       
-       if (desktop->icon) ic->info.icon = evas_stringshare_add(desktop->icon);
+       const char *type;
 
-       if (desktop->type == EFREET_DESKTOP_TYPE_LINK)
+       type = ecore_hash_get(desktop->x, "X-Enlightenment-Type");
+       if (type)
          {
-            if (desktop->url)
-              ic->info.link = _e_fm2_icon_desktop_url_eval(desktop->url);
-            if (desktop->x)
-              {
-                 const char *type;
-                 
-                 type = ecore_hash_get(desktop->x, "X-Enlightenment-Type");
-                 if (type)
-                   {
-                      if (!strcmp(type, "Mount")) ic->info.mount = 1;
-                      else if (!strcmp(type, "Removable")) ic->info.removable 
= 1;
-                   }
-              }
+            if (!strcmp(type, "Mount")) ic->info.mount = 1;
+            else if (!strcmp(type, "Removable")) ic->info.removable = 1;
          }
      }
-   
+ 
    return 1;
    error:
    if (ic->info.label) evas_stringshare_del(ic->info.label);



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to