Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_desktop


Modified Files:
        Ecore_Desktop.h ecore_desktop_menu.c 


Log Message:
Figure out where the directory icon info is and pass it along.

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_desktop/Ecore_Desktop.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- Ecore_Desktop.h     13 Oct 2006 23:25:43 -0000      1.39
+++ Ecore_Desktop.h     14 Oct 2006 04:14:28 -0000      1.40
@@ -225,7 +225,7 @@
 
    EAPI void          
       ecore_desktop_menu_for_each(void (*func)
-                                 (char *name, char *path, Ecore_Hash * apps));
+                                 (char *name, char *path, char *directory, 
Ecore_Hash * apps));
    Ecore_Desktop_Tree *ecore_desktop_menu_get(char *file);
 
    Ecore_Desktop_Tree *ecore_desktop_tree_new(char *buffer);
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_desktop/ecore_desktop_menu.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- ecore_desktop_menu.c        26 Sep 2006 10:13:52 -0000      1.28
+++ ecore_desktop_menu.c        14 Oct 2006 04:14:28 -0000      1.29
@@ -119,7 +119,7 @@
 
 EAPI void
 ecore_desktop_menu_for_each(void (*func)
-                           (char *name, char *path, Ecore_Hash * apps))
+                           (char *name, char *path, char *directory, 
Ecore_Hash * apps))
 {
    char               *menu_file;
 
@@ -162,24 +162,48 @@
      {
        if (strncmp((char *)tree->elements[element].element, "<MENU ", 6) == 0)
          {
+            int                 len;
             char               *path;
             char               *name;
+            char               *directory;
             Ecore_Hash         *apps;
-            void                (*func) (char *name, char *path,
+            void                (*func) (char *name, char *path, char 
*directory,
                                          Ecore_Hash * apps);
 
             func = data;
             name = (char *)tree->elements[element].element;
+            directory = name;
+            directory += 8;
+            path = strchr(directory, '<');
+            path++;
+            directory = strchr(path, '<');
+            directory++;
+            len = strlen(directory);
+            if (len > 2)
+              {
+                 path = strdup(directory);
+                 if (path)
+                   {
+                      path[len - 1] = '\0';
+                       /* FIXME: Figure out what to do if it's just 
".directory". */
+                      directory = 
ecore_desktop_paths_file_find(ecore_desktop_paths_directories, path, 0, NULL, 
NULL);
+                      free(path);
+                   }
+                 else
+                    directory = NULL;
+              }
+            else
+               directory = NULL;
             path = (char *)tree->elements[element + 1].element;
-#ifdef DEBUG
-            printf("MAKING MENU - %s \t\t%s\n", path, name);
-#endif
 //             pool = (Ecore_Hash *) tree->elements[element + 2].element;
             apps = (Ecore_Hash *) tree->elements[element + 4].element;
             path = &path[11];
-
+#ifdef DEBUG
+            printf("OUTPUTTING MENU - %s \t\t%s \t\t%s\n", path, name, 
directory);
+#endif
             if (func)
-               func(name, path, apps);
+               func(name, path, directory, apps);
+            free(directory);
          }
      }
    return 0;
@@ -296,8 +320,8 @@
                                             &data);
 
 #ifdef DEBUG
-                 ecore_desktop_tree_dump(menu_xml, 0);
-                 printf("\n\n");
+//               ecore_desktop_tree_dump(menu_xml, 0);
+//               printf("\n\n");
 #endif
               }
          }
@@ -871,9 +895,9 @@
        sprintf(temp, "%s%s", legacy_data->prefix, file);
        ecore_hash_set(pool, strdup(temp), strdup(path));
 #ifdef DEBUG
-       printf
-          ("POOLING - _ecore_desktop_menu_legacy_menu(void *data, %s) - %s - 
%s\n",
-           path, file, temp);
+//     printf
+//        ("POOLING - _ecore_desktop_menu_legacy_menu(void *data, %s) - %s - 
%s\n",
+//         path, file, temp);
 #endif
        if (rules->size > 0)
          {
@@ -1077,9 +1101,9 @@
                        file[i] = '-';
                  ecore_hash_set(our_data->pool, file, strdup(path));
 #ifdef DEBUG
-                 printf
-                    ("POOLING - _ecore_desktop_menu_check_app(void *data, %s) 
- %s\n",
-                     path, file);
+//               printf
+//                  ("POOLING - _ecore_desktop_menu_check_app(void *data, %s) 
- %s\n",
+//                   path, file);
 #endif
               }
          }
@@ -1551,7 +1575,7 @@
    key = (char *)node->key;
    app = (char *)node->value;
 #ifdef DEBUG
-   printf("CHECKING %s - %s\n", app, key);
+//   printf("CHECKING %s - %s\n", app, key);
 #endif
    if (!ecore_hash_get(pool, key))
       ecore_hash_set(pool, strdup(key), strdup(app));
@@ -1586,9 +1610,9 @@
               {
                  ecore_hash_set(generate_data->apps, key, strdup(app));
 #ifdef DEBUG
-                 printf("INCLUDING %s%s - %s\n",
-                        ((generate_data->unallocated) ? "UNALLOCATED " : ""),
-                        app, key);
+//               printf("INCLUDING %s%s - %s\n",
+//                      ((generate_data->unallocated) ? "UNALLOCATED " : ""),
+//                      app, key);
 #endif
               }
             else



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to