This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efm2.

View the commit online.

commit ac999a675d574502534216b5e5b8a695d6227164
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
AuthorDate: Fri Jul 18 17:31:37 2025 +0100

    finish off cut, copy and paste
    
    woo!
---
 src/backends/default/open.c | 34 ++++++++++++++++++++++++++++++++--
 src/efm/efm.c               | 15 ++++++++++++---
 2 files changed, 44 insertions(+), 5 deletions(-)

diff --git a/src/backends/default/open.c b/src/backends/default/open.c
index 8ebe83f..7fcef11 100644
--- a/src/backends/default/open.c
+++ b/src/backends/default/open.c
@@ -1240,7 +1240,7 @@ _handle_drop_paste(const char *over, const char *action, Eina_List *files)
       cmd_strbuf_append(strbuf, "action", action);
       EINA_LIST_FOREACH(files, l, path)
       {
-        fprintf(stderr, "DROP in [%s] over=[%s] action=""  >  [%s]\n", mondir,
+        fprintf(stderr, "DND/PASTE in [%s] over=[%s] action=""  >  [%s]\n", mondir,
                 over, action, path);
         cmd_strbuf_append(strbuf, "path", path);
       }
@@ -1419,8 +1419,38 @@ do_handle_cmd(Cmd *c)
           EINA_LIST_FREE(files, s) eina_stringshare_del(s);
         }
     }
+  else if (!strcmp(c->command, "cnp-cut"))
+    { // nothing to do here. the front-end will keep a uri-list in cnp
+    }
+  else if (!strcmp(c->command, "cnp-copy"))
+    { // nothing to do here. the front-end will keep a uri-list in cnp
+    }
   else if (!strcmp(c->command, "cnp-paste"))
-    { // XXX: implement
+    { // we pasted
+      Eina_List  *files = NULL;
+      const char *s;
+      Eina_Bool cut = EINA_FALSE;
+
+      KEY_WALK_BEGIN
+      {
+        if (!strcmp(key, "path"))
+          {
+            if (!strncmp(data, " //..//#", 8))
+              { // there is a special comment path - is it from efm and cut?
+                if (!strcmp(data + 8, "EFM: cut")) cut = EINA_TRUE;
+              }
+            else
+              files = eina_list_append(files, eina_stringshare_add(data));
+          }
+      }
+      KEY_WALK_END
+      if (files)
+        {
+          // handle like a dnd paste as it's the same thing...
+          if (cut) _handle_drop_paste(NULL, "move", files);
+          else _handle_drop_paste(NULL, "copy", files);
+          EINA_LIST_FREE(files, s) eina_stringshare_del(s);
+        }
     }
   else if (!strcmp(c->command, "file-unlink"))
     { // this is an explicit unlink - no trashing
diff --git a/src/efm/efm.c b/src/efm/efm.c
index 196fa55..c8fc1b3 100644
--- a/src/efm/efm.c
+++ b/src/efm/efm.c
@@ -60,6 +60,7 @@ _cnp_copy_files(Smart_Data *sd)
 
   strbuf = eina_strbuf_new();
   if (!strbuf) return;
+  if (sd->cnp_cut) eina_strbuf_append(strbuf, "#EFM: cut\n");
   if (_selected_icons_uri_strbuf_append(sd, strbuf))
     {
       str = eina_strbuf_string_get(strbuf);
@@ -122,9 +123,17 @@ _cb_sel_get(void *data, Evas_Object *_obj EINA_UNUSED, Elm_Selection_Data *ev)
             {
               if (**p)
                 {
-                  esc = unescape(*p);
-                  if (!esc) continue;
-                  printf("XXX: PASTE FILE: [%s]\n", esc);
+                  if (!strncmp(*p, " //..//#", 8))
+                    {
+                      const char *comment = *p + 8;
+                      printf("XXX: PASTE COMMENT [%s]\n", comment);
+                    }
+                  else
+                    {
+                      esc = unescape(*p);
+                      if (!esc) continue;
+                      printf("XXX: PASTE FILE: [%s]\n", esc);
+                    }
                 }
             }
           free(*plist);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to