[nautilus] Use g_file_info_get_deletion_date() helper



commit 7382ddfb87938e1433090ad39b46df5cce1908f8
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Nov 27 17:25:21 2012 +0100

    Use g_file_info_get_deletion_date() helper
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689172

 .../nautilus-file-undo-operations.c                |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file-undo-operations.c b/libnautilus-private/nautilus-file-undo-operations.c
index e27b7cb..adb6a14 100644
--- a/libnautilus-private/nautilus-file-undo-operations.c
+++ b/libnautilus-private/nautilus-file-undo-operations.c
@@ -1108,7 +1108,6 @@ trash_retrieve_files_to_restore_thread (GSimpleAsyncResult *res,
 		glong trash_time, orig_trash_time;
 		const char *origpath;
 		GFile *origfile;
-		const char *time_string;
 
 		while ((info = g_file_enumerator_next_file (enumerator, NULL, &error)) != NULL) {
 			/* Retrieve the original file uri */
@@ -1118,13 +1117,14 @@ trash_retrieve_files_to_restore_thread (GSimpleAsyncResult *res,
 			lookupvalue = g_hash_table_lookup (self->priv->trashed, origfile);
 
 			if (lookupvalue) {
+				GDateTime *date;
+
 				orig_trash_time = GPOINTER_TO_SIZE (lookupvalue);
-				time_string = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_TRASH_DELETION_DATE);
-				if (time_string != NULL) {
-					g_time_val_from_iso8601 (time_string, &timeval);
-					trash_time = timeval.tv_sec;
-				} else {
-					trash_time = 0;
+				trash_time = 0;
+				date = g_file_info_get_deletion_date (info);
+				if (date) {
+					trash_time = g_date_time_to_unix (date);
+					g_date_time_unref (date);
 				}
 
 				if (trash_time == orig_trash_time) {



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