[nautilus/wip/corey/dnd_features: 1/10] file-operations: Allow starring files for COPY operations
- From: Corey Berla <coreyberla src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/corey/dnd_features: 1/10] file-operations: Allow starring files for COPY operations
- Date: Thu, 1 Sep 2022 20:51:46 +0000 (UTC)
commit c59980a8f9bd9eb49e4b80ac434e4fffc8ddeca5
Author: Corey Berla <corey berla me>
Date: Thu Sep 1 13:30:41 2022 -0700
file-operations: Allow starring files for COPY operations
If the operation is COPY and it's to the starred directory
simply star the files. This allows us to DnD to starred.
src/nautilus-file-operations.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index c3d488f79..aa8bd29f3 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -55,6 +55,7 @@
#include "nautilus-operations-ui-manager.h"
#include "nautilus-file-changes-queue.h"
#include "nautilus-file-private.h"
+#include "nautilus-tag-manager.h"
#include "nautilus-trash-monitor.h"
#include "nautilus-file-utilities.h"
#include "nautilus-file-undo-operations.h"
@@ -7488,7 +7489,21 @@ nautilus_file_operations_copy_move (const GList *item_uris,
parent_window = (GtkWindow *) gtk_widget_get_ancestor (parent_view, GTK_TYPE_WINDOW);
}
- if (copy_action == GDK_ACTION_COPY)
+ if (g_file_has_uri_scheme (dest, "starred"))
+ {
+ g_autolist (NautilusFile) source_file_list = NULL;
+
+ for (GList *l = locations; l != NULL; l = l->next)
+ {
+ source_file_list = g_list_prepend (source_file_list, nautilus_file_get (l->data));
+ }
+
+ source_file_list = g_list_reverse (source_file_list);
+ nautilus_tag_manager_star_files (nautilus_tag_manager_get (),
+ G_OBJECT (parent_view),
+ source_file_list, NULL, NULL);
+ }
+ else if (copy_action == GDK_ACTION_COPY)
{
src_dir = g_file_get_parent (locations->data);
if (target_dir == NULL ||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]