Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fm.c e_fm.h e_int_config_apps.c e_int_config_desklock.c 
        e_int_config_icon_themes.c e_int_config_startup.c 
        e_int_config_theme.c e_int_config_wallpaper.c e_test.c 
        e_thumb_main.c e_widget_fsel.c 


Log Message:


add extra source dir for indirect pseudo-links. handle .order files as
pseudo-links

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- e_fm.c      30 Aug 2006 13:37:35 -0000      1.44
+++ e_fm.c      30 Aug 2006 14:45:33 -0000      1.45
@@ -52,6 +52,7 @@
    Ecore_Job        *resize_job;
    Ecore_Job        *refresh_job;
    DIR              *dir;
+   FILE             *order;
    E_Menu           *menu;
    E_Entry_Dialog   *entry_dialog;
    unsigned char     iconlist_changed : 1;
@@ -673,17 +674,23 @@
    ic = _e_fm2_icon_new(sd, file);
    if (ic)
      {
-       /* insertion sort it here to spread the sort load into idle time */
-       for (l = sd->queue; l; l = l->next)
+       /* respekt da ordah! */
+       if (sd->order)
+         sd->queue = evas_list_append(sd->queue, ic);
+       else
          {
-            ic2 = l->data;
-            if (_e_fm2_cb_icon_sort(ic, ic2) < 0)
+            /* insertion sort it here to spread the sort load into idle time */
+            for (l = sd->queue; l; l = l->next)
               {
-                 sd->queue = evas_list_prepend_relative_list(sd->queue, ic, l);
-                 break;
+                 ic2 = l->data;
+                 if (_e_fm2_cb_icon_sort(ic, ic2) < 0)
+                   {
+                      sd->queue = evas_list_prepend_relative_list(sd->queue, 
ic, l);
+                      break;
+                   }
               }
+            if (!l) sd->queue = evas_list_append(sd->queue, ic);
          }
-       if (!l) sd->queue = evas_list_append(sd->queue, ic);
        sd->tmp.last_insert = NULL;
        sd->iconlist_changed = 1;
      }
@@ -735,7 +742,7 @@
 
    sd = evas_object_smart_data_get(obj);
    if (!sd) return;
-   if (sd->dir)
+   if ((sd->dir) || (sd->order))
      edje_object_signal_emit(sd->overlay, "e,state,busy,stop", "e");
    /* stop the scan idler, the sort timer and free the queue */
    if (sd->dir)
@@ -743,6 +750,11 @@
        closedir(sd->dir);
        sd->dir = NULL;
      }
+   if (sd->order)
+     {
+       fclose(sd->order);
+       sd->order = NULL;
+     }
    if (sd->tmp.obj)
      {
        evas_object_del(sd->tmp.obj);
@@ -841,14 +853,21 @@
         * a worst case of O(n) where n is the # of files in the list
         * so far
         */
-       for (; l; l = l->next)
+       if (sd->order)
+         {
+            l = NULL;
+         }
+       else
          {
-            ic2 = l->data;
-            if (_e_fm2_cb_icon_sort(ic, ic2) < 0)
+            for (; l; l = l->next)
               {
-                 sd->icons = evas_list_prepend_relative_list(sd->icons, ic, l);
-                 sd->tmp.last_insert = l;
-                 break;
+                 ic2 = l->data;
+                 if (_e_fm2_cb_icon_sort(ic, ic2) < 0)
+                   {
+                      sd->icons = evas_list_prepend_relative_list(sd->icons, 
ic, l);
+                      sd->tmp.last_insert = l;
+                      break;
+                   }
               }
          }
        if (!l)
@@ -1224,8 +1243,17 @@
    snprintf(buf, sizeof(buf), "%s/%s", sd->realpath, file);
    if (stat(buf, &(ic->info.statinfo)) == -1)
      {
-       free(ic);
-       return NULL;
+       if (sd->config->view.extra_file_source)
+         {
+            snprintf(buf, sizeof(buf), "%s/%s", 
sd->config->view.extra_file_source, file);
+            if (stat(buf, &(ic->info.statinfo)) == -1)
+              {
+                 free(ic);
+                 return NULL;
+              }
+            ic->info.link = 
evas_stringshare_add(sd->config->view.extra_file_source);
+            ic->info.pseudo_link = 1;
+         }
      }
    ic->sd = sd;
    ic->info.file = evas_stringshare_add(file);
@@ -1546,7 +1574,10 @@
                 (!strcmp(ic->info.mime, "image/svg+xml"))
                 )
               {
-                 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, 
ic->info.file);
+                 if (ic->info.pseudo_link)
+                   snprintf(buf, sizeof(buf), "%s/%s", ic->info.link, 
ic->info.file);
+                 else
+                   snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, 
ic->info.file);
                  ic->obj_icon = 
