[gnome-documents] lib: move gd_iso8601_from_timestamp() to gd-utils
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] lib: move gd_iso8601_from_timestamp() to gd-utils
- Date: Wed, 16 Nov 2011 02:47:17 +0000 (UTC)
commit ea55455ec8d4f392885ba3832b1e338d79d0e657
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Fri Nov 11 16:28:42 2011 -0500
lib: move gd_iso8601_from_timestamp() to gd-utils
src/lib/gd-utils.c | 16 ++++++++++++++++
src/lib/gd-utils.h | 1 +
src/miner/gd-gdata-miner.c | 15 +++------------
3 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/src/lib/gd-utils.c b/src/lib/gd-utils.c
index 34af37e..70cc6f9 100644
--- a/src/lib/gd-utils.c
+++ b/src/lib/gd-utils.c
@@ -469,6 +469,22 @@ gd_time_val_from_iso8601 (const gchar *string,
}
/**
+ * gd_iso8601_from_timestamp:
+ * @timestamp:
+ *
+ * Returns: (transfer full):
+ */
+gchar *
+gd_iso8601_from_timestamp (gint64 timestamp)
+{
+ GTimeVal tv;
+
+ tv.tv_sec = timestamp;
+ tv.tv_usec = 0;
+ return g_time_val_to_iso8601 (&tv);
+}
+
+/**
* gd_create_collection_icon:
* @base_size:
* @pixbufs: (element-type GdkPixbuf):
diff --git a/src/lib/gd-utils.h b/src/lib/gd-utils.h
index d363582..049be08 100644
--- a/src/lib/gd-utils.h
+++ b/src/lib/gd-utils.h
@@ -62,6 +62,7 @@ char *gd_filename_strip_extension (const char * 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,
GList *pixbufs);
diff --git a/src/miner/gd-gdata-miner.c b/src/miner/gd-gdata-miner.c
index f86097b..698fc2b 100644
--- a/src/miner/gd-gdata-miner.c
+++ b/src/miner/gd-gdata-miner.c
@@ -25,6 +25,7 @@
#include "gd-gdata-goa-authorizer.h"
#include "gd-gdata-miner.h"
+#include "gd-utils.h"
#define MINER_IDENTIFIER "gd:gdata:miner:86ec9bc9-c242-427f-aa19-77b5a2c9b6f0"
#define STARRED_CATEGORY_TERM "http://schemas.google.com/g/2005/labels#starred"
@@ -352,16 +353,6 @@ _tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connection,
return retval;
}
-static gchar *
-_tracker_utils_iso8601_from_timestamp (gint64 timestamp)
-{
- GTimeVal tv;
-
- tv.tv_sec = timestamp;
- tv.tv_usec = 0;
- return g_time_val_to_iso8601 (&tv);
-}
-
typedef struct {
GdGDataMiner *self;
TrackerSparqlConnection *connection; /* borrowed from GdGDataMiner */
@@ -694,7 +685,7 @@ account_miner_job_process_entry (AccountMinerJob *job,
goto out;
}
- date = _tracker_utils_iso8601_from_timestamp (gdata_entry_get_published (entry));
+ date = gd_iso8601_from_timestamp (gdata_entry_get_published (entry));
_tracker_sparql_connection_insert_or_replace_triple
(job->connection,
job->cancellable, error,
@@ -705,7 +696,7 @@ account_miner_job_process_entry (AccountMinerJob *job,
if (*error != NULL)
goto out;
- date = _tracker_utils_iso8601_from_timestamp (gdata_entry_get_updated (entry));
+ date = gd_iso8601_from_timestamp (gdata_entry_get_updated (entry));
_tracker_sparql_connection_insert_or_replace_triple
(job->connection,
job->cancellable, error,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]