4 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
5 * @author Renato Filho <renato.filho@indt.org.br>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #include <gmyth/gmyth.h>
30 #include <dbus/dbus-glib-bindings.h>
33 #include "gmyth-dbus-common.h"
34 #include "gmyth-dbus-server.h"
36 #define MYTH_DEFAULT_DB "mythconverg"
38 typedef struct _GMythDbusServerPrivate GMythDbusServerPrivate;
40 struct _GMythDbusServerPrivate
42 GMythBackendInfo *myth_backend;
44 GMythScheduler *myth_scheduler;
47 #define GMYTH_DBUS_SERVER_GET_PRIVATE(o) \
48 (G_TYPE_INSTANCE_GET_PRIVATE ((o), GMYTH_DBUS_SERVER_TYPE, GMythDbusServerPrivate))
50 static void gmyth_dbus_server_class_init (GMythDbusServerClass *klass);
51 static void gmyth_dbus_server_init (GMythDbusServer *self);
52 static void gmyth_dbus_server_dispose (GObject *object);
53 static void gmyth_dbus_server_finalize (GObject *object);
56 static gboolean gmyth_dbus_server_connect (GObject *obj,
60 const gchar *password,
63 static gboolean gmyth_dbus_server_get_channel_list (GObject *obj,
66 static gboolean gmyth_dbus_server_get_channel_info (GObject *obj,
70 static gboolean gmyth_dbus_server_file_exists (GObject *obj,
71 const gchar *file_name,
74 static gboolean gmyth_dbus_server_get_recorded_list (GObject *obj,
77 static gboolean gmyth_dbus_server_get_recorded_info (GObject *obj,
78 const gchar *basename,
81 static gboolean gmyth_dbus_server_get_program_list (GObject *obj,
83 const gchar *start_time,
84 const gchar *end_time,
85 GPtrArray **program_list);
86 static gboolean gmyth_dbus_server_get_schedule_list (GObject *obj,
87 GPtrArray **schedule_list);
89 static gboolean gmyth_dbus_server_connected (GObject *obj,
92 static gboolean gmyth_dbus_server_disconnect (GObject *obj,
94 static gboolean gmyth_dbus_server_get_server_info (GObject *obj,
99 static gboolean gmyth_dbus_server_get_thumbnail (GObject *obj,
103 static gboolean gmyth_dbus_server_get_channel_icon (GObject *obj,
107 static gboolean gmyth_dbus_server_stop_recording (GObject *obj,
111 static gboolean gmyth_dbus_server_add_schedule (GObject *obj,
114 const gchar *start_time,
115 const gchar *end_time,
117 const gchar *description,
120 static gboolean gmyth_dbus_server_add_exception (GObject *obj,
124 const gchar *start_time,
125 const gchar *end_time,
126 const gchar *description,
128 static gboolean gmyth_dbus_server_remove_schedule (GObject *obj,
133 #include "gmyth-dbus-server-glue.h"
136 G_DEFINE_TYPE (GMythDbusServer, gmyth_dbus_server, G_TYPE_OBJECT);
139 gmyth_dbus_server_class_init (GMythDbusServerClass *klass)
141 GObjectClass *object_class = G_OBJECT_CLASS (klass);
143 g_type_class_add_private (klass, sizeof (GMythDbusServerPrivate));
145 object_class->dispose = gmyth_dbus_server_dispose;
146 object_class->finalize = gmyth_dbus_server_finalize;
148 dbus_g_object_type_install_info (GMYTH_DBUS_SERVER_TYPE,
149 &dbus_glib_gmyth_dbus_server_object_info);
153 gmyth_dbus_server_init (GMythDbusServer *self)
158 gmyth_dbus_server_dispose (GObject *object)
160 G_OBJECT_CLASS (gmyth_dbus_server_parent_class)->dispose (object);
164 gmyth_dbus_server_finalize (GObject *object)
166 G_OBJECT_CLASS (gmyth_dbus_server_parent_class)->finalize (object);
170 gmyth_dbus_server_connect_epg (GMythDbusServer *server)
172 GMythDbusServerPrivate *priv;
173 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (server);
177 priv->myth_epg = gmyth_epg_new();
178 if (!gmyth_epg_connect (priv->myth_epg, priv->myth_backend))
180 g_object_unref (priv->myth_epg);
181 priv->myth_epg = NULL;
190 gmyth_dbus_server_connect_scheduler (GMythDbusServer *server)
192 GMythDbusServerPrivate *priv;
193 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (server);
195 if (!priv->myth_scheduler)
197 priv->myth_scheduler = gmyth_scheduler_new ();
198 if (!gmyth_scheduler_connect (priv->myth_scheduler,
201 g_object_unref (priv->myth_scheduler);
202 priv->myth_scheduler = NULL;
211 gmyth_dbus_server_connect (GObject *obj,
215 const gchar *password,
219 GMythDbusServerPrivate *priv;
220 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
222 if (priv->myth_backend)
225 priv->myth_backend = gmyth_backend_info_new_full (host,
235 gmyth_dbus_server_connected (GObject *obj,
239 GMythDbusServerPrivate *priv;
240 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
242 if (priv->myth_backend)
250 gmyth_dbus_server_disconnect (GObject *obj,
253 GMythDbusServerPrivate *priv;
254 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
258 g_object_unref (priv->myth_epg);
259 priv->myth_epg = NULL;
263 if (priv->myth_backend)
265 g_object_unref (priv->myth_backend);
266 priv->myth_backend = NULL;
269 if (priv->myth_scheduler)
271 g_object_unref (priv->myth_scheduler);
272 priv->myth_scheduler = NULL;
280 gmyth_dbus_server_get_server_info (GObject *obj,
281 guint64 *total_space,
286 GMythBackendDetails *details;
287 GMythDbusServerPrivate *priv;
288 gboolean ret = FALSE;
291 g_debug ("%s:%d", __FUNCTION__, __LINE__);
292 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
294 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
296 socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
299 gmyth_util_get_backend_details (socket,
303 *total_space = details->total_space;
304 *used_space = details->used_space;
305 *free_space = *total_space - *used_space;
306 gmyth_util_backend_details_free (details);
311 g_object_unref (socket);
318 gmyth_dbus_server_parse_channel_info (GMythChannelInfo *info,
321 dbus_g_type_struct_set (val,
323 1, info->channel_num->str,
324 2, info->channel_name->str,
325 3, info->channel_icon->str,
330 gmyth_dbus_server_get_channel_info (GObject *obj,
336 GMythChannelInfo *ch_info;
337 GMythDbusServerPrivate *priv;
339 g_debug ("%s:%d", __FUNCTION__, __LINE__);
340 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
342 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
343 g_return_val_if_fail (gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)), FALSE);
345 ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
347 ch_info = gmyth_epg_get_channel_info (priv->myth_epg, channel_id);
351 g_value_init (&v, ch_type);
352 g_value_take_boxed (&v, dbus_g_type_specialized_construct (ch_type));
353 gmyth_dbus_server_parse_channel_info (ch_info, &v);
355 *info = g_value_get_boxed (&v);
364 gmyth_dbus_server_get_channel_list (GObject *obj,
365 GPtrArray **channels,
372 GMythDbusServerPrivate *priv;
374 g_debug ("%s:%d", __FUNCTION__, __LINE__);
375 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
377 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
378 g_return_val_if_fail (gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)), FALSE);
381 len = gmyth_epg_get_channel_list (priv->myth_epg, &lst);
383 *channels = g_ptr_array_sized_new (len);
384 ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
386 for (walk = lst; walk != NULL; walk = walk->next)
389 GMythChannelInfo *data;
391 data = (GMythChannelInfo *) walk->data;
393 g_value_init (&ch, ch_type);
394 g_value_take_boxed (&ch, dbus_g_type_specialized_construct (ch_type));
395 gmyth_dbus_server_parse_channel_info (data, &ch);
396 g_ptr_array_add (*channels, g_value_get_boxed (&ch));
399 gmyth_free_channel_list (lst);
404 gmyth_dbus_server_file_exists (GObject *obj,
405 const gchar *file_name,
409 GMythDbusServerPrivate *priv;
410 g_debug ("%s:%d", __FUNCTION__, __LINE__);
411 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
413 g_return_val_if_fail (priv->myth_backend, FALSE);
415 *exists = gmyth_util_file_exists (priv->myth_backend, file_name);
421 gmyth_dbus_server_get_program_list (GObject *obj,
423 const gchar *start_time,
424 const gchar *end_time,
425 GPtrArray **programs)
431 GTimeVal start_time_val;
432 GTimeVal end_time_val;
433 GMythDbusServerPrivate *priv;
435 g_debug ("%s:%d", __FUNCTION__, __LINE__);
436 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
438 g_return_val_if_fail (priv->myth_backend, FALSE);
439 g_return_val_if_fail (gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)), FALSE);
441 g_time_val_from_iso8601 (start_time, &start_time_val);
442 g_time_val_from_iso8601 (end_time, &end_time_val);
445 len = gmyth_epg_get_program_list (priv->myth_epg,
451 *programs = g_ptr_array_sized_new (len);
452 program_type = GMYTH_DBUS_PROGRAM_G_TYPE;
454 for (walk = list; walk != NULL; walk = walk->next)
456 GValue program = { 0, };
459 GMythProgramInfo *data;
461 data = (GMythProgramInfo *) walk->data;
466 g_value_init (&program, program_type);
467 g_value_take_boxed (&program,
468 dbus_g_type_specialized_construct (program_type));
470 start_str = g_time_val_to_iso8601 (data->startts);
471 end_str = g_time_val_to_iso8601 (data->endts);
473 dbus_g_type_struct_set (&program,
474 0, data->chanid->str,
478 4, data->subtitle->str,
479 5, data->description->str,
480 6, data->category->str,
483 g_ptr_array_add (*programs, g_value_get_boxed (&program));
489 gmyth_free_program_list (list);
491 g_debug ("%s:%d", __FUNCTION__, __LINE__);
496 gmyth_dbus_server_parse_recorded_info (RecordedInfo *info,
502 start_str = g_time_val_to_iso8601 (info->start_time);
503 end_str = g_time_val_to_iso8601 (info->end_time);
505 dbus_g_type_struct_set (val,
512 6, info->subtitle->str,
513 7, info->description->str,
514 8, info->category->str,
515 9, info->basename->str,
523 gmyth_dbus_server_get_recorded_info (GObject *obj,
524 const gchar *basename,
529 GMythDbusServerPrivate *priv;
530 RecordedInfo *record_info;
533 g_debug ("%s:%d", __FUNCTION__, __LINE__);
534 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
536 g_return_val_if_fail (priv->myth_backend, FALSE);
537 g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
539 record_type = GMYTH_DBUS_RECORD_G_TYPE;
541 record_info = gmyth_scheduler_get_recorded_info (priv->myth_scheduler,
548 g_value_init (&r, record_type);
549 g_value_take_boxed (&r,
550 dbus_g_type_specialized_construct (record_type));
552 gmyth_dbus_server_parse_recorded_info (record_info, &r);
553 gmyth_recorded_info_free (record_info);
555 *info = g_value_get_boxed (&r);
565 gmyth_dbus_server_get_recorded_list (GObject *obj,
573 GMythDbusServerPrivate *priv;
575 g_debug ("%s:%d", __FUNCTION__, __LINE__);
576 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
578 g_return_val_if_fail (priv->myth_backend, FALSE);
579 g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
582 len = gmyth_scheduler_get_recorded_list (priv->myth_scheduler,
585 record_type = GMYTH_DBUS_RECORD_G_TYPE;
586 *records = g_ptr_array_sized_new (len);
588 for (walk = list; walk != NULL; walk = walk->next)
590 GValue record = { 0, };
593 data = (RecordedInfo *) walk->data;
595 g_value_init (&record, record_type);
596 g_value_take_boxed (&record,
597 dbus_g_type_specialized_construct (record_type));
599 gmyth_dbus_server_parse_recorded_info (data, &record);
601 g_ptr_array_add (*records, g_value_get_boxed (&record));
602 //g_value_unset (&record);
605 gmyth_recorded_info_list_free (list);
612 gmyth_dbus_server_get_schedule_list (GObject *obj,
613 GPtrArray **schedules)
619 GMythDbusServerPrivate *priv;
621 g_debug ("%s:%d", __FUNCTION__, __LINE__);
622 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
624 g_return_val_if_fail (priv->myth_backend, FALSE);
625 g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
628 len = gmyth_scheduler_get_schedule_list (priv->myth_scheduler,
631 *schedules = g_ptr_array_sized_new (len);
632 schedule_type = GMYTH_DBUS_SCHEDULE_G_TYPE;
634 for (walk = list; walk != NULL; walk = walk->next)
636 GValue schedule = { 0, };
638 gchar *start_str_time;
641 data = (ScheduleInfo *) walk->data;
643 g_value_init (&schedule, schedule_type);
644 g_value_take_boxed (&schedule,
645 dbus_g_type_specialized_construct (schedule_type));
647 start_str_time = g_time_val_to_iso8601 (data->start_time);
648 end_str_time = g_time_val_to_iso8601 (data->end_time);
650 dbus_g_type_struct_set (&schedule,
651 0, data->schedule_id,
657 6, data->subtitle->str,
658 7, data->description->str,
659 8, data->category->str,
663 g_ptr_array_add (*schedules, g_value_get_boxed (&schedule));
665 g_free (start_str_time);
666 g_free (end_str_time);
669 gmyth_schedule_info_list_free (list);
676 gmyth_dbus_server_get_thumbnail (GObject *obj,
681 GMythFileTransfer *file_transfer;
683 GMythFileReadResult result;
684 GMythDbusServerPrivate *priv;
686 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
688 g_return_val_if_fail (priv->myth_backend, FALSE);
690 if (!gmyth_util_file_exists (priv->myth_backend, uri))
693 file_transfer = gmyth_file_transfer_new (priv->myth_backend);
695 if (!gmyth_file_transfer_open (file_transfer, uri))
698 filesize = gmyth_file_transfer_get_filesize (file_transfer);
702 *image = g_byte_array_new ();
703 result = gmyth_file_transfer_read (file_transfer, *image, filesize, FALSE);
704 if (result == GMYTH_FILE_READ_ERROR)
707 gmyth_file_transfer_close (file_transfer);
708 g_object_unref (file_transfer);
710 if (filesize > (*image)->len)
717 g_byte_array_free (*image, TRUE);
718 g_object_unref(file_transfer);
723 gmyth_dbus_server_get_channel_icon (GObject *obj,
728 GMythChannelInfo *channel = NULL;
731 GMythDbusServerPrivate *priv;
733 g_debug ("%s:%d", __FUNCTION__, __LINE__);
734 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
735 g_return_val_if_fail (priv->myth_backend, FALSE);
737 channel = gmyth_epg_get_channel_info (priv->myth_epg,
745 if (!gmyth_epg_channel_has_icon(priv->myth_epg, channel))
747 gmyth_channel_info_free (channel);
748 g_debug("Channel does not have icon available");
754 if (!gmyth_epg_channel_get_icon (priv->myth_epg,
759 gmyth_channel_info_free (channel);
760 g_warning("Could not get channel icon for channel id = %u", channel_id);
764 *icon = g_byte_array_sized_new (icon_length);
765 *icon = g_byte_array_append (*icon, icon_data, icon_length);
768 gmyth_channel_info_free(channel);
774 gmyth_dbus_server_stop_recording (GObject *obj,
779 gboolean ret = FALSE;
780 GMythDbusServerPrivate *priv;
782 g_debug ("%s:%d", __FUNCTION__, __LINE__);
783 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
785 g_return_val_if_fail (priv->myth_backend, FALSE);
786 g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
788 ret = gmyth_scheduler_stop_recording (priv->myth_scheduler,
795 gmyth_dbus_server_new_schedule_info (const gchar* description,
798 GTimeVal *start_vtime,
801 ScheduleInfo *new_sched_info;
803 new_sched_info = g_new0(ScheduleInfo, 1);
805 /* record_id == -1 for generating a new id */
806 new_sched_info->schedule_id = -1;
808 new_sched_info->channel_id = channel_id;
809 new_sched_info->program_id = program_id;
810 new_sched_info->start_time = g_new0 (GTimeVal, 1);
811 *new_sched_info->start_time = *start_vtime;
812 new_sched_info->end_time = g_new0 (GTimeVal, 1);
813 *new_sched_info->end_time = *end_vtime;
815 /* TODO: there is no frequency field */
816 /*new_sched_info->frequency = -1;*/
818 if (description != NULL) {
819 /* FIXME: description parameter is used as title and description */
820 new_sched_info->title = g_string_new(description);
821 new_sched_info->description = g_string_new(description);
824 return new_sched_info;
828 gmyth_dbus_server_add_schedule (GObject *obj,
831 const gchar *start_time,
832 const gchar *end_time,
834 const gchar *description,
838 ScheduleInfo *sch_info;
839 GTimeVal start_vtime;
841 GMythDbusServerPrivate *priv;
843 g_debug ("%s:%d", __FUNCTION__, __LINE__);
844 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
848 g_return_val_if_fail (priv->myth_backend, FALSE);
849 g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
852 g_time_val_from_iso8601 (start_time, &start_vtime);
853 g_time_val_from_iso8601 (end_time, &end_vtime);
854 sch_info = gmyth_dbus_server_new_schedule_info (description,
859 if (sch_info != NULL) {
860 GMythScheduleType type;
865 GMYTH_SCHEDULE_ALL_OCCURRENCES :
866 GMYTH_SCHEDULE_ONE_OCCURRENCE);
868 g_get_current_time (&t_now);
870 has_record = gmyth_scheduler_was_recorded_before (priv->myth_scheduler,
872 (time_t) start_vtime.tv_sec);
875 if ((t_now.tv_sec >= start_vtime.tv_sec)
876 && (t_now.tv_sec <= end_vtime.tv_sec) && has_record)
879 gboolean res = FALSE;
881 socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
882 res = gmyth_scheduler_reactivate_schedule(priv->myth_scheduler,
884 (time_t) start_vtime.tv_sec);
886 GMythStringList *slist = gmyth_string_list_new();
888 gmyth_string_list_append_char_array(slist, "RESCHEDULE_RECORDINGS 0");
889 gmyth_socket_sendreceive_stringlist(socket, slist);
890 res = (gmyth_string_list_get_int(slist, 0) == 1);
891 g_object_unref(slist);
894 g_object_unref(socket);
899 if (!gmyth_scheduler_add_schedule_full (priv->myth_scheduler,
903 g_warning("Could not add schedule entry");
907 (*schedule_id) = sch_info->schedule_id;
908 gmyth_schedule_info_free (sch_info);
916 gmyth_dbus_server_add_exception (GObject *obj,
920 const gchar *start_time,
921 const gchar *end_time,
922 const gchar *description,
925 ScheduleInfo *sch_info;
926 GTimeVal start_vtime;
928 GMythDbusServerPrivate *priv;
930 g_debug ("%s:%d", __FUNCTION__, __LINE__);
931 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
933 g_return_val_if_fail (priv->myth_backend, FALSE);
934 g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
936 g_time_val_from_iso8601 (start_time, &start_vtime);
937 g_time_val_from_iso8601 (end_time, &end_vtime);
939 sch_info = gmyth_dbus_server_new_schedule_info (description,
944 if (sch_info != NULL)
946 if (!gmyth_scheduler_add_exception (priv->myth_scheduler,
950 g_warning ("Could not add schedule exception");
951 gmyth_schedule_info_free (sch_info);
955 gmyth_schedule_info_free (sch_info);
962 gmyth_dbus_server_remove_schedule (GObject *obj,
966 GMythDbusServerPrivate *priv;
968 g_debug ("%s:%d", __FUNCTION__, __LINE__);
969 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
971 g_return_val_if_fail (priv->myth_backend, FALSE);
972 g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
974 return gmyth_scheduler_delete_schedule (priv->myth_scheduler, schedule_id);
978 gmyth_dbus_server_start_dbus_service (void)
980 GError *error = NULL;
982 DBusGConnection *bus;
984 GMythDbusServer *self;
986 self = g_object_new (GMYTH_DBUS_SERVER_TYPE, NULL);
987 g_return_val_if_fail (self, FALSE);
989 /* TODO: should verify if this service was already started */
991 /* connect to session bus */
992 bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
995 g_warning ("Could not connect to dbus: %s", error->message);
996 g_error_free (error);
1000 /* register dbus object */
1001 dbus_g_connection_register_g_object (bus,
1002 GMYTH_DBUS_SERVER_PATH, G_OBJECT (self));
1004 proxy = dbus_g_proxy_new_for_name (bus, DBUS_SERVICE_DBUS,
1005 DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
1007 /* registering download manager service */
1008 if (!org_freedesktop_DBus_request_name (proxy, GMYTH_DBUS_SERVER_IFACE,
1009 0, &request_ret, &error))
1011 g_warning ("Unable to register dbus service: %d %s",
1012 error->code, error->message);
1013 g_error_free (error);
1017 if (request_ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
1019 g_warning ("Got result code %u from requesting name", request_ret);
1026 g_object_unref (self);