e_thumb_icon_add(evas_object_evas_get(ic->sd->obj));
                  e_thumb_icon_file_set(ic->obj_icon, buf, NULL);
                  e_thumb_icon_size_set(ic->obj_icon, 128, 128);
@@ -1581,7 +1612,10 @@
                 (e_util_glob_case_match(ic->info.file, "*.edj"))
                 )
               {
-                 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, 
ic->info.file);
+                 if (ic->info.pseudo_link)
+                   snprintf(buf, sizeof(buf), "%s/%s", ic->info.link, 
ic->info.file);
+                 else
+                   snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, 
ic->info.file);
                  ic->obj_icon = 
e_thumb_icon_add(evas_object_evas_get(ic->sd->obj));
                  if (ic->sd->config->icon.key_hint)
                    e_thumb_icon_file_set(ic->obj_icon, buf, 
ic->sd->config->icon.key_hint);
@@ -1597,12 +1631,12 @@
                      (e_util_glob_case_match(ic->info.file, "*.eap"))
                      )
               {
-                 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, 
ic->info.file);
-                 ic->obj_icon = 
e_thumb_icon_add(evas_object_evas_get(ic->sd->obj));
-                 e_thumb_icon_file_set(ic->obj_icon, buf, "icon");
-                 e_thumb_icon_size_set(ic->obj_icon, 128, 128);
-                 evas_object_smart_callback_add(ic->obj_icon, "e_thumb_gen", 
_e_fm2_cb_icon_thumb_gen, ic);
-                 _e_fm2_icon_thumb(ic);
+                 if (ic->info.pseudo_link)
+                   snprintf(buf, sizeof(buf), "%s/%s", ic->info.link, 
ic->info.file);
+                 else
+                   snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, 
ic->info.file);
+                 ic->obj_icon = 
edje_object_add(evas_object_evas_get(ic->sd->obj));
+                 edje_object_file_set(ic->obj_icon, buf, "icon");
                  edje_object_part_swallow(ic->obj, "e.swallow.icon", 
ic->obj_icon);
                  evas_object_show(ic->obj_icon);
               }
@@ -1676,9 +1710,12 @@
 {
    char buf[4096], key[256], val[4096];
    FILE *f;
-      Ecore_Desktop *desktop;
+   Ecore_Desktop *desktop;
    
-   snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file);
+   if (ic->info.pseudo_link)
+     snprintf(buf, sizeof(buf), "%s/%s", ic->info.link, ic->info.file);
+   else
+     snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file);
 
    desktop = ecore_desktop_get(buf, NULL);
    if (desktop)
@@ -1827,7 +1864,10 @@
             char buf[4096], *dev = NULL;
             
             if (ic->sd->dev) dev = strdup(ic->sd->dev);
-            snprintf(buf, sizeof(buf), "%s/%s", ic->sd->path, ic->info.file);
+            if (ic->info.pseudo_link)
+              snprintf(buf, sizeof(buf), "%s/%s", ic->info.link, 
ic->info.file);
+            else
+              snprintf(buf, sizeof(buf), "%s/%s", ic->sd->path, ic->info.file);
             e_fm2_path_set(ic->sd->obj, dev, buf);
             E_FREE(dev);
          }
