gthumb r2464 - in trunk: . libgthumb libgthumb/jpegutils src



Author: mjc
Date: Mon Dec 22 18:34:34 2008
New Revision: 2464
URL: http://svn.gnome.org/viewvc/gthumb?rev=2464&view=rev

Log:
2008-12-22  Michael J. Chudobiak  <mjc svn gnome org>

        * many files: Ported file-data.c from gnome_vfs to gfile.
        Simplified file-data.c slightly and removed some redundant functions.



Modified:
   trunk/ChangeLog
   trunk/libgthumb/catalog.c
   trunk/libgthumb/comments.c
   trunk/libgthumb/dlg-save-image.c
   trunk/libgthumb/file-data.c
   trunk/libgthumb/file-data.h
   trunk/libgthumb/file-utils.c
   trunk/libgthumb/gth-file-list.c
   trunk/libgthumb/image-loader.c
   trunk/libgthumb/image-viewer.c
   trunk/libgthumb/jpegutils/jpegtran.c
   trunk/libgthumb/thumb-loader.c
   trunk/src/catalog-png-exporter.c
   trunk/src/catalog-web-exporter.c
   trunk/src/dlg-comment.c
   trunk/src/dlg-convert.c
   trunk/src/dlg-photo-importer.c
   trunk/src/dlg-scripts.c
   trunk/src/dlg-search.c
   trunk/src/gth-batch-op.c
   trunk/src/gth-browser.c
   trunk/src/gth-fullscreen.c
   trunk/src/gth-viewer.c
   trunk/src/gthumb-preloader.c

Modified: trunk/libgthumb/catalog.c
==============================================================================
--- trunk/libgthumb/catalog.c	(original)
+++ trunk/libgthumb/catalog.c	Mon Dec 22 18:34:34 2008
@@ -525,7 +525,7 @@
 		char     *path = scan->data;
 		FileData *fd;
 		
-		fd = file_data_new (path, NULL);
+		fd = file_data_new (path);
 		file_data_update (fd);  /* FIXME: when to update the mime-type */
 		if (file_filter (fd, TRUE, FALSE))
 			list = g_list_prepend (list, fd);

Modified: trunk/libgthumb/comments.c
==============================================================================
--- trunk/libgthumb/comments.c	(original)
+++ trunk/libgthumb/comments.c	Mon Dec 22 18:34:34 2008
@@ -390,7 +390,7 @@
 	char        *metadata_string = NULL;
 	time_t	     metadata_time = 0;
 
-	file = file_data_new (uri, NULL);
+	file = file_data_new (uri);
 	file_data_update_all (file, FALSE);
 
 	data = comment_data_new ();
@@ -473,7 +473,7 @@
         char      *buf;
         struct tm  tm;
 
-        file = file_data_new (uri, NULL);
+        file = file_data_new (uri);
         file_data_update_all (file, FALSE);
 
 	add_metadata = simple_add_metadata (add_metadata, TAG_NAME_SETS[COMMENT_TAG_NAMES][0], data->comment);

Modified: trunk/libgthumb/dlg-save-image.c
==============================================================================
--- trunk/libgthumb/dlg-save-image.c	(original)
+++ trunk/libgthumb/dlg-save-image.c	Mon Dec 22 18:34:34 2008
@@ -169,7 +169,7 @@
 	pixbuf = g_object_get_data (G_OBJECT (file_sel), "pixbuf");
 	data = g_object_get_data (G_OBJECT (file_sel), "data");
 
-	file = file_data_new (gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (file_sel)), NULL);
+	file = file_data_new (gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (file_sel)));
 
 	opt_menu = g_object_get_data (G_OBJECT (file_sel), "opt_menu");
 	idx = gtk_option_menu_get_history (GTK_OPTION_MENU (opt_menu));

Modified: trunk/libgthumb/file-data.c
==============================================================================
--- trunk/libgthumb/file-data.c	(original)
+++ trunk/libgthumb/file-data.c	Mon Dec 22 18:34:34 2008
@@ -22,13 +22,10 @@
 
 #include <string.h>
 #include <glib.h>
