[gthumb] Fixed bug 584748 – Extensionless images aren't shown



commit 465f42c59806caebfe2d2d178ff83976f13f6fdd
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Thu Jun 4 12:59:49 2009 -0400

    Fixed bug 584748 â?? Extensionless images aren't shown
---
 libgthumb/catalog.c    |    8 +++++---
 libgthumb/file-utils.c |    6 +++++-
 libgthumb/file-utils.h |    3 ++-
 src/gth-browser.c      |    6 ++++--
 src/gth-dir-list.c     |    2 +-
 5 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/libgthumb/catalog.c b/libgthumb/catalog.c
index 0093f29..99501d9 100644
--- a/libgthumb/catalog.c
+++ b/libgthumb/catalog.c
@@ -32,9 +32,11 @@
 #include "catalog.h"
 #include "typedefs.h"
 #include "file-utils.h"
+#include "gconf-utils.h"
 #include "gfile-utils.h"
 #include "glib-utils.h"
 #include "gthumb-error.h"
+#include "preferences.h"
 
 
 #define SORT_FIELD "# sort: "
@@ -499,7 +501,8 @@ catalog_get_file_data_list (Catalog         *catalog,
 {
 	GList    *list = NULL;
 	GList    *scan;
-	
+	gboolean  fast_file_type = eel_gconf_get_boolean (PREF_FAST_FILE_TYPE, TRUE);	
+
 	/* FIXME: make this function async */
 	
 	for (scan = catalog->list; scan; scan = scan->next) {
@@ -507,8 +510,7 @@ catalog_get_file_data_list (Catalog         *catalog,
 		FileData *fd;
 		
 		fd = file_data_new (path);
-		file_data_update (fd);  /* FIXME: when to update the mime-type */
-		if (file_filter (fd, TRUE, FALSE))
+		if (file_filter (fd, TRUE, FALSE, fast_file_type))
 			list = g_list_prepend (list, fd);
 	}
 	list = g_list_reverse (list);
diff --git a/libgthumb/file-utils.c b/libgthumb/file-utils.c
index 4d23bba..1c83952 100644
--- a/libgthumb/file-utils.c
+++ b/libgthumb/file-utils.c
@@ -435,8 +435,12 @@ dir_list_filter_and_sort (GList    *dir_list,
 gboolean
 file_filter (FileData *file,
 	     gboolean  show_hidden_files,
-	     gboolean  show_only_images)
+	     gboolean  show_only_images,
+	     gboolean  fast_file_type)
 {
+	if (!fast_file_type)
+		file_data_update_mime_type (file, fast_file_type);	
+
 	if (file->mime_type == NULL)
 		return FALSE;
 
diff --git a/libgthumb/file-utils.h b/libgthumb/file-utils.h
index 0f066ca..b4d4340 100644
--- a/libgthumb/file-utils.h
+++ b/libgthumb/file-utils.h
@@ -95,7 +95,8 @@ GList *             dir_list_filter_and_sort      (GList            *dir_list,
 						   gboolean          show_dot_files);
 gboolean            file_filter                   (FileData         *file,
 	     					   gboolean          show_hidden_files,
-	     					   gboolean          show_only_images);
+	     					   gboolean          show_only_images,
+						   gboolean	     fast_file_type);
 
 typedef void (*VisitFunc) (char *real_file, char *rc_file, gpointer data);
 gboolean            visit_rc_directory_sync       (const char       *rc_dir,
diff --git a/src/gth-browser.c b/src/gth-browser.c
index 67fa974..03921bd 100644
--- a/src/gth-browser.c
+++ b/src/gth-browser.c
@@ -5508,8 +5508,10 @@ gth_browser_notify_files_created (GthBrowser *browser,
 			FileData *file;
 			
 			file = file_data_new (path);
-			file_data_update_all (file, browser->priv->fast_file_type);
-			if (file_filter (file, browser->priv->show_hidden_files, browser->priv->show_only_images))
+			if (file_filter (file,
+					 browser->priv->show_hidden_files,
+					 browser->priv->show_only_images,
+					 browser->priv->fast_file_type))
 				created_in_current_dir = g_list_prepend (created_in_current_dir, file);
 			else
 				file_data_unref (file);
diff --git a/src/gth-dir-list.c b/src/gth-dir-list.c
index 5a93b6b..cc15ea3 100644
--- a/src/gth-dir-list.c
+++ b/src/gth-dir-list.c
@@ -577,7 +577,7 @@ gth_dir_list_filter_func (PathListData  *pld,
 			  gpointer       data)
 {
 	GthDirList *dir_list = data;
-	return file_filter (file, dir_list->show_dot_files, dir_list->show_only_images);
+	return file_filter (file, dir_list->show_dot_files, dir_list->show_only_images, pld->fast_file_type);
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]