@@ -2144,19 +2184,40 @@
 {
    E_Fm2_Smart_Data *sd;
    struct dirent *dp;
-
+   int len;
+   char buf[4096];
+   
    sd = evas_object_smart_data_get(data);
    if (!sd) return 0;
-   if (!sd->dir) sd->dir = opendir(sd->realpath);
-   if (!sd->dir) goto endscan;
-   
-   dp = readdir(sd->dir);
-   if (!dp) goto endscan;
-   /* no - you don't want the cuirrent and parent dir links listed */
-   if ((!strcmp(dp->d_name, ".")) || (!strcmp(dp->d_name, ".."))) return 1;
-   /* skip dotfiles */
-   if (dp->d_name[0] == '.') return 1;
-   _e_fm2_file_add(data, dp->d_name);
+ 
+   if ((!sd->dir) && (!sd->order))
+     {
+       snprintf(buf, sizeof(buf), "%s/.order", sd->realpath);
+       sd->order = fopen(buf, "rb");
+       if (!sd->order)
+         {
+            sd->dir = opendir(sd->realpath);
+            if (!sd->dir) goto endscan;
+         }
+     }
+
+   if (sd->order)
+     {
+       if (!fgets(buf, sizeof(buf), sd->order)) goto endscan;
+       len = strlen(buf);
+       if ((len > 0) && (buf[len - 1] == '\n')) buf[len - 1] = 0;
+       _e_fm2_file_add(data, buf);
+     }
+   else if (sd->dir)
+     {
+       dp = readdir(sd->dir);
+       if (!dp) goto endscan;
+       /* no - you don't want the cuirrent and parent dir links listed */
+       if ((!strcmp(dp->d_name, ".")) || (!strcmp(dp->d_name, ".."))) return 1;
+       /* skip dotfiles */
+       if (dp->d_name[0] == '.') return 1;
+       _e_fm2_file_add(data, dp->d_name);
+     }
    return 1;
    
    endscan:
@@ -2536,7 +2597,10 @@
        
      }
    