-#include <libgnomevfs/gnome-vfs-types.h>
-#include <libgnomevfs/gnome-vfs-file-info.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
 #include "file-data.h"
 #include "glib-utils.h"
 #include "file-utils.h"
+#include "gfile-utils.h"
 #include "comments.h"
 #include "gth-exif-utils.h"
 
@@ -58,9 +55,54 @@
 }
 
 
+static void
+load_info (FileData *fd)
+{
+	GFileInfo *info;
+	GFile     *gfile;
+	GError    *error = NULL;
+	GTimeVal   tv;
+
+	if (fd->display_name)
+		g_free (fd->display_name);
+
+	gfile = gfile_new (fd->path);
+	/* FIXME: do we want to read the mime type here? */
+	info = g_file_query_info (gfile, 
+				  G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME ","
+				  G_FILE_ATTRIBUTE_STANDARD_SIZE ","
+				  G_FILE_ATTRIBUTE_TIME_CHANGED ","
+				  G_FILE_ATTRIBUTE_TIME_MODIFIED ","
+				  G_FILE_ATTRIBUTE_ACCESS_CAN_READ,
+                                  G_FILE_QUERY_INFO_NONE,
+                                  NULL,
+                                  &error);
+
+        if (error == NULL) {
+		fd->size = g_file_info_get_size (info);
+		fd->ctime = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_CHANGED);
+		g_file_info_get_modification_time (info, &tv);
+		fd->mtime = tv.tv_sec;
+		fd->display_name = g_strdup (g_file_info_get_display_name (info));
+		fd->can_read = g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ);
+        } else {
+                gfile_warning ("Failed to get file information", gfile, error);
+                g_error_free (error);
+
+		fd->size = (goffset) 0;
+		fd->ctime = (time_t) 0;
+		fd->mtime = (time_t) 0;
+		fd->display_name = get_utf8_display_name_from_uri (fd->name);
+		fd->can_read = TRUE;
+	}
+
+	g_object_unref (info);
+	g_object_unref (gfile);
+}
+
+
 FileData *
-file_data_new (const char       *path,
-	       GnomeVFSFileInfo *info)
+file_data_new (const char *path)
 {
 	FileData *fd;
 
@@ -69,25 +111,8 @@
 	fd->ref = 1;
 	fd->path = add_scheme_if_absent (path);
 	fd->name = file_name_from_path (fd->path);
-	fd->display_name = get_utf8_display_name_from_uri (fd->name);
-	if (info != NULL) {
-		if (info->valid_fields | GNOME_VFS_FILE_INFO_FIELDS_SIZE)
-			fd->size = info->size;
-		if (info->valid_fields | GNOME_VFS_FILE_INFO_FIELDS_CTIME)
-			fd->ctime = info->ctime;
-		if (info->valid_fields | GNOME_VFS_FILE_INFO_FIELDS_MTIME)
-			fd->mtime = info->mtime;
-		if (info->valid_fields | GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE)
-			fd->mime_type = get_static_string (info->mime_type);
-		if (info->valid_fields | GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS)
-			fd->can_read = info->permissions && GNOME_VFS_PERM_ACCESS_READABLE;	
-	}
-	else {
-		fd->size = (goffset) 0;
-		fd->ctime = (time_t) 0;
-		fd->mtime = (time_t) 0;
-		fd->can_read = TRUE;
-	}
+
+	load_info (fd);
 
 	/* The Exif DateTime tag is only recorded on an as-needed basis during
 	   DateTime sorts. The tag in memory is refreshed if the file mtime has
@@ -105,21 +130,6 @@
 
 
 FileData *
-file_data_new_from_local_path (const char *path)
-{
-	FileData *fd;
-	char     *uri;
-	
-	uri = get_uri_from_local_path (path);
-	fd = file_data_new (uri, NULL);
-	file_data_update (fd);
-	g_free (uri);
-	
-	return fd;
-}
-
-
-FileData *
 file_data_ref (FileData *fd)
 {
 	g_return_val_if_fail (fd != NULL, NULL);
@@ -182,100 +192,16 @@
 void
 file_data_update (FileData *fd)
 {
-	GnomeVFSFileInfo *info;
-	GnomeVFSResult    result;
-	time_t		  old_mtime;
-
 	g_return_if_fail (fd != NULL);
 
 	fd->error = FALSE;
 	fd->thumb_loaded = FALSE;
 	fd->thumb_created = FALSE;
-
-	old_mtime = fd->mtime;
-
-	info = gnome_vfs_file_info_new ();
-	result = gnome_vfs_get_file_info (fd->path,
-					  info,
-					  (GNOME_VFS_FILE_INFO_FOLLOW_LINKS 
-					   | GNOME_VFS_FILE_INFO_GET_MIME_TYPE 
-					   | GNOME_VFS_FILE_INFO_FORCE_FAST_MIME_TYPE
-					   | GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS));
-
-	if (result != GNOME_VFS_OK) {
-		fd->error = TRUE;
-		fd->size = 0L;
-		fd->mtime = 0;
-		fd->ctime = 0;
-		fd->mime_type = NULL;
-		fd->can_read = TRUE;
-		return;
-	}
-
 	fd->name = file_name_from_path (fd->path);
 
-	g_free (fd->display_name);
-	fd->display_name = get_utf8_display_name_from_uri (fd->name);
-
-	fd->mime_type = get_static_string (info->mime_type);
-	fd->size = info->size;
-	fd->mtime = info->mtime;
-	fd->ctime = info->ctime;
-	fd->can_read = info->permissions && GNOME_VFS_PERM_ACCESS_READABLE;
+	load_info (fd);
 
 	fd_free_metadata (fd);
-
-	gnome_vfs_file_info_unref (info);
-}
-
-
-/* doesn't update the mime-type */
-void
-file_data_update_info (FileData *fd)
-{
-	GnomeVFSFileInfo *info;
-	GnomeVFSResult    result;
-	time_t            old_mtime;
-
-	g_return_if_fail (fd != NULL);
-
-	fd->error = FALSE;
-	fd->thumb_loaded = FALSE;
-	fd->thumb_created = FALSE;
-
-	old_mtime = fd->mtime;
-
-	info = gnome_vfs_file_info_new ();
-	result = gnome_vfs_get_file_info (fd->path,
-					  info,
-					  (GNOME_VFS_FILE_INFO_FOLLOW_LINKS 
-					   | GNOME_VFS_FILE_INFO_GET_MIME_TYPE 
-					   | GNOME_VFS_FILE_INFO_FORCE_FAST_MIME_TYPE
-					   | GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS));
-
-	if (result != GNOME_VFS_OK) {
-		fd->error = TRUE;
-		fd->size = 0L;
-		fd->mtime = 0;
-		fd->ctime = 0;
-		fd->mime_type = NULL;
-		fd->can_read = TRUE;
-		return;
-	}
-
-	fd->name = file_name_from_path (fd->path);
-
-	g_free (fd->display_name);
-	fd->display_name = get_utf8_display_name_from_uri (fd->name);
-
-	fd->size = info->size;
-	fd->mtime = info->mtime;
-	fd->ctime = info->ctime;
-	fd->can_read = info->permissions && GNOME_VFS_PERM_ACCESS_READABLE;
-
-        fd_free_metadata (fd);
-
-	gnome_vfs_file_info_unref (info);
 }
 
 
@@ -291,7 +217,7 @@
 file_data_update_all (FileData *fd,
 		      gboolean  fast_mime_type)
 {
-	file_data_update_info (fd);
+	file_data_update (fd);
 	file_data_update_mime_type (fd, fast_mime_type);
 }
 
@@ -350,7 +276,7 @@
 	
 	for (scan = list; scan; scan = scan->next) {
 		char *path = scan->data;
-		result = g_list_prepend (result, file_data_new (path, NULL));
+		result = g_list_prepend (result, file_data_new (path));
 	}
 	
 	return g_list_reverse (result);

Modified: trunk/libgthumb/file-data.h
==============================================================================
--- trunk/libgthumb/file-data.h	(original)
+++ trunk/libgthumb/file-data.h	Mon Dec 22 18:34:34 2008
@@ -24,7 +24,7 @@
 #define FILE_DATA_H
 
 #include <glib.h>
-#include <libgnomevfs/gnome-vfs-file-info.h>
+#include <glib-object.h>
 #include <time.h>
 #include <sys/stat.h>
 #include "comments.h"
@@ -60,16 +60,13 @@
 #define GTH_TYPE_FILE_DATA (file_data_get_type ())
 
 GType        file_data_get_type            (void);
-FileData *   file_data_new                 (const char       *path,
-					    GnomeVFSFileInfo *info);
-FileData *   file_data_new_from_local_path (const char       *path);				   
+FileData *   file_data_new                 (const char       *path);
 FileData *   file_data_dup                 (FileData         *fd);
 FileData *   file_data_ref                 (FileData         *fd);
 void         file_data_unref               (FileData         *fd);
 void         file_data_set_path            (FileData         *fd,
 					    const char       *path);
 void         file_data_update              (FileData         *fd);
-void         file_data_update_info         (FileData         *fd);
 void         file_data_update_mime_type    (FileData         *fd,
 					    gboolean          fast_mime_type);
 void         file_data_update_all          (FileData         *fd,

Modified: trunk/libgthumb/file-utils.c
==============================================================================
--- trunk/libgthumb/file-utils.c	(original)
+++ trunk/libgthumb/file-utils.c	Mon Dec 22 18:34:34 2008
@@ -163,7 +163,7 @@
 			full_uri = gnome_vfs_uri_append_file_name (pli->uri, info->name);
 			txt_uri = gnome_vfs_uri_to_string (full_uri, GNOME_VFS_URI_HIDE_NONE);
 			
-			file = file_data_new (txt_uri, info);
+			file = file_data_new (txt_uri);
 			file_data_update_mime_type (file, pli->fast_file_type);
 			if ((pli->filter_func != NULL) && pli->filter_func (pli, file, pli->filter_data))
 				pli->files = g_list_prepend (pli->files, file);
@@ -300,7 +300,7 @@
 				d_list = g_list_prepend (d_list, s_uri);
 		} 
 		else if (info->type == GNOME_VFS_FILE_TYPE_REGULAR)
-			f_list = g_list_prepend (f_list, file_data_new (s_uri, info));
+			f_list = g_list_prepend (f_list, file_data_new (s_uri));
 		else
 			g_free (s_uri);
 	}
