Enlightenment CVS committal Author : chaos Project : e17 Module : proto
Dir : e17/proto/entropy/src/plugins Modified Files: etk_structure_viewer.c filesystem.c Log Message: * Default DND to move operation, and add move command to filesystem plugin. =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/etk_structure_viewer.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- etk_structure_viewer.c 19 Apr 2006 04:52:44 -0000 1.25 +++ etk_structure_viewer.c 10 Jun 2006 02:36:14 -0000 1.26 @@ -4,6 +4,7 @@ #include <limits.h> #include <Etk.h> #include "etk_progress_dialog.h" +#include "entropy_etk_context_menu.h"; static int etk_callback_setup = 0; static Ecore_Hash* instance_map_hash = NULL; @@ -103,7 +104,7 @@ printf("File is '%s' ---> %p\n", files->files[i], file); printf("Destination: %s\n", e_event->file->uri); - entropy_plugin_filesystem_file_copy(file, e_event->file->uri, instance); + entropy_plugin_filesystem_file_move(file, e_event->file->uri, instance); } } else { printf("Could not get instance for dropped row!\n"); =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/filesystem.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -3 -r1.66 -r1.67 --- filesystem.c 25 Apr 2006 13:24:03 -0000 1.66 +++ filesystem.c 10 Jun 2006 02:36:14 -0000 1.67 @@ -23,6 +23,8 @@ struct stat *filestat_get (entropy_file_request * request); Ecore_List *filelist_get (entropy_file_request * request); void entropy_filesystem_file_copy (entropy_generic_file * file, char *path_to, entropy_gui_component_instance * instance); +void entropy_filesystem_file_move (entropy_generic_file * file, char *path_to, entropy_gui_component_instance * instance); + void entropy_filesystem_file_rename (entropy_generic_file * file_from, entropy_generic_file * file_to); void entropy_filesystem_operation_respond(long id, int response); @@ -527,13 +529,13 @@ plugin->file_functions.filestat_get = &filestat_get; plugin->file_functions.filelist_get = &filelist_get; plugin->file_functions.file_copy = &entropy_filesystem_file_copy; + plugin->file_functions.file_move = &entropy_filesystem_file_move; plugin->file_functions.file_rename = &entropy_filesystem_file_rename; plugin->file_functions.operation_respond = &entropy_filesystem_operation_respond; plugin->file_functions.directory_create = &entropy_filesystem_directory_create; plugin->file_functions.file_remove = &entropy_filesystem_file_remove; - return base; @@ -825,6 +827,36 @@ evfs_cleanup_file_uri_path(uri_path_from); evfs_cleanup_file_uri_path(uri_path_to); } + +void +entropy_filesystem_file_move (entropy_generic_file * file, char *path_to, + entropy_gui_component_instance * instance) +{ + evfs_file_uri_path *uri_path_from; + evfs_file_uri_path *uri_path_to; + char copy_buffer[PATH_MAX]; + char uri_from[512]; + char uri_to[512]; + long id; + + + + snprintf (uri_from, 512, "%s://%s/%s", file->uri_base, file->path, + file->filename); + snprintf (uri_to, 512, "%s/%s", path_to, file->filename); + + uri_path_from = evfs_parse_uri (uri_from); + uri_path_to = evfs_parse_uri (uri_to); + + /*Track the move action */ + snprintf (copy_buffer, PATH_MAX, "%s%s", uri_from, uri_to); + id = evfs_client_file_move (con, uri_path_from->files[0], uri_path_to->files[0]); + ecore_hash_set(evfs_dir_requests, (long*)id, instance); + + evfs_cleanup_file_uri_path(uri_path_from); + evfs_cleanup_file_uri_path(uri_path_to); +} + /* _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs