[tracker] tracker-explorer: Port to GDBus
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-explorer: Port to GDBus
- Date: Wed, 22 Dec 2010 08:04:49 +0000 (UTC)
commit b8b12a2e5e5f3a352254d8139e0e725170929116
Author: Jürg Billeter <j bitron ch>
Date: Wed Dec 22 09:03:08 2010 +0100
tracker-explorer: Port to GDBus
configure.ac | 2 --
src/tracker-explorer/Makefile.am | 2 +-
src/tracker-explorer/tracker-explorer.vala | 22 +++++++++++-----------
3 files changed, 12 insertions(+), 14 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d8dcec7..cf2f10e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,8 +296,6 @@ TRACKER_EXPLORER_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
gthread-2.0 >= $GLIB_REQUIRED
gmodule-2.0 >= $GLIB_REQUIRED
gtk+-2.0 >= $GTK_REQUIRED
- dbus-1 >= $DBUS_REQUIRED
- dbus-glib-1 >= $DBUS_GLIB_REQUIRED
gee-1.0 >= $GEE_REQUIRED"
PKG_CHECK_MODULES(TRACKER_EXPLORER, [$TRACKER_EXPLORER_REQUIRED],
diff --git a/src/tracker-explorer/Makefile.am b/src/tracker-explorer/Makefile.am
index aa70488..42bbe44 100644
--- a/src/tracker-explorer/Makefile.am
+++ b/src/tracker-explorer/Makefile.am
@@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.decl
bin_PROGRAMS = tracker-explorer
AM_VALAFLAGS = \
- --pkg dbus-glib-1 --pkg gee-1.0 --pkg gtk+-2.0 \
+ --pkg gio-2.0 --pkg gee-1.0 --pkg gtk+-2.0 \
$(BUILD_VALAFLAGS)
AM_CPPFLAGS = \
diff --git a/src/tracker-explorer/tracker-explorer.vala b/src/tracker-explorer/tracker-explorer.vala
index 406d768..d2808e5 100644
--- a/src/tracker-explorer/tracker-explorer.vala
+++ b/src/tracker-explorer/tracker-explorer.vala
@@ -26,8 +26,8 @@ extern static const string UIDIR;
extern static const string SRCDIR;
[DBus (name = "org.freedesktop.Tracker1.Resources")]
-interface Resources : GLib.Object {
- public abstract string[,] SparqlQuery (string query) throws DBus.Error;
+interface Resources : DBusProxy {
+ public abstract string[,] SparqlQuery (string query) throws Error;
}
public class HistoryItem {
@@ -107,11 +107,11 @@ public class Explorer {
public void show() {
try {
- var conn = DBus.Bus.get (DBus.BusType.SESSION);
- tracker = (Resources) conn.get_object ("org.freedesktop.Tracker1",
- "/org/freedesktop/Tracker1/Resources",
- "org.freedesktop.Tracker1.Resources");
- } catch (DBus.Error e) {
+ tracker = Bus.get_proxy_sync (BusType.SESSION,
+ "org.freedesktop.Tracker1",
+ "/org/freedesktop/Tracker1/Resources",
+ DBusProxyFlags.DO_NOT_LOAD_PROPERTIES | DBusProxyFlags.DO_NOT_CONNECT_SIGNALS);
+ } catch (Error e) {
var msg = new MessageDialog (null, DialogFlags.MODAL,
MessageType.ERROR, ButtonsType.CANCEL,
"Error connecting to D-Bus session bus\n%s", e.message);
@@ -210,7 +210,7 @@ public class Explorer {
_namespace = _namespace.substring(0, _namespace.length -1);
namespaces[_namespace] = result[i,1];
}
- } catch (DBus.Error e) {
+ } catch (Error e) {
}
}
@@ -228,7 +228,7 @@ public class Explorer {
uris.set (iter, 0, s, -1);
}
- } catch (DBus.Error e) {
+ } catch (Error e) {
}
}
@@ -286,7 +286,7 @@ public class Explorer {
}
}
- } catch (DBus.Error e) {
+ } catch (Error e) {
}
}
@@ -342,7 +342,7 @@ public class Explorer {
types.set_current_page(types.get_n_pages() - 1);
update_types_page(null);
- } catch (DBus.Error e) {
+ } catch (Error e) {
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]