[Pkg-telepathy-commits] [telepathy-mission-control-6] 42/90: McdStorage: rewrite unique_name to avoid dbus_g_connection_lookup_g_object

Simon McVittie smcv at debian.org
Wed May 14 12:09:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-mission-control-6.

commit 705fa4b8ad68461023806610634cc71c6e0588f1
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Fri Mar 21 17:58:22 2014 +0000

    McdStorage: rewrite unique_name to avoid dbus_g_connection_lookup_g_object
    
    If we don't have an account in the McdStorage, its object path won't
    be in use.
---
 src/mcd-storage.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/mcd-storage.c b/src/mcd-storage.c
index 9bb14ff..4e37214 100644
--- a/src/mcd-storage.c
+++ b/src/mcd-storage.c
@@ -328,9 +328,6 @@ unique_name (const McpAccountManager *ma,
   McdStorage *self = MCD_STORAGE (ma);
   gchar *esc_manager, *esc_protocol, *esc_base;
   guint i;
-  gsize base_len = strlen (TP_ACCOUNT_OBJECT_PATH_BASE);
-  TpDBusDaemon *dbus = tp_client_factory_get_dbus_daemon (self->factory);
-  DBusGConnection *connection = tp_proxy_get_dbus_connection (dbus);
 
   esc_manager = tp_escape_as_identifier (manager);
   esc_protocol = g_strdelimit (g_strdup (protocol), "-", '_');
@@ -338,20 +335,15 @@ unique_name (const McpAccountManager *ma,
 
   for (i = 0; i < G_MAXUINT; i++)
     {
-      gchar *path = g_strdup_printf (
-          TP_ACCOUNT_OBJECT_PATH_BASE "%s/%s/%s%u",
+      gchar *tail = g_strdup_printf ("%s/%s/%s%u",
           esc_manager, esc_protocol, esc_base, i);
 
-      if (!g_hash_table_contains (self->accounts, path + base_len) &&
-          dbus_g_connection_lookup_g_object (connection, path) == NULL)
+      if (!g_hash_table_contains (self->accounts, tail))
         {
-          gchar *ret = g_strdup (path + base_len);
-
-          g_free (path);
-          return ret;
+          return tail;
         }
 
-      g_free (path);
+      g_free (tail);
     }
 
   return NULL;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-mission-control-6.git



More information about the Pkg-telepathy-commits mailing list