[gnome-documents] lib: remove redundant helper method



commit 17ff2e90d5cb36b7c58ed62746a1ac75eacd7bda
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jun 5 12:32:00 2012 -0400

    lib: remove redundant helper method
    
    The GLib method is now properly introspected, so we can just use that
    here.

 src/documents.js   |    8 ++++++--
 src/lib/gd-utils.c |   20 --------------------
 src/lib/gd-utils.h |    2 --
 3 files changed, 6 insertions(+), 24 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index 62dc1bd..99c95f2 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -327,8 +327,12 @@ const DocCommon = new Lang.Class({
         this.favorite = cursor.get_boolean(Query.QueryColumns.FAVORITE);
 
         let mtime = cursor.get_string(Query.QueryColumns.MTIME)[0];
-        let timeVal = Gd.time_val_from_iso8601(mtime)[1];
-        this.mtime = timeVal.tv_sec;
+        if (mtime) {
+            let timeVal = GLib.time_val_from_iso8601(mtime)[1];
+            this.mtime = timeVal.tv_sec;
+        } else {
+            this.mtime = GLib.get_real_time();
+        }
 
         this.mimeType = cursor.get_string(Query.QueryColumns.MIMETYPE)[0];
         this.rdfType = cursor.get_string(Query.QueryColumns.RDFTYPE)[0];
diff --git a/src/lib/gd-utils.c b/src/lib/gd-utils.c
index 42ba69c..eb42803 100644
--- a/src/lib/gd-utils.c
+++ b/src/lib/gd-utils.c
@@ -471,26 +471,6 @@ gd_filename_to_rdf_type (const gchar *filename_with_extension)
 }
 
 /**
- * gd_time_val_from_iso8601:
- * @string: (allow-none):
- * @timeval: (out):
- *
- * Returns:
- */
-gboolean
-gd_time_val_from_iso8601 (const gchar *string,
-                          GTimeVal *timeval)
-{
-  if (string == NULL)
-    {
-      g_get_current_time (timeval);
-      return TRUE;
-    }
-
-  return g_time_val_from_iso8601 (string, timeval);
-}
-
-/**
  * gd_iso8601_from_timestamp:
  * @timestamp:
  *
diff --git a/src/lib/gd-utils.h b/src/lib/gd-utils.h
index d95fb65..5b2b335 100644
--- a/src/lib/gd-utils.h
+++ b/src/lib/gd-utils.h
@@ -70,8 +70,6 @@ const char *gd_filename_to_mime_type (const gchar *filename_with_extension);
 
 const char *gd_filename_to_rdf_type (const gchar *filename_with_extension);
 
-gboolean gd_time_val_from_iso8601 (const gchar *string,
-                                   GTimeVal *timeval);
 gchar *gd_iso8601_from_timestamp (gint64 timestamp);
 
 GIcon *gd_create_collection_icon (gint base_size,



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