-   snprintf(buf, sizeof(buf), "%s/%s", sd->realpath, ic->info.file);
+   if (ic->info.pseudo_link)
+     snprintf(buf, sizeof(buf), "%s/%s", ic->info.link, ic->info.file);
+   else
+     snprintf(buf, sizeof(buf), "%s/%s", sd->realpath, ic->info.file);
    can_w = 0;
    if (ic->info.link)
      {
@@ -2762,16 +2826,19 @@
    E_Dialog *dialog;
    E_Manager *man;
    E_Container *con;
-   char newpath[PATH_MAX];
-   char oldpath[PATH_MAX];
-   char error[PATH_MAX + 256];
+   char newpath[4096];
+   char oldpath[4096];
+   char error[4096 + 256];
    
    ic = data;
    ic->entry_dialog = NULL;
    if ((text) && (strcmp(text, ic->info.file)))
      {
-       snprintf(newpath, PATH_MAX, "%s/%s", ic->sd->realpath, text);
-       snprintf(oldpath, PATH_MAX, "%s/%s", ic->sd->realpath, ic->info.file);
+       snprintf(newpath, sizeof(newpath), "%s/%s", ic->sd->realpath, text);
+       if (ic->info.pseudo_link)
+         snprintf(oldpath, sizeof(oldpath), "%s/%s", ic->info.link, 
ic->info.file);
+       else
+         snprintf(oldpath, sizeof(oldpath), "%s/%s", ic->sd->realpath, 
ic->info.file);
        
        if (!ecore_file_mv(oldpath, newpath))
          {
@@ -2784,7 +2851,7 @@
             e_dialog_button_add(dialog, _("OK"), NULL, NULL, NULL);
             e_dialog_button_focus_num(dialog, 1);
             e_dialog_title_set(dialog, _("Error"));
-            snprintf(error, PATH_MAX + 256,
+            snprintf(error, sizeof(error),
                      _("Could not rename from <hilight>%s</hilight> to 
<hilight>%s</hilight>"),
                      ic->info.file, text);
             e_dialog_text_set(dialog, error);
@@ -2813,7 +2880,7 @@
    E_Container *con;
    E_Dialog *dialog;
    E_Fm2_Icon *ic;
-   char text[PATH_MAX + 256];
+   char text[4096 + 256];
    
    man = e_manager_current_get();
    if (!man) return;
@@ -2830,7 +2897,7 @@
    e_dialog_button_add(dialog, _("No"), NULL, _e_fm2_file_delete_no_cb, ic);
    e_dialog_button_focus_num(dialog, 1);
    e_dialog_title_set(dialog, _("Confirm Delete"));
-   snprintf(text, PATH_MAX + 256, 
+   snprintf(text, sizeof(text), 
            _("Are you sure you want to delete <br>"
              "<hilight>%s</hilight> ?"),
            ic->info.file);
@@ -2854,17 +2921,20 @@
    E_Manager *man;
    E_Container *con;
    E_Fm2_Icon *ic;
-   char path[PATH_MAX];
+   char buf[4096];
 
    ic = data;
    ic->dialog = NULL;
    
-   snprintf(path, PATH_MAX, "%s/%s", ic->sd->realpath, ic->info.file);
+   if (ic->info.pseudo_link)
+     snprintf(buf, sizeof(buf), "%s/%s", ic->info.link, ic->info.file);
+   else
+     snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file);
 
    /* FIXME: recursive rm might block - need to get smart */
-   if (!(ecore_file_recursive_rm(path)))
+   if (!(ecore_file_recursive_rm(buf)))
      {
-       char text[PATH_MAX + 256];
+       char text[4096 + 256];
        
        man = e_manager_current_get();
        if (!man) return;
@@ -2876,9 +2946,9 @@
        e_dialog_button_add(dialog, _("OK"), NULL, NULL, NULL);
        e_dialog_button_focus_num(dialog, 1);
        e_dialog_title_set(dialog, _("Error"));
-       snprintf(text, PATH_MAX + 256,
+       snprintf(text, sizeof(text),
                 _("Could not delete <br>"
-                  "<hilight>%s</hilight>"), path);
+                  "<hilight>%s</hilight>"), buf);
        e_dialog_text_set(dialog, text);
        e_win_centered_set(dialog->win, 1);
        e_dialog_show(dialog);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- e_fm.h      30 Aug 2006 13:37:35 -0000      1.15
+++ e_fm.h      30 Aug 2006 14:45:33 -0000      1.16
@@ -31,6 +31,7 @@
       unsigned char   selector;
       unsigned char   single_click;
       unsigned char   no_subdir_jump;
+      char           *extra_file_source;
    } view;
    /* display of icons */
    struct {
@@ -94,6 +95,7 @@
    const char       *link;
    struct stat       statinfo;
    unsigned char     mount : 1;
+   unsigned char     pseudo_link : 1;
 };
 
 EAPI int                   e_fm2_init(void);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_apps.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- e_int_config_apps.c 30 Aug 2006 10:45:56 -0000      1.7
+++ e_int_config_apps.c 30 Aug 2006 14:45:33 -0000      1.8
@@ -278,6 +278,7 @@
    fmc_all.view.selector = 1;
    fmc_all.view.single_click = 0;
    fmc_all.view.no_subdir_jump = 0;
+   fmc_all.view.extra_file_source = NULL;
    fmc_all.icon.list.w = 24;
    fmc_all.icon.list.h = 24;
    fmc_all.icon.fixed.w = 1;
@@ -337,6 +338,7 @@
          fmc.view.selector = 1;
          fmc.view.single_click = 0;
          fmc.view.no_subdir_jump = 0;
+        fmc.view.extra_file_source = NULL;
          fmc.icon.list.w = 24;
          fmc.icon.list.h = 24;
          fmc.icon.fixed.w = 1;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_desklock.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- e_int_config_desklock.c     27 Aug 2006 13:59:08 -0000      1.33
+++ e_int_config_desklock.c     30 Aug 2006 14:45:33 -0000      1.34
@@ -586,6 +586,7 @@
    fmc.view.selector = 1;
    fmc.view.single_click = 0;
    fmc.view.no_subdir_jump = 0;
+   fmc.view.extra_file_source = NULL;
    fmc.icon.list.w = 48;
    fmc.icon.list.h = 48;
    fmc.icon.fixed.w = 1;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_icon_themes.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- e_int_config_icon_themes.c  30 Aug 2006 07:10:08 -0000      1.8
+++ e_int_config_icon_themes.c  30 Aug 2006 14:45:33 -0000      1.9
@@ -230,6 +230,7 @@
    fmc.view.selector = 1;
    fmc.view.single_click = 0;
    fmc.view.no_subdir_jump = 0;
+   fmc.view.extra_file_source = NULL;
    fmc.icon.list.w = 24;
    fmc.icon.list.h = 24;
    fmc.icon.fixed.w = 1;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_startup.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- e_int_config_startup.c      26 Aug 2006 11:06:05 -0000      1.17
+++ e_int_config_startup.c      30 Aug 2006 14:45:33 -0000      1.18
@@ -300,6 +300,7 @@
    fmc.view.selector = 1;
    fmc.view.single_click = 0;
    fmc.view.no_subdir_jump = 0;
+   fmc.view.extra_file_source = NULL;
    fmc.icon.list.w = 48;
    fmc.icon.list.h = 48;
    fmc.icon.fixed.w = 1;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_theme.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- e_int_config_theme.c        26 Aug 2006 11:06:05 -0000      1.33
+++ e_int_config_theme.c        30 Aug 2006 14:45:33 -0000      1.34
@@ -283,6 +283,7 @@
    fmc.view.selector = 1;
    fmc.view.single_click = 0;
    fmc.view.no_subdir_jump = 0;
+   fmc.view.extra_file_source = NULL;
    fmc.icon.list.w = 48;
    fmc.icon.list.h = 48;
    fmc.icon.fixed.w = 1;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_wallpaper.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- e_int_config_wallpaper.c    26 Aug 2006 11:06:05 -0000      1.10
+++ e_int_config_wallpaper.c    30 Aug 2006 14:45:33 -0000      1.11
@@ -400,6 +400,7 @@
    fmc.view.selector = 1;
    fmc.view.single_click = 0;
    fmc.view.no_subdir_jump = 0;
+   fmc.view.extra_file_source = NULL;
    fmc.icon.list.w = 48;
    fmc.icon.list.h = 48;
    fmc.icon.fixed.w = 1;
@@ -541,6 +542,7 @@
    fmc.view.selector = 1;
    fmc.view.single_click = 0;
    fmc.view.no_subdir_jump = 0;
+   fmc.view.extra_file_source = NULL;
    fmc.icon.list.w = 48;
    fmc.icon.list.h = 48;
    fmc.icon.fixed.w = 1;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_test.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -3 -r1.73 -r1.74
--- e_test.c    26 Aug 2006 11:06:05 -0000      1.73
+++ e_test.c    30 Aug 2006 14:45:33 -0000      1.74
@@ -536,6 +536,7 @@
    fmc.view.selector = 1;
    fmc.view.single_click = 0;
    fmc.view.no_subdir_jump = 0;
+   fmc.view.extra_file_source = NULL;
    fmc.icon.list.w = 24;
    fmc.icon.list.h = 24;
    fmc.icon.fixed.w = 1;
@@ -575,6 +576,7 @@
    fmc.view.selector = 1;
    fmc.view.single_click = 1;
    fmc.view.no_subdir_jump = 1;
+   fmc.view.extra_file_source = NULL;
    fmc.icon.list.w = 24;
    fmc.icon.list.h = 24;
    fmc.icon.fixed.w = 1;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_thumb_main.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- e_thumb_main.c      19 Aug 2006 01:50:20 -0000      1.12
+++ e_thumb_main.c      30 Aug 2006 14:45:33 -0000      1.13
@@ -323,7 +323,10 @@
        ww = 0;
        hh = 0;
        ext = strrchr(eth->file, '.');
-       if ((ext) && (!strcasecmp(ext, ".edj")) && (eth->key))
+       if ((ext) && (eth->key) &&
+           ((!strcasecmp(ext, ".edj")) ||
+            (!strcasecmp(ext, ".eap")))
+           )
          {
             ww = eth->w;
             hh = eth->h;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_fsel.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- e_widget_fsel.c     28 Aug 2006 01:51:27 -0000      1.31
+++ e_widget_fsel.c     30 Aug 2006 14:45:33 -0000      1.32
@@ -375,6 +375,7 @@
    fmc.view.selector = 1;
    fmc.view.single_click = 1;
    fmc.view.no_subdir_jump = 1;
+   fmc.view.extra_file_source = NULL;
    fmc.icon.list.w = 24;
    fmc.icon.list.h = 24;
    fmc.icon.fixed.w = 1;
@@ -412,6 +413,7 @@
    fmc.view.selector = 1;
    fmc.view.single_click = 0;
    fmc.view.no_subdir_jump = 0;
+   fmc.view.extra_file_source = "/home/raster/.e/e/applications/all";
    fmc.icon.list.w = 24;
    fmc.icon.list.h = 24;
    fmc.icon.fixed.w = 1;



-------------------------------------------------------------------------
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