tracker r2004 - in branches/indexer-split: . src/libtracker-db
- From: ifrade svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2004 - in branches/indexer-split: . src/libtracker-db
- Date: Tue, 5 Aug 2008 14:58:51 +0000 (UTC)
Author: ifrade
Date: Tue Aug 5 14:58:50 2008
New Revision: 2004
URL: http://svn.gnome.org/viewvc/tracker?rev=2004&view=rev
Log:
New method tracker_dbus_result_set_numeric_to_strv
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/libtracker-db/tracker-db-dbus.c
branches/indexer-split/src/libtracker-db/tracker-db-dbus.h
Modified: branches/indexer-split/src/libtracker-db/tracker-db-dbus.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-dbus.c (original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-dbus.c Tue Aug 5 14:58:50 2008
@@ -23,10 +23,13 @@
#include "tracker-db-dbus.h"
-gchar **
-tracker_dbus_query_result_to_strv (TrackerDBResultSet *result_set,
- gint column,
- gint *count)
+
+static gchar **
+dbus_query_result_to_strv (TrackerDBResultSet *result_set,
+ gint column,
+ gint *count,
+ gboolean numeric)
+
{
gchar **strv = NULL;
gint rows = 0;
@@ -35,6 +38,7 @@
if (result_set) {
gchar *str;
gboolean valid = TRUE;
+ gint value;
/* Make sure we rewind before iterating the result set */
tracker_db_result_set_rewind (result_set);
@@ -44,7 +48,12 @@
while (valid) {
- tracker_db_result_set_get (result_set, column, &str, -1);
+ if (numeric) {
+ tracker_db_result_set_get (result_set, column, &value, -1);
+ str = g_strdup_printf ("%d", value);
+ } else {
+ tracker_db_result_set_get (result_set, column, &str, -1);
+ }
if (!str) {
valid = tracker_db_result_set_iter_next (result_set);
@@ -72,7 +81,21 @@
return strv;
}
+gchar **
+tracker_dbus_query_result_to_strv (TrackerDBResultSet *result_set,
+ gint column,
+ gint *count)
+{
+ return dbus_query_result_to_strv (result_set, column, count, FALSE);
+}
+gchar **
+tracker_dbus_query_result_numeric_to_strv (TrackerDBResultSet *result_set,
+ gint column,
+ gint *count)
+{
+ return dbus_query_result_to_strv (result_set, column, count, TRUE);
+}
gchar **
tracker_dbus_query_result_columns_to_strv (TrackerDBResultSet *result_set,
Modified: branches/indexer-split/src/libtracker-db/tracker-db-dbus.h
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-dbus.h (original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-dbus.h Tue Aug 5 14:58:50 2008
@@ -31,6 +31,9 @@
gchar ** tracker_dbus_query_result_to_strv (TrackerDBResultSet *result_set,
gint column,
gint *count);
+gchar ** tracker_dbus_query_result_numeric_to_strv (TrackerDBResultSet *result_set,
+ gint column,
+ gint *count);
gchar ** tracker_dbus_query_result_columns_to_strv (TrackerDBResultSet *result_set,
gint offset_column,
gint until_column,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]