From 5d1462d57169d549da55f5f60287f122fd52aed8 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 12 Sep 2013 18:49:28 +0100 Subject: [PATCH 1/2] tp_dbus_properties_mixin_dup_all: make public There's no real reason not to - anything that implements D-Bus properties is clearly going to have this method in some form. Also, my next commit needs it. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69283 --- docs/reference/telepathy-glib-sections.txt | 1 + telepathy-glib/Makefile.am | 1 - telepathy-glib/dbus-properties-mixin-internal.h | 34 ------------------------- telepathy-glib/dbus-properties-mixin.c | 10 ++++---- telepathy-glib/dbus-properties-mixin.h | 4 +++ tests/dbus/Makefile.am | 5 ---- tests/lib/simple-conn.c | 13 ++-------- 7 files changed, 12 insertions(+), 56 deletions(-) delete mode 100644 telepathy-glib/dbus-properties-mixin-internal.h diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt index 7af8086..b336ed1 100644 --- a/docs/reference/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib-sections.txt @@ -2616,6 +2616,7 @@ tp_dbus_properties_mixin_class_init tp_dbus_properties_mixin_implement_interface tp_dbus_properties_mixin_iface_init tp_dbus_properties_mixin_get +tp_dbus_properties_mixin_dup_all tp_dbus_properties_mixin_set tp_dbus_properties_mixin_fill_properties_hash tp_dbus_properties_mixin_make_properties_hash diff --git a/telepathy-glib/Makefile.am b/telepathy-glib/Makefile.am index aece7bc..ce60d7d 100644 --- a/telepathy-glib/Makefile.am +++ b/telepathy-glib/Makefile.am @@ -247,7 +247,6 @@ libtelepathy_glib_internal_la_SOURCES = \ dbus-daemon.c \ dbus-internal.h \ dbus-properties-mixin.c \ - dbus-properties-mixin-internal.h \ dbus-tube-channel.c \ debug.c \ debug-client.c \ diff --git a/telepathy-glib/dbus-properties-mixin-internal.h b/telepathy-glib/dbus-properties-mixin-internal.h deleted file mode 100644 index 344d151..0000000 --- a/telepathy-glib/dbus-properties-mixin-internal.h +++ /dev/null @@ -1,34 +0,0 @@ -/**/ -/* - * dbus-properties-mixin-internal.h - D-Bus core Properties - internal API - * Copyright (C) 2008-2012 Collabora Ltd. - * Copyright (C) 2008 Nokia Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __TP_DBUS_PROPERTIES_MIXIN_INTERNAL_H__ -#define __TP_DBUS_PROPERTIES_MIXIN_INTERNAL_H__ - -#include - -G_BEGIN_DECLS - -GHashTable *_tp_dbus_properties_mixin_get_all (GObject *self, - const gchar *interface_name); - -G_END_DECLS - -#endif /* #ifndef __TP_DBUS_PROPERTIES_MIXIN_H__ */ diff --git a/telepathy-glib/dbus-properties-mixin.c b/telepathy-glib/dbus-properties-mixin.c index 6e26ab2..55c8e09 100644 --- a/telepathy-glib/dbus-properties-mixin.c +++ b/telepathy-glib/dbus-properties-mixin.c @@ -21,7 +21,6 @@ #include "config.h" #include -#include "telepathy-glib/dbus-properties-mixin-internal.h" #include #include @@ -1148,8 +1147,8 @@ _tp_dbus_properties_mixin_get (TpSvcDBusProperties *iface, } } -/* - * _tp_dbus_properties_mixin_get_all: +/** + * tp_dbus_properties_mixin_dup_all: * @self: an object with this mixin * @interface_name: a D-Bus interface name * @@ -1159,9 +1158,10 @@ _tp_dbus_properties_mixin_get (TpSvcDBusProperties *iface, * * Returns: (transfer container) (element-type utf8 GObject.Value): a map * from property name (without the interface name) to value + * Since: 0.UNRELEASED */ GHashTable * -_tp_dbus_properties_mixin_get_all (GObject *self, +tp_dbus_properties_mixin_dup_all (GObject *self, const gchar *interface_name) { TpDBusPropertiesMixinIfaceImpl *iface_impl; @@ -1203,7 +1203,7 @@ _tp_dbus_properties_mixin_get_all_dbus (TpSvcDBusProperties *iface, const gchar *interface_name, DBusGMethodInvocation *context) { - GHashTable *values = _tp_dbus_properties_mixin_get_all (G_OBJECT (iface), + GHashTable *values = tp_dbus_properties_mixin_dup_all (G_OBJECT (iface), interface_name); tp_svc_dbus_properties_return_from_get_all (context, values); diff --git a/telepathy-glib/dbus-properties-mixin.h b/telepathy-glib/dbus-properties-mixin.h index dff7271..3aaef83 100644 --- a/telepathy-glib/dbus-properties-mixin.h +++ b/telepathy-glib/dbus-properties-mixin.h @@ -138,6 +138,10 @@ gboolean tp_dbus_properties_mixin_set ( const GValue *value, GError **error); +_TP_AVAILABLE_IN_UNRELEASED +GHashTable *tp_dbus_properties_mixin_dup_all (GObject *self, + const gchar *interface_name); + GHashTable *tp_dbus_properties_mixin_make_properties_hash ( GObject *object, const gchar *first_interface, const gchar *first_property, ...) diff --git a/tests/dbus/Makefile.am b/tests/dbus/Makefile.am index 4d02d23..e446645 100644 --- a/tests/dbus/Makefile.am +++ b/tests/dbus/Makefile.am @@ -215,11 +215,6 @@ test_protocol_objects_LDADD = \ test_protocol_objects_SOURCES = protocol-objects.c test_self_handle_SOURCES = self-handle.c -test_self_handle_LDADD = \ - $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ - $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ - $(GLIB_LIBS) \ - $(NULL) test_self_presence_SOURCES = self-presence.c diff --git a/tests/lib/simple-conn.c b/tests/lib/simple-conn.c index b466231..c78e127 100644 --- a/tests/lib/simple-conn.c +++ b/tests/lib/simple-conn.c @@ -18,16 +18,13 @@ #include #include +#include #include #include #include #include #include -#ifdef TP_GLIB_TESTS_INTERNAL -# include "telepathy-glib/dbus-properties-mixin-internal.h" -#endif - #include "textchan-null.h" #include "room-list-chan.h" #include "util.h" @@ -522,13 +519,12 @@ conn_iface_init (TpSvcConnectionClass *iface) #undef IMPLEMENT } -#ifdef TP_GLIB_TESTS_INTERNAL static void get_all (TpSvcDBusProperties *iface, const gchar *interface_name, DBusGMethodInvocation *context) { - GHashTable *values = _tp_dbus_properties_mixin_get_all (G_OBJECT (iface), + GHashTable *values = tp_dbus_properties_mixin_dup_all (G_OBJECT (iface), interface_name); tp_svc_dbus_properties_return_from_get_all (context, values); @@ -536,17 +532,12 @@ get_all (TpSvcDBusProperties *iface, g_signal_emit (iface, signals[SIGNAL_GOT_ALL], g_quark_from_string (interface_name)); } -#endif /* TP_GLIB_TESTS_INTERNAL */ static void props_iface_init (TpSvcDBusPropertiesClass *iface) { -#ifdef TP_GLIB_TESTS_INTERNAL - #define IMPLEMENT(x) \ tp_svc_dbus_properties_implement_##x (iface, x) IMPLEMENT (get_all); #undef IMPLEMENT - -#endif /* TP_GLIB_TESTS_INTERNAL */ } -- 1.8.4.rc3