Commit 31bc1dec authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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)
parent a7c8b446
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
......
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
......
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
......
......@@ -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,11 +487,11 @@ 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 &&
system_unix->afs_statbuf.st_ino == statbuf.st_ino) ||
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment