[tracker] libtracker-data: Implement get_property() for n-columns in SQLite cursor
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Implement get_property() for n-columns in SQLite cursor
- Date: Tue, 12 Jul 2011 06:38:44 +0000 (UTC)
commit f72c460583dc4bb5bf7404d74a8c630da6d50dc8
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Jul 11 12:12:20 2011 -0400
libtracker-data: Implement get_property() for n-columns in SQLite cursor
n-columns is an abstract property, so it should be implemented by all
the TrackerCursor subclasses
Fixes GB#654407.
src/libtracker-data/tracker-db-interface-sqlite.c | 24 +++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c b/src/libtracker-data/tracker-db-interface-sqlite.c
index 88f21d0..a57f28a 100644
--- a/src/libtracker-data/tracker-db-interface-sqlite.c
+++ b/src/libtracker-data/tracker-db-interface-sqlite.c
@@ -151,6 +151,11 @@ enum {
PROP_RO
};
+enum {
+ TRACKER_DB_CURSOR_PROP_0,
+ TRACKER_DB_CURSOR_PROP_N_COLUMNS
+};
+
G_DEFINE_TYPE_WITH_CODE (TrackerDBInterface, tracker_db_interface, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
tracker_db_interface_initable_iface_init));
@@ -1594,6 +1599,22 @@ tracker_db_cursor_finalize (GObject *object)
}
static void
+tracker_db_cursor_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ TrackerDBCursor *cursor = TRACKER_DB_CURSOR (object);
+ switch (prop_id) {
+ case TRACKER_DB_CURSOR_PROP_N_COLUMNS:
+ g_value_set_int (value, tracker_db_cursor_get_n_columns (cursor));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
tracker_db_cursor_iter_next_thread (GSimpleAsyncResult *res,
GObject *object,
GCancellable *cancellable)
@@ -1643,6 +1664,7 @@ tracker_db_cursor_class_init (TrackerDBCursorClass *class)
TrackerSparqlCursorClass *sparql_cursor_class = TRACKER_SPARQL_CURSOR_CLASS (class);
object_class->finalize = tracker_db_cursor_finalize;
+ object_class->get_property = tracker_db_cursor_get_property;
sparql_cursor_class->get_value_type = (TrackerSparqlValueType (*) (TrackerSparqlCursor *, gint)) tracker_db_cursor_get_value_type;
sparql_cursor_class->get_variable_name = (const gchar * (*) (TrackerSparqlCursor *, gint)) tracker_db_cursor_get_variable_name;
@@ -1656,6 +1678,8 @@ tracker_db_cursor_class_init (TrackerDBCursorClass *class)
sparql_cursor_class->get_integer = (gint64 (*) (TrackerSparqlCursor *, gint)) tracker_db_cursor_get_int;
sparql_cursor_class->get_double = (gdouble (*) (TrackerSparqlCursor *, gint)) tracker_db_cursor_get_double;
sparql_cursor_class->get_boolean = (gboolean (*) (TrackerSparqlCursor *, gint)) tracker_db_cursor_get_boolean;
+
+ g_object_class_override_property (object_class, TRACKER_DB_CURSOR_PROP_N_COLUMNS, "n-columns");
}
static TrackerDBCursor *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]