[tracker/async-queries-wip: 7/23] tracker-db-manager: Add tracker_db_manager_get_interface_pool().
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/async-queries-wip: 7/23] tracker-db-manager: Add tracker_db_manager_get_interface_pool().
- Date: Thu, 15 Apr 2010 12:13:24 +0000 (UTC)
commit d5efb16adcb73cbe97f688f203e89cb7cba858c0
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Apr 13 16:43:58 2010 +0200
tracker-db-manager: Add tracker_db_manager_get_interface_pool().
This function returns a global interface pool, this is only available if
the DB manager has been initialized.
src/libtracker-db/tracker-db-manager.c | 15 +++++++++++++++
src/libtracker-db/tracker-db-manager.h | 3 +++
2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-manager.c b/src/libtracker-db/tracker-db-manager.c
index 858d2e2..ffbfa83 100644
--- a/src/libtracker-db/tracker-db-manager.c
+++ b/src/libtracker-db/tracker-db-manager.c
@@ -177,6 +177,8 @@ static gpointer db_type_enum_class_pointer;
static TrackerDBInterface *resources_iface;
static TrackerDBManagerFlags old_flags = 0;
+static TrackerDBInterfacePool *interface_pool = NULL;
+
#define TRACKER_DB_INTERFACE_POOL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_DB_INTERFACE_POOL, TrackerDBInterfacePoolPrivate))
G_DEFINE_TYPE (TrackerDBInterfacePool, tracker_db_interface_pool, G_TYPE_OBJECT)
@@ -914,6 +916,8 @@ tracker_db_manager_init (TrackerDBManagerFlags flags,
TRACKER_DB_CONTENTS);
}
+ interface_pool = g_object_new (TRACKER_TYPE_DB_INTERFACE_POOL, NULL);
+
return TRUE;
}
@@ -977,6 +981,9 @@ tracker_db_manager_shutdown (void)
g_unlink (in_use_filename);
g_free (in_use_filename);
+
+ g_object_unref (interface_pool);
+ interface_pool = NULL;
}
void
@@ -1219,6 +1226,14 @@ tracker_db_manager_has_enough_space (void)
return tracker_file_system_has_enough_space (data_dir, TRACKER_DB_MIN_REQUIRED_SPACE, FALSE);
}
+TrackerDBInterfacePool *
+tracker_db_manager_get_interface_pool (void)
+{
+ g_return_val_if_fail (initialized != FALSE, NULL);
+
+ return interface_pool;
+}
+
static void
tracker_db_interface_pool_finalize (GObject *object)
{
diff --git a/src/libtracker-db/tracker-db-manager.h b/src/libtracker-db/tracker-db-manager.h
index 1d3874a..7e7b865 100644
--- a/src/libtracker-db/tracker-db-manager.h
+++ b/src/libtracker-db/tracker-db-manager.h
@@ -84,6 +84,9 @@ gboolean tracker_db_manager_has_enough_space (void);
TrackerDBManagerFlags
tracker_db_manager_get_flags (void);
+TrackerDBInterfacePool *
+ tracker_db_manager_get_interface_pool (void);
+
/* TrackerDBInterfacePool methods */
GType tracker_db_interface_pool_get_type (void) G_GNUC_CONST;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]