Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fm.c 


Log Message:


note some bugs

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.c,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -3 -r1.176 -r1.177
--- e_fm.c      3 Jun 2007 04:50:54 -0000       1.176
+++ e_fm.c      10 Jun 2007 02:11:57 -0000      1.177
@@ -57,6 +57,7 @@
    } icon_menu;
    
    Evas_List        *icons;
+   Evas_List        *icons_place;
    Evas_List        *queue;
    Ecore_Timer      *scan_timer;
    Ecore_Timer      *sort_idler;
@@ -2064,6 +2065,7 @@
               {
                  sd->icons = evas_list_append(sd->icons, ic);
               }
+            sd->icons_place = evas_list_append(sd->icons_place, ic);
          }
        sd->tmp.last_insert = NULL;
        sd->iconlist_changed = 1;
@@ -2085,6 +2087,7 @@
        if (!strcmp(ic->info.file, file))
          {
             sd->icons = evas_list_remove_list(sd->icons, l);
+            sd->icons_place = evas_list_remove(sd->icons_place, ic);
             if (ic->region)
               {
                  ic->region->list = evas_list_remove(ic->region->list, ic);
@@ -2195,6 +2198,7 @@
             sd->icons = evas_list_append(sd->icons, ic);
             sd->tmp.last_insert = evas_list_last(sd->icons);
          }
+       sd->icons_place = evas_list_append(sd->icons_place, ic);
        added++;
        /* if we spent more than 1/20th of a second inserting - give up
         * for now */
@@ -2377,6 +2381,7 @@
    Evas_List *l;
    E_Fm2_Icon *ic2;
 
+   /* this is really slow... when we have a lot of icons */
    for (l = ic->sd->icons; l; l = l->next)
      {
        ic2 = l->data;
@@ -2419,50 +2424,79 @@
 static void
 _e_fm2_icons_place_icon(E_Fm2_Icon *ic)
 {
-   Evas_List *l;
+   Evas_List *l, *pl;
    E_Fm2_Icon *ic2;
    
    ic->x = 0;
    ic->y = 0;
    ic->saved_pos = 1;
-   if (!_e_fm2_icons_icon_overlaps(ic)) return;
+   /* ### BLAH ### */
+//   if (!_e_fm2_icons_icon_overlaps(ic)) return;
+/*          
+ _e_fm2_icon_place_relative(ic, ic2, 1, 0, 0, 2);
+ if (_e_fm2_icons_icon_row_ok(ic) && !_e_fm2_icons_icon_overlaps(ic)) return;
+ _e_fm2_icon_place_relative(ic, ic2, 0, -1, 0, 0);
+ if (_e_fm2_icons_icon_row_ok(ic) && !_e_fm2_icons_icon_overlaps(ic)) return;
+ _e_fm2_icon_place_relative(ic, ic2, 0, -1, 1, 0);
+ if (_e_fm2_icons_icon_row_ok(ic) && !_e_fm2_icons_icon_overlaps(ic)) return;
+ _e_fm2_icon_place_relative(ic, ic2, 1, 0, 0, 0);
+ if (_e_fm2_icons_icon_row_ok(ic) && !_e_fm2_icons_icon_overlaps(ic)) return;
+ _e_fm2_icon_place_relative(ic, ic2, 1, 0, 0, 1);
+ if (_e_fm2_icons_icon_row_ok(ic) && !_e_fm2_icons_icon_overlaps(ic)) return;
+ _e_fm2_icon_place_relative(ic, ic2, 0, 1, 0, 0);
+ if (_e_fm2_icons_icon_row_ok(ic) && !_e_fm2_icons_icon_overlaps(ic)) return;
+ _e_fm2_icon_place_relative(ic, ic2, 0, 1, 1, 0);
+ if (_e_fm2_icons_icon_row_ok(ic) && !_e_fm2_icons_icon_overlaps(ic)) return;
+ */
+   printf("PLACE %s\n", ic->info.file);
+//   for (l = ic->sd->icons_place; l; l = l->next)
    for (l = ic->sd->icons; l; l = l->next)
      {
        ic2 = l->data;
        
-       if (ic2->saved_pos)
+       if ((ic2 != ic) && (ic2->saved_pos))
          {
-            int x, y;
-            
             // ###_
-            _e_fm2_icon_place_relative(ic, ic2, 1, 0, 0, 2); if 
(_e_fm2_icons_icon_row_ok(ic) && !_e_fm2_icons_icon_overlaps(ic)) return;
+            _e_fm2_icon_place_relative(ic, ic2, 1, 0, 0, 2);
+            if (_e_fm2_icons_icon_row_ok(ic) && 
+                !_e_fm2_icons_icon_overlaps(ic)) goto done;
+            // _###
+            _e_fm2_icon_place_relative(ic, ic2, -1, 0, 0, 2);
+            if (_e_fm2_icons_icon_row_ok(ic) && 
+                !_e_fm2_icons_icon_overlaps(ic)) goto done;
+         }
+     }
+   
+//   for (l = ic->sd->icons_place; l;)
+   for (l = ic->sd->icons; l;)
+     {
+       ic2 = l->data;
+       
+       if ((ic2 != ic) && (ic2->saved_pos))
+         {
             // ###
             //  |
-            _e_fm2_icon_place_relative(ic, ic2, 0, 1, 1, 0); if 
(_e_fm2_icons_icon_row_ok(ic) && !_e_fm2_icons_icon_overlaps(ic)) return;
-            // ###
-            // |
-            _e_fm2_icon_place_relative(ic, ic2, 0, 1, 0, 0); if 
(_e_fm2_icons_icon_row_ok(ic) && !_e_fm2_icons_icon_overlaps(ic)) return;
+            _e_fm2_icon_place_relative(ic, ic2, 0, 1, 1, 0);
+            if (_e_fm2_icons_icon_row_ok(ic) && 
+                !_e_fm2_icons_icon_overlaps(ic)) goto done;
+            //  |
             // ###
-            //   |
-            _e_fm2_icon_place_relative(ic, ic2, 0, 1, 2, 0); if 
(_e_fm2_icons_icon_row_ok(ic) && !_e_fm2_icons_icon_overlaps(ic)) return;
-/*          
-            _e_fm2_icon_place_relative(ic, ic2, 1, 0, 0, 2);
-            if (_e_fm2_icons_icon_row_ok(ic) && 
!_e_fm2_icons_icon_overlaps(ic)) return;
-            _e_fm2_icon_place_relative(ic, ic2, 0, -1, 0, 0);
-            if (_e_fm2_icons_icon_row_ok(ic) && 
!_e_fm2_icons_icon_overlaps(ic)) return;
             _e_fm2_icon_place_relative(ic, ic2, 0, -1, 1, 0);
-            if (_e_fm2_icons_icon_row_ok(ic) && 
!_e_fm2_icons_icon_overlaps(ic)) return;
-            _e_fm2_icon_place_relative(ic, ic2, 1, 0, 0, 0);
-            if (_e_fm2_icons_icon_row_ok(ic) && 
!_e_fm2_icons_icon_overlaps(ic)) return;
-            _e_fm2_icon_place_relative(ic, ic2, 1, 0, 0, 1);
-            if (_e_fm2_icons_icon_row_ok(ic) && 
!_e_fm2_icons_icon_overlaps(ic)) return;
-            _e_fm2_icon_place_relative(ic, ic2, 0, 1, 0, 0);
-            if (_e_fm2_icons_icon_row_ok(ic) && 
!_e_fm2_icons_icon_overlaps(ic)) return;
-            _e_fm2_icon_place_relative(ic, ic2, 0, 1, 1, 0);
-            if (_e_fm2_icons_icon_row_ok(ic) && 
!_e_fm2_icons_icon_overlaps(ic)) return;
- */
+            if (_e_fm2_icons_icon_row_ok(ic) && 
+                !_e_fm2_icons_icon_overlaps(ic)) goto done;
+         }
+       pl = l;
+       l = l->next;
+        if ((ic2 != ic) && (ic2->saved_pos))
+         {
+//          printf("REMOVE %p [%s]\n", 
+//                 pl->data, ((E_Fm2_Icon *)pl->data)->info.file);
+//          ic->sd->icons_place = evas_list_remove_list(ic->sd->icons_place, 
pl);
          }
      }
+   done:
+   printf("PLACED at %i %i\n", ic->x, ic->y);
+   return;
 }
 
 static void
@@ -2612,6 +2646,8 @@
        _e_fm2_icon_free(sd->icons->data);
         sd->icons = evas_list_remove_list(sd->icons, sd->icons);
      }
+   evas_list_free(sd->icons_place);
+   sd->icons_place = NULL;
    sd->tmp.last_insert = NULL;
    E_FREE(sd->tmp.list_index);
 }



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to