Enlightenment CVS committal

Author  : gilbertt
Project : misc
Module  : feh

Dir     : misc/feh/src


Modified Files:
        collage.c filelist.c filelist.h index.c options.c slideshow.c 
        thumbnail.c winwidget.c 


Log Message:

Sat Jan 03 19:04:11 EST 2004  Paul Duncan <[EMAIL PROTECTED]>,

  * removed extraneous XFlush
  * switched to global file list length (avoid recalculating it
    constantly)


===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/collage.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -3 -r1.30 -r1.31
--- collage.c   23 Feb 2003 16:35:45 -0000      1.30
+++ collage.c   4 Jan 2004 00:14:13 -0000       1.31
@@ -41,15 +41,12 @@
    feh_file *file = NULL;
    unsigned char trans_bg = 0;
    gib_list *l, *last = NULL;
-   int file_num = 0;
    char *s;
 
    D_ENTER(4);
 
    mode = "collage";
 
-   file_num = gib_list_length(filelist);
-
    /* Use bg image dimensions for default size */
    if (opt.bg && opt.bg_file)
    {
@@ -136,6 +133,7 @@
       if (last)
       {
          filelist = feh_file_remove_from_list(filelist, last);
+         filelist_len--;
          last = NULL;
       }
       D(3,("About to load image %s\n", file->filename));
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/filelist.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -3 -r1.74 -r1.75
--- filelist.c  23 Feb 2003 16:35:45 -0000      1.74
+++ filelist.c  4 Jan 2004 00:14:13 -0000       1.75
@@ -28,10 +28,9 @@
 #include "options.h"
 
 gib_list *filelist = NULL;
+int       filelist_len = 0;
 gib_list *current_file = NULL;
 extern int errno;
-int file_num = 0;
-
 
 static gib_list *rm_filelist = NULL;
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/filelist.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- filelist.h  23 Feb 2003 16:35:45 -0000      1.15
+++ filelist.h  4 Jan 2004 00:14:13 -0000       1.16
@@ -83,6 +83,7 @@
 int feh_cmp_format(void *file1, void *file2);
 
 extern gib_list *filelist;
+extern int       filelist_len;
 extern gib_list *current_file;
 
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/index.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -3 -r1.62 -r1.63
--- index.c     23 Feb 2003 16:35:46 -0000      1.62
+++ index.c     4 Jan 2004 00:14:13 -0000       1.63
@@ -57,14 +57,12 @@
    int thumbnailcount = 0;
    gib_list *l = NULL, *last = NULL;
    feh_file *file = NULL;
-   int file_num = 0, lines;
+   int lines;
    unsigned char trans_bg = 0;
    int index_image_width, index_image_height;
    int x_offset_name = 0, x_offset_dim = 0, x_offset_size = 0;
    char *s;
 
-   file_num = gib_list_length(filelist);
-
    D_ENTER(3);
 
    mode = "index";
@@ -200,7 +198,7 @@
                   "enough to hold all the thumnails you specified (%d). To fit all\n"
                   "the thumnails, either decrease their size, choose a smaller 
font,\n"
                   "or use a larger image (may I recommend %d by %d?)",
-                  opt.limit_w, opt.limit_h, file_num, opt.limit_w, rec_h);
+                  opt.limit_w, opt.limit_h, filelist_len, opt.limit_w, rec_h);
       }
    }
    else if (opt.limit_h)
@@ -346,6 +344,7 @@
       if (last)
       {
          filelist = feh_file_remove_from_list(filelist, last);
+         filelist_len--;
          last = NULL;
       }
       D(4, ("About to load image %s\n", file->filename));
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/options.c,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -3 -r1.152 -r1.153
--- options.c   11 Apr 2003 10:39:38 -0000      1.152
+++ options.c   4 Jan 2004 00:14:13 -0000       1.153
@@ -107,7 +107,8 @@
    if(opt.bgmode)
       D_RETURN_(4);
 
-   if (gib_list_length(filelist) == 0)
+   filelist_len = gib_list_length(filelist);
+   if (!filelist_len)
       show_mini_usage();
 
    check_options();
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/slideshow.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -3 -r1.79 -r1.80
--- slideshow.c 18 Mar 2003 19:08:43 -0000      1.79
+++ slideshow.c 4 Jan 2004 00:14:13 -0000       1.80
@@ -56,6 +56,7 @@
       if (last)
       {
          filelist = feh_file_remove_from_list(filelist, last);
+         filelist_len--;
          last = NULL;
       }
       current_file = l;
