~skypce/indicator-session/indicator-session

« back to all changes in this revision

Viewing changes to debian/patches/03_tp_glib.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine
  • Date: 2009-12-10 10:42:21 UTC
  • mfrom: (1.1.9 upstream)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20091210104221-vf7zqsien3deqc1p
Tags: 0.1.7+r58-0ubuntu1
* New snapshot for libindicator 0.3.0
* debian/control
  - build depend on libtelepathy-glib-dev instead of libempathy-dev
  - build depend on libindicator-dev >= 0.3.0
* removed 03_tp_glib.patch and 99_autoreconf.patch, applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
=== modified file 'configure.ac'
2
 
--- configure.ac        2009-12-08 13:36:06 +0000
3
 
+++ configure.ac        2009-12-08 13:40:34 +0000
4
 
@@ -37,10 +37,10 @@
5
 
 AC_SUBST(APPLET_LIBS)
6
 
 
7
 
 DBUSMENUGLIB_REQUIRED_VERSION=0.1.1
8
 
-LIBEMPATHY_REQUIRED_VERSION=2.27.0
9
 
+TELEPATHYGLIB_REQUIRED_VERSION=0.9.0
10
 
 
11
 
 PKG_CHECK_MODULES(STATUSSERVICE, dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION
12
 
-                                 libempathy >= $LIBEMPATHY_REQUIRED_VERSION)
13
 
+                                 telepathy-glib >= $TELEPATHYGLIB_REQUIRED_VERSION)
14
 
 
15
 
 AC_SUBST(STATUSERVICE_CFLAGS)
16
 
 AC_SUBST(STATUSERVICE_LIBS)
17
 
 
18
 
=== modified file 'src/status-provider-mc5.c'
19
 
--- src/status-provider-mc5.c   2009-12-08 13:38:42 +0000
20
 
+++ src/status-provider-mc5.c   2009-12-08 16:01:06 +0000
21
 
@@ -24,7 +24,7 @@
22
 
 #include "config.h"
23
 
 #endif
24
 
 
25
 
-#include "libempathy/empathy-account-manager.h"
26
 
+#include <telepathy-glib/account-manager.h>
27
 
 
28
 
 #include "status-provider.h"
29
 
 #include "status-provider-mc5.h"
30
 
@@ -65,7 +65,7 @@
31
 
 
32
 
 typedef struct _StatusProviderMC5Private StatusProviderMC5Private;
33
 
 struct _StatusProviderMC5Private {
34
 
-       EmpathyAccountManager * manager;
35
 
+       TpAccountManager * manager;
36
 
        StatusProviderStatus status;
37
 
        DBusGProxy * dbus_proxy;
38
 
 };
39
 
@@ -83,7 +83,7 @@
40
 
 /* Internal Funcs */
41
 
 static void set_status (StatusProvider * sp, StatusProviderStatus status);
42
 
 static StatusProviderStatus get_status (StatusProvider * sp);
43
 
-static void presence_changed (EmpathyAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp);
44
 
+static void presence_changed (TpAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp);
45
 
 static void dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, StatusProviderMC5 * self);
46
 
 static void mc5_exists_cb (DBusGProxy * proxy, gboolean exists, GError * error, gpointer userdata);
47
 
 
48
 
@@ -109,25 +109,41 @@
49
 
        return;
50
 
 }
51
 
 
52
 
-/* Build our empathy account manager instance if we don't
53
 
+/* Build our telepathy account manager instance if we don't
54
 
    have one. */
55
 
 static void
56
 
 build_eam (StatusProviderMC5 * self)
57
 
 {
58
 
        StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(self);
59
 
+       static TpDBusDaemon *daemon = NULL;
60
 
+       GError *error = NULL;
61
 
 
62
 
        if (priv->manager != NULL) {
63
 
                return;
64
 
        }
65
 
-
66
 
-       priv->manager = EMPATHY_ACCOUNT_MANAGER(g_object_new(EMPATHY_TYPE_ACCOUNT_MANAGER, NULL));
67
 
-       g_signal_connect(G_OBJECT(priv->manager), "global-presence-changed", G_CALLBACK(presence_changed), self);
68
 
+       /* the daemon is used to communicate via DBus */
69
 
+       daemon = tp_dbus_daemon_dup(&error);
70
 
+
71
 
+       if (daemon == NULL)
72
 
+       {
73
 
+               g_debug("Cannot create DBus daemon: %s\n", error->message);
74
 
+               g_error_free(error);
75
 
+               return;
76
 
+       }
77
 
+
78
 
+       priv->manager = TP_ACCOUNT_MANAGER (g_object_new (TP_TYPE_ACCOUNT_MANAGER,
79
 
+               "dbus-daemon", daemon,
80
 
+               "dbus-connection", ((TpProxy *) daemon)->dbus_connection,
81
 
+               "bus-name", "org.freedesktop.Telepathy.MissionControl5",
82
 
+               "object-path", "/org/freedesktop/Telepathy/AccountManager",
83
 
+               NULL));
84
 
+       g_signal_connect(G_OBJECT(priv->manager), "most-available-presence-changed", G_CALLBACK(presence_changed), self);
85
 
 
86
 
        return;
87
 
 }
88
 
 
89
 
 /* Creating an instance of the status provider.  We set the variables
90
 
-   and create an EmpathyAccountManager object.  It does all the hard
91
 
+   and create an TpAccountManager object.  It does all the hard
92
 
    work in this module of tracking MissionControl and enumerating the
93
 
    accounts and all that jazz. */
94
 
 static void
95
 
@@ -266,8 +282,7 @@
96
 
        StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(sp);
97
 
 
98
 
        build_eam(STATUS_PROVIDER_MC5(sp));
99
 
-
100
 
-       empathy_account_manager_request_global_presence(priv->manager, sp_to_tp_map[status], sp_to_mc_map[status], "");
101
 
+       tp_account_manager_set_all_requested_presences(priv->manager, sp_to_tp_map[status], sp_to_mc_map[status], "");
102
 
 
103
 
        return;
104
 
 }
105
 
@@ -287,11 +302,11 @@
106
 
        return priv->status;
107
 
 }
108
 
 
109
 
-/* A signal handler for when the EmpatyAccountManager believes
110
 
+/* A signal handler for when the TpAccountManager believes
111
 
    that the global status has changed.  It roughly calculates this
112
 
    by finding the most available of all accounts that are active. */
113
 
 static void
114
 
-presence_changed (EmpathyAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp)
115
 
+presence_changed (TpAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp)
116
 
 {
117
 
        StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(sp);
118
 
 
119