[gthumb] Use gfile functions to determine free space



commit 72c9fbcefa1757dd06f13e13df42386928454f11
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Tue Jun 16 14:28:29 2009 -0400

    Use gfile functions to determine free space

 libgthumb/file-utils.c   |   19 -------------------
 libgthumb/file-utils.h   |    1 -
 src/dlg-photo-importer.c |    5 +++--
 3 files changed, 3 insertions(+), 22 deletions(-)
---
diff --git a/libgthumb/file-utils.c b/libgthumb/file-utils.c
index c30b6cb..45e1247 100644
--- a/libgthumb/file-utils.c
+++ b/libgthumb/file-utils.c
@@ -2111,25 +2111,6 @@ copy_file_async (const char   *source_uri,
 /* -- */
 
 
-guint64
-get_destination_free_space (const char *path)
-{
-	GFile   *file;
-	guint64  result;
-	
-	if (path == NULL)
-		return 0;
-	
-	file = gfile_new (path);
-
-	result = gfile_get_destination_free_space (file);
-	
-	g_object_unref (file);
-
-	return result;
-}
-
-
 gboolean
 is_mime_type_writable (const char *mime_type)
 {
diff --git a/libgthumb/file-utils.h b/libgthumb/file-utils.h
index e683a41..d5cc44a 100644
--- a/libgthumb/file-utils.h
+++ b/libgthumb/file-utils.h
@@ -210,7 +210,6 @@ CopyData *          copy_file_async               (const char       *source_uri,
 		 				   const char       *target_uri,
 		 				   CopyDoneFunc      done_func,
 		 				   gpointer          done_data);
-guint64             get_destination_free_space    (const char       *path);
 const char*         get_file_mime_type            (const char       *path,
 						   gboolean          fast_file_type);
 const char *        get_mime_type_from_ext        (const char       *ext);
diff --git a/src/dlg-photo-importer.c b/src/dlg-photo-importer.c
index fd96dcb..c8866f8 100644
--- a/src/dlg-photo-importer.c
+++ b/src/dlg-photo-importer.c
@@ -1466,7 +1466,6 @@ ok_clicked_cb (GtkButton  *button,
 		file_data_unref (folder_fd);
 		return;
 	}
-	file_data_unref (folder_fd);
 
 	for (scan = file_list; scan; scan = scan->next) {
 		total_size += gfile_get_size ((GFile *) scan->data);
@@ -1474,7 +1473,7 @@ ok_clicked_cb (GtkButton  *button,
 
 	debug (DEBUG_INFO, "Prepare to import %ld bytes", total_size);
 
-	if (get_destination_free_space (data->main_dest_folder) < total_size) {
+	if (gfile_get_destination_free_space (folder_fd->gfile) < total_size) {
 		display_error_dialog (data,
 				      _("Could not import photos"),
 				      _("Not enough free space left on disk"));
@@ -1485,6 +1484,8 @@ ok_clicked_cb (GtkButton  *button,
 		return;
 	}
 
+	file_data_unref (folder_fd);
+
 	data->aodata = async_operation_new (NULL,
 					    file_list,
 					    save_images__init,



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