@@ -176,17 +177,15 @@
 {
    int success = 0;
    gib_list *last = NULL;
-   int i = 0, file_num = 0;
+   int i = 0;
    int jmp = 1;
    char *s;
 
    D_ENTER(4);
 
-   file_num = gib_list_length(filelist);
-
    /* Without this, clicking a one-image slideshow reloads it. Not very *
       intelligent behaviour :-) */
-   if (file_num < 2)
+   if (filelist_len < 2)
       D_RETURN_(4);
 
    /* Ok. I do this in such an odd way to ensure that if the last or first *
@@ -205,7 +204,7 @@
    }
 
    /* The for loop prevents us looping infinitely */
-   for (i = 0; i < file_num; i++)
+   for (i = 0; i < filelist_len; i++)
    {
       winwidget_free_image(winwid);
       switch (change)
@@ -217,12 +216,12 @@
            current_file = gib_list_jump(filelist, current_file, BACK, 1);
            break;
         case SLIDE_JUMP_FWD:
-           if (file_num < 5)
+           if (filelist_len < 5)
               jmp = 1;
-           else if (file_num < 40)
+           else if (filelist_len < 40)
               jmp = 2;
            else
-              jmp = file_num / 20;
+              jmp = filelist_len / 20;
            if (!jmp)
               jmp = 2;
            current_file = gib_list_jump(filelist, current_file, FORWARD, jmp);
@@ -231,12 +230,12 @@
            change = SLIDE_NEXT;
            break;
         case SLIDE_JUMP_BACK:
-           if (file_num < 5)
+           if (filelist_len < 5)
               jmp = 1;
-           else if (file_num < 40)
+           else if (filelist_len < 40)
               jmp = 2;
            else
-              jmp = file_num / 20;
+              jmp = filelist_len / 20;
            if (!jmp)
               jmp = 2;
            current_file = gib_list_jump(filelist, current_file, BACK, jmp);
@@ -252,6 +251,7 @@
       if (last)
       {
          filelist = feh_file_remove_from_list(filelist, last);
+         filelist_len--;
          last = NULL;
       }
       s = slideshow_create_name(FEH_FILE(current_file->data));
@@ -474,6 +474,7 @@
 
       doomed = current_file;
       slideshow_change_image(winwid, SLIDE_NEXT);
+      filelist_len--;
       if (do_delete)
          filelist = feh_file_rm_and_free(filelist, doomed);
       else
@@ -491,6 +492,7 @@
    else if ((winwid->type == WIN_TYPE_SINGLE)
             || (winwid->type == WIN_TYPE_THUMBNAIL_VIEWER))
    {
+      filelist_len--;
       if (do_delete)
          filelist = feh_file_rm_and_free(filelist, winwid->file);
       else
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/thumbnail.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- thumbnail.c 23 Feb 2003 16:35:47 -0000      1.21
+++ thumbnail.c 4 Jan 2004 00:14:13 -0000       1.22
@@ -61,13 +61,11 @@
    int thumbnailcount = 0;
    feh_file *file = NULL;
    gib_list *l, *last = NULL;
-   int file_num = 0, lines;
+   int lines;
    int index_image_width, index_image_height;
    int x_offset_name = 0, x_offset_dim = 0, x_offset_size = 0;
    char *s;
 
-   file_num = gib_list_length(filelist);
-
    D_ENTER(3);
 
    mode = "thumbnail";
@@ -202,7 +200,7 @@
                   "enough to hold all the thumnails you specified (%d). To fit all\n"
                   "the thumnails, either decrease their size, choose a smaller 
font,\n"
                   "or use a larger image (may I recommend %d by %d?)",
-                  opt.limit_w, opt.limit_h, file_num, opt.limit_w, rec_h);
+                  opt.limit_w, opt.limit_h, filelist_len, opt.limit_w, rec_h);
       }
    }
    else if (opt.limit_h)
@@ -349,6 +347,7 @@
       if (last)
       {
          filelist = feh_file_remove_from_list(filelist, last);
+         filelist_len--;
          last = NULL;
       }
       D(4, ("About to load image %s\n", file->filename));
===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/winwidget.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -3 -r1.116 -r1.117
--- winwidget.c 11 Apr 2003 10:48:37 -0000      1.116
+++ winwidget.c 4 Jan 2004 00:14:13 -0000       1.117
@@ -274,7 +274,7 @@
   name = ret->name ? ret->name : "feh";
   XStoreName(disp, ret->win, name);
   XSetIconName(disp, ret->win, name);
-  XFlush(disp);
+  /* XFlush(disp); */
   D_RETURN_(4);
 }
 




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to