Fix an error in the cache timeout logic. (#166601, Morten Welinder)

2005-06-23  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_folder):
	Fix an error in the cache timeout logic.  (#166601, Morten
	Welinder)
This commit is contained in:
Matthias Clasen 2005-06-23 20:44:27 +00:00 committed by Matthias Clasen
parent a7c8b44628
commit 31bc1dec02
4 changed files with 21 additions and 5 deletions

View File

@ -1,5 +1,9 @@
2005-06-23 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_folder):
Fix an error in the cache timeout logic. (#166601, Morten
Welinder)
* gtk/gtktreeview.c (gtk_tree_view_key_press): Change the
keynav for header reordering and resizing to Alt-arrows and
Shift-Alt-arrows, following a proposal by the keynav

View File

@ -1,5 +1,9 @@
2005-06-23 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_folder):
Fix an error in the cache timeout logic. (#166601, Morten
Welinder)
* gtk/gtktreeview.c (gtk_tree_view_key_press): Change the
keynav for header reordering and resizing to Alt-arrows and
Shift-Alt-arrows, following a proposal by the keynav

View File

@ -1,5 +1,9 @@
2005-06-23 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_folder):
Fix an error in the cache timeout logic. (#166601, Morten
Welinder)
* gtk/gtktreeview.c (gtk_tree_view_key_press): Change the
keynav for header reordering and resizing to Alt-arrows and
Shift-Alt-arrows, following a proposal by the keynav

View File

@ -405,7 +405,7 @@ gtk_file_system_unix_get_folder (GtkFileSystem *file_system,
GtkFileFolderUnix *folder_unix;
const char *filename;
char *filename_copy;
time_t now = time (NULL);
gboolean set_asof = FALSE;
system_unix = GTK_FILE_SYSTEM_UNIX (file_system);
@ -419,8 +419,8 @@ gtk_file_system_unix_get_folder (GtkFileSystem *file_system,
if (folder_unix)
{
g_free (filename_copy);
if (now - folder_unix->asof >= FOLDER_CACHE_LIFETIME &&
folder_unix->stat_info)
if (folder_unix->stat_info &&
time (NULL) - folder_unix->asof >= FOLDER_CACHE_LIFETIME)
{
#if 0
g_print ("Cleaning out cached directory %s\n", filename);
@ -430,6 +430,7 @@ gtk_file_system_unix_get_folder (GtkFileSystem *file_system,
folder_unix->have_mime_type = FALSE;
folder_unix->have_stat = FALSE;
folder_unix->have_hidden = FALSE;
set_asof = TRUE;
}
g_object_ref (folder_unix);
@ -486,10 +487,10 @@ gtk_file_system_unix_get_folder (GtkFileSystem *file_system,
folder_unix->filename = filename_copy;
folder_unix->types = types;
folder_unix->stat_info = NULL;
folder_unix->asof = now;
folder_unix->have_mime_type = FALSE;
folder_unix->have_stat = FALSE;
folder_unix->have_hidden = FALSE;
set_asof = TRUE;
if ((system_unix->have_afs &&
system_unix->afs_statbuf.st_dev == statbuf.st_dev &&
@ -512,6 +513,9 @@ gtk_file_system_unix_get_folder (GtkFileSystem *file_system,
if ((types & GTK_FILE_INFO_MIME_TYPE) != 0)
fill_in_mime_type (folder_unix);
if (set_asof)
folder_unix->asof = time (NULL);
return GTK_FILE_FOLDER (folder_unix);
}