Enlightenment CVS committal

Author  : chaos
Project : e17
Module  : apps/evfs

Dir     : e17/apps/evfs/src/bin


Modified Files:
        evfs_main.c evfs_server_handle.c 
Added Files:
        evfs_trash.c 


Log Message:
* Trash restore actually works! Note that this will not remove the .trashinfo 
file yet - coming soon

===================================================================
RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_main.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- evfs_main.c 26 Aug 2006 13:16:32 -0000      1.58
+++ evfs_main.c 27 Aug 2006 09:58:53 -0000      1.59
@@ -578,6 +578,7 @@
    evfs_io_initialise();
    evfs_vfolder_initialise();
    evfs_operation_initialise();
+   evfs_trash_initialise();
    
    if (argc >= 2 && !strcmp(argv[1], "-nometa"))
        evfs_metadata_initialise(0);
===================================================================
RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_server_handle.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -3 -r1.74 -r1.75
--- evfs_server_handle.c        26 Aug 2006 12:59:39 -0000      1.74
+++ evfs_server_handle.c        27 Aug 2006 09:58:53 -0000      1.75
@@ -10,6 +10,8 @@
 #include <errno.h>
 #include <dirent.h>
 
+#include <Ecore_Desktop.h>
+
 /*---------------------------------------------------*/
 /*Move these functions somewhere*/
 
@@ -698,5 +700,41 @@
 
 void evfs_handle_trash_restore_command(evfs_client* client, evfs_command* 
command)
 {
-       printf("TRASH restore: stub\n");
+       int c;
+       Ecore_Desktop* desk;
+       char path[PATH_MAX];
+       evfs_filereference *ref, *src, *dest;
+       char* pos;
+       char* pos2;
+       int len;
+       evfs_command* f_command;
+
+       for (c=0;c<command->file_command.num_files;c++) {
+               ref = command->file_command.files[c];
+               pos = strrchr(ref->path, '.');
+               pos2 = strrchr(ref->path, '/');
+
+               memset(path, 0,PATH_MAX);
+               snprintf(path, PATH_MAX, "file://%s/", 
evfs_trash_files_dir_get());
+               strncat(path, pos2+1, strlen(pos2+1) - strlen(pos));
+               
+               printf("Parsing '%s'\n", command->file_command.files[c]->path);
+
+               /*Parse the ecore_desktop file*/
+               desk = 
ecore_desktop_get(command->file_command.files[c]->path,NULL);
+
+               src = evfs_parse_uri_single(path);
+               dest = evfs_parse_uri_single(desk->path);
+
+               f_command = NEW(evfs_command);
+               f_command->type = EVFS_CMD_FILE_MOVE;
+               f_command->file_command.files = calloc(2, 
sizeof(evfs_filereference));
+               f_command->file_command.files[0] = src;
+               f_command->file_command.files[1] = dest;
+               f_command->file_command.num_files = 2;
+
+               printf("Original location: %s -- file: %s\n", desk->path, path);
+
+               evfs_handle_file_copy(client, f_command, f_command, 1);
+       }
 }



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