Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fm.c 


Log Message:


more fm2 dnd work.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -3 -r1.78 -r1.79
--- e_fm.c      28 Sep 2006 06:07:15 -0000      1.78
+++ e_fm.c      28 Sep 2006 09:22:43 -0000      1.79
@@ -1321,6 +1321,11 @@
             ic->info.pseudo_dir = 
evas_stringshare_add(sd->config->view.extra_file_source);
             ic->info.pseudo_link = 1;
          }
+       else
+         {
+            free(ic);
+            return NULL;
+         }
      }
    ic->sd = sd;
    ic->info.file = evas_stringshare_add(file);
@@ -2635,9 +2640,12 @@
 {
    E_Fm2_Smart_Data *sd;
    E_Event_Dnd_Drop *ev;
-   Evas_List *fsel, *l;
-   char *f;
+   E_Fm2_Icon *ic;
+   Evas_List *fsel, *l, *ll;
+   char *fl;
    int i, refresh = 0;
+   char buf[4096];
+   FILE *f;
    
    sd = data;
    if (!type) return;
@@ -2647,8 +2655,8 @@
    printf("DROP: %i %i\n", ev->x, ev->y);
    for (l = fsel; l; l = l->next)
      {
-       f = l->data;
-       printf("  %s\n", f);
+       fl = l->data;
+       printf("  %s\n", fl);
      }
    /* note - logic.
     * if drop file prefix path matches extra_file_source then it can be
@@ -2665,6 +2673,7 @@
      }
    else if (sd->drop_icon) /* inot or before/after an icon */
      {
+       printf("drop icon\n");
        if (sd->drop_after == -1) /* put into subdir in icon */
          {
             /* move file into dir that this icon is for */
@@ -2683,7 +2692,52 @@
                        * dropped files, then everything after that is not
                        * being dragged then refresh view
                        */
-                      refresh  = 1; /* refresh src fm */
+                      snprintf(buf, sizeof(buf), "%s/.order", sd->realpath);
+                      f = fopen(buf, "w");
+                      if (f)
+                        {
+                           for (l = sd->icons; l; l = l->next)
+                             {
+                                ic = l->data;
+                                if (!ic->drag.dnd)
+                                  {
+                                     if ((sd->drop_after == 0) && 
+                                         (ic == sd->drop_icon))
+                                       {
+                                          for (ll = fsel; ll; ll = ll->next)
+                                            fprintf(f, "%s\n", 
ecore_file_get_file(ll->data));
+                                          fprintf(f, "%s\n", ic->info.file);
+                                       }
+                                     else if ((sd->drop_after == 1) && 
+                                              (ic == sd->drop_icon))
+                                       {
+                                          fprintf(f, "%s\n", ic->info.file);
+                                          for (ll = fsel; ll; ll = ll->next)
+                                            fprintf(f, "%s\n", 
ecore_file_get_file(ll->data));
+                                       }
+                                     else
+                                       fprintf(f, "%s\n", ic->info.file);
+                                  }
+                             }
+                           fclose(f);
+                        }
+                      for (ll = fsel; ll; ll = ll->next)
+                        {
+                           char *d;
+                           
+                           d = ecore_file_get_dir(ll->data);
+                           if (d)
+                             {
+                                if (strcmp(d, sd->realpath))
+                                  {
+                                     snprintf(buf, sizeof(buf), "%s/%s",
+                                              sd->realpath, 
ecore_file_get_file(ll->data));
+                                     ecore_file_symlink(ll->data, buf);
+                                  }
+                                free(d);
+                             }
+                        }
+                      refresh = 1; /* refresh src fm */
                       e_fm2_refresh(sd->obj); /* refresh dst fm */
                    }
                  else /* no order file */



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to