@@ -2796,7 +2796,7 @@
 	if (error == NULL) {
 		FileData *cache_file;
 		
-		cache_file = file_data_new (uri, NULL);
+		cache_file = file_data_new (uri);
 		file_data_update (cache_file);
 		cache_used_space += cache_file->size;
 		cache_files = g_list_prepend (cache_files, cache_file);

Modified: trunk/libgthumb/gth-file-list.c
==============================================================================
--- trunk/libgthumb/gth-file-list.c	(original)
+++ trunk/libgthumb/gth-file-list.c	Mon Dec 22 18:34:34 2008
@@ -1752,7 +1752,7 @@
 	if (fd == NULL)
 		return;
 
-	file_data_update_info (fd);
+	file_data_update (fd);
 
 	file_list->priv->thumb_pos = pos;
 	if (file_list->priv->thumb_fd != NULL)
@@ -1789,7 +1789,7 @@
 			continue;
 
 		fd = gth_file_view_get_image_data (file_list->view, pos);
-		file_data_update_info (fd);
+		file_data_update (fd);
 		file_data_unref (fd);
 	}
 }

Modified: trunk/libgthumb/image-loader.c
==============================================================================
--- trunk/libgthumb/image-loader.c	(original)
+++ trunk/libgthumb/image-loader.c	Mon Dec 22 18:34:34 2008
@@ -398,7 +398,7 @@
 {
 	FileData *file;
 	
-	file = file_data_new (path, NULL);
+	file = file_data_new (path);
 	if (mime_type != NULL)
 		file->mime_type = get_static_string (mime_type);
 	else

Modified: trunk/libgthumb/image-viewer.c
==============================================================================
--- trunk/libgthumb/image-viewer.c	(original)
+++ trunk/libgthumb/image-viewer.c	Mon Dec 22 18:34:34 2008
@@ -1252,7 +1252,7 @@
 
 	lidata = g_new (LoadImageData, 1);
 	lidata->viewer = viewer;
-	lidata->file = file_data_new (path, NULL);
+	lidata->file = file_data_new (path);
 	image_loader_stop (priv->loader, (DoneFunc) load_image__step2, lidata);
 }
 

