63 lines
1.9 KiB
Diff
63 lines
1.9 KiB
Diff
Index: daemon/gvfsbackendburn.c
|
|
===================================================================
|
|
--- daemon/gvfsbackendburn.c (revisione 2144)
|
|
+++ daemon/gvfsbackendburn.c (copia locale)
|
|
@@ -953,6 +953,49 @@
|
|
return TRUE;
|
|
}
|
|
|
|
+static gboolean
|
|
+try_move (GVfsBackend *backend,
|
|
+ GVfsJobMove *job,
|
|
+ const char *source,
|
|
+ const char *destination,
|
|
+ GFileCopyFlags flags,
|
|
+ GFileProgressCallback progress_callback,
|
|
+ gpointer progress_callback_data)
|
|
+{
|
|
+ VirtualNode *source_node, *root_node, *source_dir, *dest_dir;
|
|
+
|
|
+ root_node = G_VFS_BACKEND_BURN (backend)->root_node;
|
|
+
|
|
+ source_node = virtual_node_lookup (root_node, source, &source_dir);
|
|
+ if (source_node == NULL)
|
|
+ {
|
|
+ g_vfs_job_failed (G_VFS_JOB (job), G_IO_ERROR,
|
|
+ G_IO_ERROR_NOT_FOUND,
|
|
+ _("No such file or directory"));
|
|
+ return TRUE;
|
|
+ }
|
|
+
|
|
+ if (virtual_node_lookup (root_node, destination, &dest_dir) != NULL)
|
|
+ {
|
|
+ g_vfs_job_failed (G_VFS_JOB (job), G_IO_ERROR,
|
|
+ G_IO_ERROR_EXISTS,
|
|
+ _("File exists"));
|
|
+ return TRUE;
|
|
+ }
|
|
+
|
|
+ g_free (source_node->filename);
|
|
+ source_node->filename = g_path_get_basename (destination);
|
|
+
|
|
+ if (source_dir != dest_dir) {
|
|
+ source_dir->children = g_list_remove (source_dir->children, source_node);
|
|
+ dest_dir->children = g_list_append (dest_dir->children, source_node);
|
|
+ }
|
|
+
|
|
+ g_vfs_job_succeeded (G_VFS_JOB (job));
|
|
+
|
|
+ return TRUE;
|
|
+}
|
|
+
|
|
static void
|
|
g_vfs_backend_burn_class_init (GVfsBackendBurnClass *klass)
|
|
{
|
|
@@ -970,6 +1013,7 @@
|
|
backend_class->try_set_display_name = try_set_display_name;
|
|
backend_class->try_push = try_push;
|
|
backend_class->try_delete = try_delete;
|
|
+ backend_class->try_move = try_move;
|
|
backend_class->read = do_read;
|
|
backend_class->seek_on_read = do_seek_on_read;
|
|
backend_class->close_read = do_close_read;
|