Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/efreet

Dir     : e17/libs/efreet/src/lib


Modified Files:
        efreet_desktop.c 


Log Message:


makes efreet more forgiving of bad .desktops. we spew out a warning though.

===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_desktop.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- efreet_desktop.c    4 Nov 2007 12:29:36 -0000       1.29
+++ efreet_desktop.c    16 Nov 2007 02:35:01 -0000      1.30
@@ -1244,6 +1244,13 @@
 
         p = strchr(p, '%');
     }
+   /* NON-SPEC!!! this is to work around LOTS of 'broken' .desktop files that
+    * do not specify %U/%u, %F/F etc. etc. at all. just a command. this is
+    * unlikely to be fixed in distributions etc. in the long run as gnome/kde
+    * seem to have workarounds too so no one notices.
+    */
+   if (!flags) flags |= EFREET_DESKTOP_EXEC_FLAG_FULLPATH;
+   
     return flags;
 }
 
@@ -1285,6 +1292,7 @@
     Ecore_List *execs;
     char *exec;
 
+   printf("efreet_desktop_command_build()\n");
     execs = ecore_list_new();
 
     ecore_list_first_goto(command->files);
@@ -1373,6 +1381,32 @@
             p++;
         }
 
+       /* NON-SPEC!!! this is to work around LOTS of 'broken' .desktop files 
that
+       * do not specify %U/%u, %F/F etc. etc. at all. just a command. this is
+       * unlikely to be fixed in distributions etc. in the long run as 
gnome/kde
+       * seem to have workarounds too so no one notices.
+       */
+       if ((file) && (!file_added))
+        {
+           printf("EFREET WARNING:\n"
+                  "  %s\n"
+                  "command:\n"
+                  "  %s\n"
+                  "has no file path/uri spec info for executing this app WITH 
a\n"
+                  "file/uri as a parameter. This is unlikely to be the 
intent.\n"
+                  "please check the .desktop file and fix it by adding a %%U 
or %%F\n"
+                  "or something.",
+                  command->desktop->orig_path, command->desktop->exec);
+            if (len >= size - 1)
+             {
+                size = len + 1024;
+                exec = realloc(exec, size);
+             }
+           exec[len++] = ' ';
+           exec = efreet_desktop_command_append_multiple(exec, &size,
+                                                         &len, command, 'F');
+           file_added = 1;
+        }
         exec[len++] = '\0';
 
         ecore_list_append(execs, exec);



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to