Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fm.c 


Log Message:


fix dnd path support to use url

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -3 -r1.129 -r1.130
--- e_fm.c      28 Jan 2007 07:22:50 -0000      1.129
+++ e_fm.c      4 Feb 2007 13:14:39 -0000       1.130
@@ -3253,6 +3253,7 @@
    E_Event_Dnd_Drop *ev;
    Evas_List *fsel, *l, *ll;
    char buf[4096], *fl, *d;
+   const char *fp;
 
    sd = data;
    if (!type) return;
@@ -3278,7 +3279,9 @@
        /* move file into this fm dir */
        for (ll = fsel; ll; ll = ll->next)
          {
-            d = ecore_file_get_dir(ll->data);
+            fp = _e_fm2_icon_desktop_url_eval(ll->data);
+            if (!fp) continue;
+            d = ecore_file_get_dir(fp);
             /* get the dir of each file */
             if (d)
               {
@@ -3290,9 +3293,9 @@
                         {
                            /* move the file into the subdir */
                            snprintf(buf, sizeof(buf), "%s/%s",
-                                    sd->realpath, 
ecore_file_get_file(ll->data));
+                                    sd->realpath, ecore_file_get_file(fp));
                            e_fm2_fop_move_add(sd->obj,
-                                              ll->data, buf,
+                                              fp, buf,
                                               NULL, 0, 1);
 //                         if (ecore_file_exists(buf))
 //                           {
@@ -3301,24 +3304,24 @@
 //                         else
 //                           {
 /*FOPME*/
-//                              if (ecore_file_mv(ll->data, buf))
+//                              if (ecore_file_mv(fp, buf))
 //                                _e_fm2_live_file_add(sd->obj,
-//                                                     
ecore_file_get_file(ll->data),
+//                                                     ecore_file_get_file(fp),
 //                                                     NULL, 0);
 //                           }
                         }
                       else
                         _e_fm2_live_file_add(sd->obj,
-                                             ecore_file_get_file(ll->data),
+                                             ecore_file_get_file(fp),
                                              NULL, 0);
                    }
                  else
                    {
                       /* file is in target dir - move into subdir */
                       snprintf(buf, sizeof(buf), "%s/%s",
-                               sd->realpath, ecore_file_get_file(ll->data));
+                               sd->realpath, ecore_file_get_file(fp));
                       e_fm2_fop_move_add(sd->obj,
-                                         ll->data, buf,
+                                         fp, buf,
                                          NULL, 0, 1);
 //                    if (ecore_file_exists(buf))
 //                      {
@@ -3327,14 +3330,15 @@
 //                    else
 //                      {
 /*FOPME*/
-//                         if (ecore_file_mv(ll->data, buf))
+//                         if (ecore_file_mv(fp, buf))
 //                           _e_fm2_live_file_add(sd->obj,
-//                                                
ecore_file_get_file(ll->data),
+//                                                ecore_file_get_file(fp),
 //                                                NULL, 0);
 //                      }
                    }
                  free(d);
               }
+            evas_stringshare_del(fp);
          }
      }
    else if (sd->drop_icon) /* inot or before/after an icon */
@@ -3345,19 +3349,22 @@
             /* move file into dir that this icon is for */
             for (ll = fsel; ll; ll = ll->next)
               {
+                 fp = _e_fm2_icon_desktop_url_eval(ll->data);
+                 if (!fp) continue;
                  /* move the file into the subdir */
                  snprintf(buf, sizeof(buf), "%s/%s/%s",
-                          sd->realpath, sd->drop_icon->info.file, 
ecore_file_get_file(ll->data));
-                 printf("mv %s %s\n", (char *)ll->data, buf);
+                          sd->realpath, sd->drop_icon->info.file, 
ecore_file_get_file(fp));
+                 printf("mv %s %s\n", (char *)fp, buf);
                  e_fm2_fop_move_add(sd->obj,
-                                    ll->data, buf,
+                                    fp, buf,
                                     NULL, 0, 0);
 //               if (ecore_file_exists(buf))
 //                 {
 //                    /* FIXME: error - file exists */
 //                 }
 //               else
-///*FOPME*/                ecore_file_mv(ll->data, buf);
+///*FOPME*/                ecore_file_mv(fp, buf);
+                 evas_stringshare_del(fp);
               }
          }
        else
@@ -3368,62 +3375,71 @@
                    {
                       for (ll = fsel; ll; ll = ll->next)
                         {
+                           fp = _e_fm2_icon_desktop_url_eval(ll->data);
+                           if (!fp) continue;
                            snprintf(buf, sizeof(buf), "%s/%s",
-                                    sd->realpath, 
ecore_file_get_file(ll->data));
-                           d = ecore_file_get_dir(ll->data);
+                                    sd->realpath, ecore_file_get_file(fp));
+                           d = ecore_file_get_dir(fp);
                            if (d)
                              {
                                 if (!strcmp(sd->realpath, d))
                                   {
                                      _e_fm2_live_file_del(sd->obj,
-                                                          
ecore_file_get_file(ll->data));
+                                                          
ecore_file_get_file(fp));
                                   }
                                 else
                                   {
                                      if (sd->config->view.link_drop)
-                                       e_fm2_fop_link_add(sd->obj, ll->data, 
buf);
+                                       e_fm2_fop_link_add(sd->obj, fp, buf);
                                      else
                                        e_fm2_fop_move_add(sd->obj,
-                                                          ll->data, buf,
+                                                          fp, buf,
                                                           NULL, 0, 0);
                                   }
                                 free(d);
                              }
