Revision: 1759
          http://geeqie.svn.sourceforge.net/geeqie/?rev=1759&view=rev
Author:   nadvornik
Date:     2009-06-21 20:14:53 +0000 (Sun, 21 Jun 2009)

Log Message:
-----------
improved file list update priority

- update list with lower priority than the priority of file operations
- make sure that it is updated at least once per 2 seconds

Modified Paths:
--------------
    trunk/src/typedefs.h
    trunk/src/view_file.c

Modified: trunk/src/typedefs.h
===================================================================
--- trunk/src/typedefs.h        2009-06-21 13:28:02 UTC (rev 1758)
+++ trunk/src/typedefs.h        2009-06-21 20:14:53 UTC (rev 1759)
@@ -752,6 +752,7 @@
        
        /* refresh */
        guint refresh_idle_id; /* event source id */
+       time_t time_refresh_set; /* time when refresh_idle_id was set */
 
        /* file list for edit menu */
        GList *editmenu_fd_list;

Modified: trunk/src/view_file.c
===================================================================
--- trunk/src/view_file.c       2009-06-21 13:28:02 UTC (rev 1758)
+++ trunk/src/view_file.c       2009-06-21 20:14:53 UTC (rev 1759)
@@ -1010,8 +1010,17 @@
 {
        if (!vf->refresh_idle_id)
                {
-               vf->refresh_idle_id = g_idle_add(vf_refresh_idle_cb, vf);
+               vf->time_refresh_set = time(NULL);
+               /* file operations run with G_PRIORITY_DEFAULT_IDLE */
+               vf->refresh_idle_id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE + 
50, vf_refresh_idle_cb, vf, NULL);
                }
+       else if (time(NULL) - vf->time_refresh_set > 1)
+               {
+               /* more than 1 sec since last update - increase priority */
+               vf_refresh_idle_cancel(vf);
+               vf->time_refresh_set = time(NULL);
+               vf->refresh_idle_id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE - 
50, vf_refresh_idle_cb, vf, NULL);
+               }
 }
 
 void vf_notify_cb(FileData *fd, NotifyType type, gpointer data)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn

Reply via email to