Enlightenment CVS committal

Author  : chaos
Project : e17
Module  : proto

Dir     : e17/proto/entropy/src/plugins


Modified Files:
        filesystem.c thumbnail_system.c 


Log Message:
* Minor api changes
* Test trash menu

===================================================================
RCS file: /cvs/e/e17/proto/entropy/src/plugins/filesystem.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -3 -r1.74 -r1.75
--- filesystem.c        6 Aug 2006 10:01:10 -0000       1.74
+++ filesystem.c        15 Aug 2006 12:04:53 -0000      1.75
@@ -163,16 +163,31 @@
       entropy_gui_component_instance *instance;
       entropy_file_stat *file_stat;
       entropy_file_listener* listener;
+      evfs_filereference* ref;
       char* md5;
+      char *folder, *filename;
+      char* pos;
 
-      char *folder =
-       strdup ((char *) data->resp_command.file_command.files[0]->path);
-      char *pos = rindex (folder, '/');
 
-      *pos = '\0';
+      ref = data->resp_command.file_command.files[0];
+
+      pos = rindex (ref->path, '/');
+      /*Set the file's filename*/
+      filename = strdup (pos + 1);
+       
+      if (pos - ref->path == 0 && ref->path[0] == '/') 
+       folder = strdup("/");
+      else {
+       folder = calloc(pos - ref->path +1, 1 );
+       strncpy(folder, ref->path, pos - ref->path);
+      }
+
+
+      
+      /*printf("Path: '%s' -> pos+1: '%s'\n", (char *) 
data->resp_command.file_command.files[0]->path, pos+1);*/
 
       //printf("Folder: '%s'\nFilename: '%s'\n", folder, pos+1);
-      md5 = md5_entropy_path_file 
(data->resp_command.file_command.files[0]->plugin_uri, folder, pos + 1);
+      md5 = md5_entropy_path_file (ref->plugin_uri, folder, filename);
       instance = ecore_hash_get (evfs_dir_requests, 
(long*)data->resp_command.client_identifier );
 
       /*Build a file<->stat structure to pass to requester */
@@ -215,7 +230,7 @@
              entropy_core_layout_notify_event (instance, gui_event,
                                        ENTROPY_EVENT_LOCAL);
       } else {
-             printf("Error! Couldn't fine listener for '%s'\n", 
data->resp_command.file_command.files[0]->path);
+             printf("Error! Couldn't find listener for '%s' '%s' 
'%s'\n",data->resp_command.file_command.files[0]->plugin_uri, folder, filename);
       }
 
       /*Do some freeing */
@@ -224,6 +239,7 @@
 
       ecore_hash_remove (evfs_dir_requests, 
(long*)data->resp_command.client_identifier);
       entropy_free (folder);
+      entropy_free (filename);
       entropy_free (md5);
 
       /*No need to free event - notify_event frees it for us */
@@ -260,6 +276,10 @@
                        /*printf("(%s) Received file type for file: %d\n", 
ref->path, ref->file_type); */
 
                        pos = rindex (ref->path, '/');
+
+                       /*Set the file's filename*/
+                       filename = strdup (pos + 1);
+                       
                        if (pos - ref->path == 0 && ref->path[0] == '/') 
                                folder = strdup("/");
                        else {
@@ -267,9 +287,6 @@
                                strncpy(folder, ref->path, pos - ref->path);
                        }
 
-                       /*Set the file's filename*/
-                       filename = strdup (pos + 1);
-
                        /*Look for an existing file we have cached */
                        char *md5 = md5_entropy_path_file (ref->plugin_uri, 
folder, filename);
 
@@ -297,7 +314,7 @@
                          }
 
                          /*Set the attached data -> icon_hint, if there*/
-                         if (ref->attach) file->icon_hint = 
strdup(ref->attach);
+                         if (ref->attach) file->attach = strdup(ref->attach);
 
                          if (calling_request
                              && (calling_request->drill_down
@@ -657,18 +674,18 @@
 struct stat *
 filestat_get (entropy_file_request * request)
 {
-  evfs_file_uri_path *path;
+  evfs_filereference *path;
   char *uri = uri = entropy_core_generic_file_uri_create (request->file, 0);
   long id;
 
-  //printf("Getting a stat from evfs...\n");
-
+  path = evfs_parse_uri_single (uri);
+  if (request->file->attach) 
+         path->attach = strdup(request->file->attach);
 
-  path = evfs_parse_uri (uri);
-  id = evfs_client_file_stat (con, path->files[0]);
-ecore_hash_set (evfs_dir_requests, (long*)id, request->requester);
+  id = evfs_client_file_stat (con, path);
+  ecore_hash_set (evfs_dir_requests, (long*)id, request->requester);
 
-  evfs_cleanup_file_uri_path (path);
+  evfs_cleanup_filereference (path);
   free(uri);
 
 
===================================================================
RCS file: /cvs/e/e17/proto/entropy/src/plugins/thumbnail_system.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- thumbnail_system.c  20 Jul 2006 15:19:19 -0000      1.10
+++ thumbnail_system.c  15 Aug 2006 12:04:53 -0000      1.11
@@ -55,15 +55,15 @@
   entropy_thumbnail *thumb = entropy_thumbnail_new ();
 
   if (!strcmp (request->file->mime_type, "file/folder")) {
-    if (!request->file->icon_hint) {
+    if (!request->file->attach) {
            strcpy (thumb->thumbnail_filename, PACKAGE_DATA_DIR 
"/icons/folder.png");
     } else {
-           printf("Object has attach data: %s\n", request->file->icon_hint);
-           if (!strcmp(request->file->icon_hint, "video_hint")) 
+           printf("Object has attach data: %s\n", request->file->attach);
+           if (!strcmp(request->file->attach, "video_hint")) 
                    strcpy (thumb->thumbnail_filename, PACKAGE_DATA_DIR 
"/icons/hint_videos.png");
-           else if (!strcmp(request->file->icon_hint, "audio_hint")) 
+           else if (!strcmp(request->file->attach, "audio_hint")) 
                    strcpy (thumb->thumbnail_filename, PACKAGE_DATA_DIR 
"/icons/hint_audio.png");
-           else if (!strcmp(request->file->icon_hint, "image_hint"))
+           else if (!strcmp(request->file->attach, "image_hint"))
                    strcpy (thumb->thumbnail_filename, PACKAGE_DATA_DIR 
"/icons/hint_image.png");
     }
   }



-------------------------------------------------------------------------
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