[tracker/libtracker-sparql: 29/50] libtracker-sparql: Added statistics{_async} virtual methods



commit 9f2a2829c512d0f80301e917e8e3059b2e39ce5b
Author: Martyn Russell <martyn lanedo com>
Date:   Tue Jul 20 17:06:15 2010 +0100

    libtracker-sparql: Added statistics{_async} virtual methods
    
    libtracker-bus: Implement d-bus version of statistics API
    tracker-stats: Reworked to use libtracker-sparql

 src/libtracker-sparql/tracker-connection.vala    |   13 +++++++++++++
 src/libtracker-sparql/tracker-plugin-loader.vala |    8 ++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-sparql/tracker-connection.vala b/src/libtracker-sparql/tracker-connection.vala
index e7d5ef4..83ba7a6 100644
--- a/src/libtracker-sparql/tracker-connection.vala
+++ b/src/libtracker-sparql/tracker-connection.vala
@@ -21,6 +21,8 @@
 public const string TRACKER_DBUS_SERVICE = "org.freedesktop.Tracker1";
 public const string TRACKER_DBUS_INTERFACE_RESOURCES = TRACKER_DBUS_SERVICE + ".Resources";
 public const string TRACKER_DBUS_OBJECT_RESOURCES = "/org/freedesktop/Tracker1/Resources";
+public const string TRACKER_DBUS_INTERFACE_STATISTICS = TRACKER_DBUS_SERVICE + ".Statistics";
+public const string TRACKER_DBUS_OBJECT_STATISTICS = "/org/freedesktop/Tracker1/Statistics";
 public const string TRACKER_DBUS_INTERFACE_STEROIDS = TRACKER_DBUS_SERVICE + ".Steroids";
 public const string TRACKER_DBUS_OBJECT_STEROIDS = "/org/freedesktop/Tracker1/Steroids";
 
@@ -81,4 +83,15 @@ public abstract class Tracker.Sparql.Connection : Object {
 	public async virtual void import_async (File file, Cancellable? cancellable = null) throws GLib.Error {
 		warning ("Interface 'import_async' not implemented");
 	}
+	
+	// Statistics
+	public virtual Cursor? statistics (Cancellable? cancellable = null) throws GLib.Error {
+		warning ("Interface 'statistics' not implemented");
+		return null;
+	}
+	
+	public async virtual Cursor? statistics_async (Cancellable? cancellable = null) throws GLib.Error {
+		warning ("Interface 'statistics_async' not implemented");
+		return null;
+	}
 }
diff --git a/src/libtracker-sparql/tracker-plugin-loader.vala b/src/libtracker-sparql/tracker-plugin-loader.vala
index 93ef73c..d5db518 100644
--- a/src/libtracker-sparql/tracker-plugin-loader.vala
+++ b/src/libtracker-sparql/tracker-plugin-loader.vala
@@ -75,6 +75,14 @@ class Tracker.Sparql.PluginLoader : Connection {
 		yield bus.import_async (file, cancellable);
 	}
 
+	public override Cursor? statistics (Cancellable? cancellable = null) throws GLib.Error {
+		return bus.statistics (cancellable);
+	}
+
+	public async override Cursor? statistics_async (Cancellable? cancellable = null) throws GLib.Error {
+		return yield bus.statistics_async (cancellable);
+	}
+
 	// Plugin loading functions
 	private bool load_plugins (bool direct_only) throws GLib.Error {
 		string env_path = Environment.get_variable ("TRACKER_SPARQL_MODULE_PATH");



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