-//                         d = ecore_file_get_dir(ll->data);
+//                         d = ecore_file_get_dir(fp);
 //                         if (d)
 //                           {
 //                              if (!strcmp(d, sd->realpath))
 //                                {
-//                                   printf("listrm %s\n", 
ecore_file_get_file(ll->data));
-//                                   _e_fm2_live_file_del(sd->obj, 
ecore_file_get_file(ll->data));
+//                                   printf("listrm %s\n", 
ecore_file_get_file(fp));
+//                                   _e_fm2_live_file_del(sd->obj, 
ecore_file_get_file(fp));
 //                                }
 //                              else
 //                                {
-///*FOPME*/                                  ecore_file_symlink(ll->data, buf);
+///*FOPME*/                                  ecore_file_symlink(fp, buf);
 //                                }
 //                              free(d);
 //                           }
+                           evas_stringshare_del(fp);
                         }
                       if (sd->drop_after == 0)
                         {
                            for (ll = evas_list_last(fsel); ll; ll = ll->prev)
                              {
-                                e_fm2_fop_add_add(sd->obj, ll->data, 
sd->drop_icon->info.file, 0);
-//                              printf("listadd %s, before %s\n", 
ecore_file_get_file(ll->data), sd->drop_icon->info.file);
+                                fp = _e_fm2_icon_desktop_url_eval(ll->data);
+                                if (!fp) continue;
+                                e_fm2_fop_add_add(sd->obj, fp, 
sd->drop_icon->info.file, 0);
+//                              printf("listadd %s, before %s\n", 
ecore_file_get_file(fp), sd->drop_icon->info.file);
 //                              _e_fm2_live_file_add(sd->obj,
-//                                                   
ecore_file_get_file(ll->data),
+//                                                   ecore_file_get_file(fp),
 //                                                   sd->drop_icon->info.file, 
0);
+                                evas_stringshare_del(fp);
                              }
                         }
                       else
                         {
                            for (ll = fsel; ll; ll = ll->next)
                              {
-                                e_fm2_fop_add_add(sd->obj, ll->data, 
sd->drop_icon->info.file, 1);
-//                              printf("listadd %s, after %s\n", 
ecore_file_get_file(ll->data), sd->drop_icon->info.file);
+                                fp = _e_fm2_icon_desktop_url_eval(ll->data);
+                                if (!fp) continue;
+                                e_fm2_fop_add_add(sd->obj, fp, 
sd->drop_icon->info.file, 1);
+//                              printf("listadd %s, after %s\n", 
ecore_file_get_file(fp), sd->drop_icon->info.file);
 //                              _e_fm2_live_file_add(sd->obj,
-//                                                   
ecore_file_get_file(ll->data),
+//                                                   ecore_file_get_file(fp),
 //                                                   sd->drop_icon->info.file, 
1);
+                                evas_stringshare_del(fp);
                              }
                         }
                    }
@@ -3431,12 +3447,14 @@
                    {
                       for (ll = fsel; ll; ll = ll->next)
                         {
+                           fp = _e_fm2_icon_desktop_url_eval(ll->data);
+                           if (!fp) continue;
                            /* move the file into the subdir */
                            snprintf(buf, sizeof(buf), "%s/%s",
-                                    sd->realpath, 
ecore_file_get_file(ll->data));
-                           printf("mv %s %s\n", (char *)ll->data, buf);
+                                    sd->realpath, ecore_file_get_file(fp));
+                           printf("mv %s %s\n", (char *)fp, buf);
                            e_fm2_fop_move_add(sd->obj,
-                                              ll->data, buf,
+                                              fp, buf,
                                               NULL, 0, 1);
 //                         if (ecore_file_exists(buf))
 //                           {
@@ -3444,11 +3462,12 @@
 //                           }
 //                         else
 //                           {
-///*FOPME*/                             if (ecore_file_mv(ll->data, buf))
+///*FOPME*/                             if (ecore_file_mv(fp, buf))
 //                                _e_fm2_live_file_add(sd->obj,
-//                                                     
ecore_file_get_file(ll->data),
+//                                                     ecore_file_get_file(fp),
 //                                                     NULL, 0);
 //                           }
+                           evas_stringshare_del(fp);
                         }
                    }
               }
@@ -6039,7 +6058,7 @@
                "Name=%s\n"
                "X-Enlightenment-IconClass=%s\n"
                "Comment=%s\n"
-               "URL=file:%s"
+               "URL=file:/%s"
                ,
                rem->label,
                "fileman/hd", 



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to