Modified: trunk/libgthumb/jpegutils/jpegtran.c
==============================================================================
--- trunk/libgthumb/jpegutils/jpegtran.c	(original)
+++ trunk/libgthumb/jpegutils/jpegtran.c	Mon Dec 22 18:34:34 2008
@@ -348,7 +348,7 @@
 	fclose (output_file);
 
 	/* Update Exif data */
-	FileData *file = file_data_new (output_filename, NULL);
+	FileData *file = file_data_new (output_filename);
 	file_data_update_all (file, FALSE);
 	update_metadata (file);
 	update_exif_dimensions (file->metadata, transformation);

Modified: trunk/libgthumb/thumb-loader.c
==============================================================================
--- trunk/libgthumb/thumb-loader.c	(original)
+++ trunk/libgthumb/thumb-loader.c	Mon Dec 22 18:34:34 2008
@@ -353,7 +353,7 @@
 	g_return_if_fail (tl != NULL);
 	g_return_if_fail (path != NULL);
 
-	fd = file_data_new (path, NULL);
+	fd = file_data_new (path);
 	file_data_update (fd); 
 	thumb_loader_set_file (tl, fd);
 }

Modified: trunk/src/catalog-png-exporter.c
==============================================================================
--- trunk/src/catalog-png-exporter.c	(original)
+++ trunk/src/catalog-png-exporter.c	Mon Dec 22 18:34:34 2008
@@ -894,7 +894,7 @@
 		       0,
 		       ((float) ++ce->n_files_done) / (ce->n_files + 1));	
 
-	file = file_data_new ((char*) ce->current_file->data, NULL);
+	file = file_data_new ((char*) ce->current_file->data);
 	update_file_from_cache (file, copy_current_file_to_destination_done, ce);
 	
 	file_data_unref (file);

Modified: trunk/src/catalog-web-exporter.c
==============================================================================
--- trunk/src/catalog-web-exporter.c	(original)
+++ trunk/src/catalog-web-exporter.c	Mon Dec 22 18:34:34 2008
@@ -2716,7 +2716,7 @@
 			GthTransform  transform;
 		
 			FileData *fd;
-			fd = file_data_new (uri, NULL);
+			fd = file_data_new (uri);
 			transform = get_orientation_from_fd (fd);
 			
 			if (transform > 1) {

Modified: trunk/src/dlg-comment.c
==============================================================================
--- trunk/src/dlg-comment.c	(original)
+++ trunk/src/dlg-comment.c	Mon Dec 22 18:34:34 2008
@@ -141,7 +141,7 @@
 	
 	FileData *file;
 
-	file = file_data_new (filename, NULL);
+	file = file_data_new (filename);
         file_data_update_all (file, FALSE);
 
 	switch (idx) {
@@ -298,7 +298,7 @@
 
 	gtk_widget_set_sensitive (data->date_dateedit, idx == FOLLOWING_DATE);
 
-	file = file_data_new (first_image, NULL);
+	file = file_data_new (first_image);
         file_data_update_all (file, FALSE);
 
 	switch (idx) {
@@ -479,7 +479,7 @@
 	data->have_exif_data = FALSE;
 	for (scan = data->file_list; scan; scan = scan->next) {
 		FileData *file;
-		file = file_data_new (scan->data, NULL);
+		file = file_data_new (scan->data);
                 file_data_update_all (file, FALSE);
 		if (get_exif_time (file)) {
 			data->have_exif_data = TRUE;

Modified: trunk/src/dlg-convert.c
==============================================================================
--- trunk/src/dlg-convert.c	(original)
+++ trunk/src/dlg-convert.c	Mon Dec 22 18:34:34 2008
@@ -278,7 +278,7 @@
 	g_free (old_local_file);
 	file_data_unref (fd_old);
 	
-	fd = file_data_new (data->new_path, NULL);
+	fd = file_data_new (data->new_path);
 	update_file_from_cache (fd, save_image_and_remove_original_step2, data);
 	file_data_unref (fd);
 

Modified: trunk/src/dlg-photo-importer.c
==============================================================================
--- trunk/src/dlg-photo-importer.c	(original)
+++ trunk/src/dlg-photo-importer.c	Mon Dec 22 18:34:34 2008
@@ -832,14 +832,14 @@
 		GdkPixbuf *pixbuf;
 		FileData  *fdata;
 
-		tmp_file = file_data_new_from_local_path (tmp_filename);
+		tmp_file = file_data_new (tmp_filename);
 		file_data_update_mime_type (tmp_file, FALSE); /* FIXME: always slow mime type ? */
 		
 		pixbuf = gth_pixbuf_new_from_file (tmp_file, NULL, THUMB_SIZE, THUMB_SIZE, NULL);
 		if (pixbuf == NULL)
 			pixbuf = get_mime_type_icon (data, tmp_file);
 
-		fdata = file_data_new (camera_path, NULL);
+		fdata = file_data_new (camera_path);
 		gth_image_list_append_with_data (GTH_IMAGE_LIST (data->image_list),
 						 pixbuf,
 						 camera_filename,
@@ -1307,7 +1307,7 @@
 			FileData *file;
 
 			/* Name a subfolder based on the exif date */
-                        file = file_data_new (local_path, NULL);
+                        file = file_data_new (local_path);
                         file_data_update_all (file, FALSE);
 			exif_date = get_exif_time_or_mtime (file);
 			file_data_unref (file);
@@ -1481,7 +1481,7 @@
 	const char *uri = aodata->scan->data;
 	FileData   *file;
 	
-	file = file_data_new (uri, NULL);
+	file = file_data_new (uri);
 
         if (data->msg_text != NULL)
 		g_free (data->msg_text);
@@ -1550,7 +1550,7 @@
 		FileData     *fd;
 		GthTransform  transform;
 
-		fd = file_data_new (uri, NULL);
+		fd = file_data_new (uri);
 		file_data_update (fd);
 
 		if (data->msg_text != NULL)

Modified: trunk/src/dlg-scripts.c
==============================================================================
--- trunk/src/dlg-scripts.c	(original)
+++ trunk/src/dlg-scripts.c	Mon Dec 22 18:34:34 2008
@@ -245,7 +245,7 @@
 		if (!prompt_mode) {
 			const gint date_str_replacement_size = date_str->len + 128;
 
-			FileData* fd = file_data_new_from_local_path (filename);
+			FileData* fd = file_data_new (filename);
 			time_t exif_time = get_exif_time_or_mtime (fd);
 			file_data_unref(fd);
 

Modified: trunk/src/dlg-search.c
==============================================================================
--- trunk/src/dlg-search.c	(original)
+++ trunk/src/dlg-search.c	Mon Dec 22 18:34:34 2008
@@ -1029,7 +1029,7 @@
 			if (file_respects_search_criteria (data, unesc_uri)) {
 				FileData *file;
 				
-				file = file_data_new (str_uri, info);
+				file = file_data_new (str_uri);
 				file_data_update_mime_type (file, data->fast_file_type);				
 				files = g_list_prepend (files, file);
 			}

Modified: trunk/src/gth-batch-op.c
==============================================================================
--- trunk/src/gth-batch-op.c	(original)
+++ trunk/src/gth-batch-op.c	Mon Dec 22 18:34:34 2008
@@ -497,7 +497,7 @@
 	g_free (old_local_file);
 	file_data_unref (fd_old);
 	
-	fd = file_data_new (PD(bop)->new_path, NULL);
+	fd = file_data_new (PD(bop)->new_path);
 	update_file_from_cache (fd, save_image_and_remove_original_step2, bop);
 	file_data_unref (fd);
 }

Modified: trunk/src/gth-browser.c
==============================================================================
--- trunk/src/gth-browser.c	(original)
+++ trunk/src/gth-browser.c	Mon Dec 22 18:34:34 2008
@@ -5528,7 +5528,7 @@
 		if (same_uri (parent_dir, current_dir)) {
 			FileData *file;
 			
-			file = file_data_new (path, NULL);
+			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))
 				created_in_current_dir = g_list_prepend (created_in_current_dir, file);
@@ -8282,7 +8282,7 @@
 		return FALSE;
 
 	/* update the mtime in order to reload the image if required. */
-	file_data_update_info (browser->priv->image);
+	file_data_update (browser->priv->image);
 
 	browser->priv->image_position = gth_file_list_pos_from_path (browser->priv->file_list, browser->priv->image->path);
 	if (browser->priv->image_position >= 0) {
@@ -8359,7 +8359,7 @@
 		return;
 	}
 
-	file_data_update_info (file);
+	file_data_update (file);
 
 	if (! priv->image_modified
 	    && (priv->image != NULL)
@@ -8399,7 +8399,7 @@
 {
 	FileData *file;
 	
-	file = file_data_new (filename, NULL);
+	file = file_data_new (filename);
 	file_data_update_all (file, FALSE);
 	gth_browser_load_image (browser, file);
 	file_data_unref (file);

Modified: trunk/src/gth-fullscreen.c
==============================================================================
--- trunk/src/gth-fullscreen.c	(original)
+++ trunk/src/gth-fullscreen.c	Mon Dec 22 18:34:34 2008
@@ -1350,7 +1350,7 @@
 		FileData *file;
 		GList    *deleted;
 
-		file = file_data_new (scan->data, NULL);
+		file = file_data_new (scan->data);
 		deleted = g_list_find_custom (fullscreen->priv->file_list,
 					      file,
 					      (GCompareFunc) filedatacmp);
@@ -1453,7 +1453,7 @@
 	FileData *file;
 	GList    *renamed_image;
 	
-	file = file_data_new (old_name, NULL);
+	file = file_data_new (old_name);
 	renamed_image = g_list_find_custom (fullscreen->priv->file_list,
 					    file,
 					    (GCompareFunc) filedatacmp);
@@ -1474,7 +1474,7 @@
 		return;
 
 	file_data_unref (fullscreen->priv->file);
-	fullscreen->priv->file = file_data_new (new_name, NULL);
+	fullscreen->priv->file = file_data_new (new_name);
 	file_data_update (fullscreen->priv->file);
 
 	load_current_image (fullscreen);

Modified: trunk/src/gth-viewer.c
==============================================================================
--- trunk/src/gth-viewer.c	(original)
+++ trunk/src/gth-viewer.c	Mon Dec 22 18:34:34 2008
@@ -936,7 +936,7 @@
 		return;
 	}
 
-	file_data_update_info (priv->image); /* FIXME: check if this is necessary */
+	file_data_update (priv->image); /* FIXME: check if this is necessary */
 	priv->image_modified = FALSE;
 
 	viewer_update_image_info (viewer);
@@ -1681,7 +1681,7 @@
 	/**/
 
 	if (filename != NULL) {
-		priv->image = file_data_new (filename, NULL);
+		priv->image = file_data_new (filename);
 		file_data_update_all (priv->image, FALSE); /* FIXME: always slow mime type ? */
 	}
 }
@@ -1748,7 +1748,7 @@
 {
 	FileData *file;
 	
-	file = file_data_new (uri, NULL);
+	file = file_data_new (uri);
 	file_data_update_all (file, FALSE); /* FIXME: always slow mime type ? */
 	gth_viewer_load (viewer, file);
 	file_data_unref (file);

Modified: trunk/src/gthumb-preloader.c
==============================================================================
--- trunk/src/gthumb-preloader.c	(original)
+++ trunk/src/gthumb-preloader.c	Mon Dec 22 18:34:34 2008
@@ -487,15 +487,15 @@
 	
 	fast_mime_type = eel_gconf_get_boolean (PREF_FAST_FILE_TYPE, TRUE);
 	
-	f_requested = file_data_new (requested, NULL);
+	f_requested = file_data_new (requested);
 	file_data_update_all (f_requested, fast_mime_type);
 	if (next1 != NULL) {
-		f_next1 = file_data_new (next1, NULL);
+		f_next1 = file_data_new (next1);
 		file_data_update (f_next1);
 		file_data_update_mime_type (f_next1, fast_mime_type);
 	}
 	if (prev1 != NULL) {
-		f_prev1 = file_data_new (prev1, NULL);
+		f_prev1 = file_data_new (prev1);
 		file_data_update_all (f_prev1, fast_mime_type);
 	}
 	



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