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;
45 GMythScheduler *myth_scheduler;
48 #define GMYTH_DBUS_SERVER_GET_PRIVATE(o) \
49 (G_TYPE_INSTANCE_GET_PRIVATE ((o), GMYTH_DBUS_SERVER_TYPE, GMythDbusServerPrivate))
51 static void gmyth_dbus_server_class_init (GMythDbusServerClass *klass);
52 static void gmyth_dbus_server_init (GMythDbusServer *self);
53 static void gmyth_dbus_server_dispose (GObject *object);
54 static void gmyth_dbus_server_finalize (GObject *object);
57 static gboolean gmyth_dbus_server_connect (GObject *obj,
61 const gchar *password,
64 static gboolean gmyth_dbus_server_get_channel_list (GObject *obj,
67 static gboolean gmyth_dbus_server_get_channel_info (GObject *obj,
71 static gboolean gmyth_dbus_server_file_exists (GObject *obj,
72 const gchar *file_name,
75 static gboolean gmyth_dbus_server_get_recorded_list (GObject *obj,
78 static gboolean gmyth_dbus_server_get_recorded_info (GObject *obj,
79 const gchar *basename,
82 static gboolean gmyth_dbus_server_get_program_list (GObject *obj,
84 const gchar *start_time,
85 const gchar *end_time,
86 GPtrArray **program_list);
87 static gboolean gmyth_dbus_server_get_schedule_list (GObject *obj,
88 GPtrArray **schedule_list);
90 static gboolean gmyth_dbus_server_connected (GObject *obj,
93 static gboolean gmyth_dbus_server_disconnect (GObject *obj,
95 static gboolean gmyth_dbus_server_get_server_info (GObject *obj,
100 static gboolean gmyth_dbus_server_get_thumbnail (GObject *obj,
104 static gboolean gmyth_dbus_server_get_channel_icon (GObject *obj,
108 static gboolean gmyth_dbus_server_stop_recording (GObject *obj,
112 static gboolean gmyth_dbus_server_add_schedule (GObject *obj,
115 const gchar *start_time,
116 const gchar *end_time,
118 const gchar *description,
121 static gboolean gmyth_dbus_server_add_exception (GObject *obj,
125 const gchar *start_time,
126 const gchar *end_time,
127 const gchar *description,
129 static gboolean gmyth_dbus_server_remove_schedule (GObject *obj,
134 #include "gmyth-dbus-server-glue.h"
137 G_DEFINE_TYPE (GMythDbusServer, gmyth_dbus_server, G_TYPE_OBJECT);
140 gmyth_dbus_server_class_init (GMythDbusServerClass *klass)
142 GObjectClass *object_class = G_OBJECT_CLASS (klass);
144 g_type_class_add_private (klass, sizeof (GMythDbusServerPrivate));
146 object_class->dispose = gmyth_dbus_server_dispose;
147 object_class->finalize = gmyth_dbus_server_finalize;
149 dbus_g_object_type_install_info (GMYTH_DBUS_SERVER_TYPE,
150 &dbus_glib_gmyth_dbus_server_object_info);
154 gmyth_dbus_server_init (GMythDbusServer *self)
159 gmyth_dbus_server_dispose (GObject *object)
161 G_OBJECT_CLASS (gmyth_dbus_server_parent_class)->dispose (object);
165 gmyth_dbus_server_finalize (GObject *object)
167 G_OBJECT_CLASS (gmyth_dbus_server_parent_class)->finalize (object);
171 gmyth_dbus_server_connect_epg (GMythDbusServer *server)
173 GMythDbusServerPrivate *priv;
174 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (server);
176 if (!priv->connected)
181 priv->myth_epg = gmyth_epg_new();
182 if (!gmyth_epg_connect (priv->myth_epg, priv->myth_backend))
184 g_object_unref (priv->myth_epg);
185 priv->myth_epg = NULL;
194 gmyth_dbus_server_connect_scheduler (GMythDbusServer *server)
196 GMythDbusServerPrivate *priv;
197 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (server);
199 if (!priv->connected)
202 if (!priv->myth_scheduler)
204 priv->myth_scheduler = gmyth_scheduler_new ();
205 if (!gmyth_scheduler_connect (priv->myth_scheduler,
208 g_object_unref (priv->myth_scheduler);
209 priv->myth_scheduler = NULL;
218 gmyth_dbus_server_connect (GObject *obj,
222 const gchar *password,
227 GMythDbusServerPrivate *priv;
229 g_debug ("%s:%d", __FUNCTION__, __LINE__);
231 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
233 if (priv->myth_backend)
236 priv->myth_backend = gmyth_backend_info_new_full (host,
242 s = gmyth_backend_info_get_connected_socket (priv->myth_backend);
250 g_debug ("FAIL TO CONNECT");
251 g_object_unref (priv->myth_backend);
252 priv->myth_backend = NULL;
256 priv->connected = *result;
261 gmyth_dbus_server_connected (GObject *obj,
265 GMythDbusServerPrivate *priv;
267 g_debug ("%s:%d", __FUNCTION__, __LINE__);
269 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
271 if (priv->myth_backend)
279 gmyth_dbus_server_disconnect (GObject *obj,
282 GMythDbusServerPrivate *priv;
284 g_debug ("%s:%d", __FUNCTION__, __LINE__);
286 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
290 g_object_unref (priv->myth_epg);
291 priv->myth_epg = NULL;
295 if (priv->myth_backend)
297 g_object_unref (priv->myth_backend);
298 priv->myth_backend = NULL;
301 if (priv->myth_scheduler)
303 g_object_unref (priv->myth_scheduler);
304 priv->myth_scheduler = NULL;
312 gmyth_dbus_server_get_server_info (GObject *obj,
313 guint64 *total_space,
318 GMythBackendDetails *details;
319 GMythDbusServerPrivate *priv;
320 gboolean ret = FALSE;
323 g_debug ("%s:%d", __FUNCTION__, __LINE__);
324 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
326 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
328 socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
331 gmyth_util_get_backend_details (socket,
335 *total_space = details->total_space;
336 *used_space = details->used_space;
337 *free_space = *total_space - *used_space;
338 gmyth_util_backend_details_free (details);
343 g_object_unref (socket);
350 gmyth_dbus_server_parse_channel_info (GMythChannelInfo *info,
353 dbus_g_type_struct_set (val,
355 1, info->channel_num->str,
356 2, info->channel_name->str,
357 3, info->channel_icon->str,
362 gmyth_dbus_server_get_channel_info (GObject *obj,
368 GMythChannelInfo *ch_info;
369 GMythDbusServerPrivate *priv;
371 g_debug ("%s:%d", __FUNCTION__, __LINE__);
372 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
374 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
376 if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)))
379 ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
381 ch_info = gmyth_epg_get_channel_info (priv->myth_epg, channel_id);
385 g_value_init (&v, ch_type);
386 g_value_take_boxed (&v, dbus_g_type_specialized_construct (ch_type));
387 gmyth_dbus_server_parse_channel_info (ch_info, &v);
389 *info = g_value_get_boxed (&v);
398 gmyth_dbus_server_get_channel_list (GObject *obj,
399 GPtrArray **channels,
406 GMythDbusServerPrivate *priv;
408 g_debug ("%s:%d", __FUNCTION__, __LINE__);
409 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
411 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
412 if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)))
417 len = gmyth_epg_get_channel_list (priv->myth_epg, &lst);
419 *channels = g_ptr_array_sized_new (len);
420 ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
422 for (walk = lst; walk != NULL; walk = walk->next)
425 GMythChannelInfo *data;
427 data = (GMythChannelInfo *) walk->data;
429 g_value_init (&ch, ch_type);
430 g_value_take_boxed (&ch, dbus_g_type_specialized_construct (ch_type));
431 gmyth_dbus_server_parse_channel_info (data, &ch);
432 g_ptr_array_add (*channels, g_value_get_boxed (&ch));
435 gmyth_free_channel_list (lst);
440 gmyth_dbus_server_file_exists (GObject *obj,
441 const gchar *file_name,
445 GMythDbusServerPrivate *priv;
446 g_debug ("%s:%d", __FUNCTION__, __LINE__);
447 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
449 g_return_val_if_fail (priv->myth_backend, FALSE);
451 *exists = gmyth_util_file_exists (priv->myth_backend, file_name);
457 gmyth_dbus_server_get_program_list (GObject *obj,
459 const gchar *start_time,
460 const gchar *end_time,
461 GPtrArray **programs)
467 GTimeVal start_time_val;
468 GTimeVal end_time_val;
469 GMythDbusServerPrivate *priv;
471 g_debug ("%s:%d", __FUNCTION__, __LINE__);
472 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
474 g_return_val_if_fail (priv->myth_backend, FALSE);
475 if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)))
478 g_time_val_from_iso8601 (start_time, &start_time_val);
479 g_time_val_from_iso8601 (end_time, &end_time_val);
482 len = gmyth_epg_get_program_list (priv->myth_epg,
488 *programs = g_ptr_array_sized_new (len);
489 program_type = GMYTH_DBUS_PROGRAM_G_TYPE;
491 for (walk = list; walk != NULL; walk = walk->next)
493 GValue program = { 0, };
496 GMythProgramInfo *data;
498 data = (GMythProgramInfo *) walk->data;
503 g_value_init (&program, program_type);
504 g_value_take_boxed (&program,
505 dbus_g_type_specialized_construct (program_type));
507 start_str = g_time_val_to_iso8601 (data->startts);
508 end_str = g_time_val_to_iso8601 (data->endts);
510 dbus_g_type_struct_set (&program,
511 0, data->chanid->str,
515 4, data->subtitle->str,
516 5, data->description->str,
517 6, data->category->str,
520 g_ptr_array_add (*programs, g_value_get_boxed (&program));
526 gmyth_free_program_list (list);
528 g_debug ("%s:%d", __FUNCTION__, __LINE__);
533 gmyth_dbus_server_parse_recorded_info (RecordedInfo *info,
539 start_str = g_time_val_to_iso8601 (info->start_time);
540 end_str = g_time_val_to_iso8601 (info->end_time);
542 dbus_g_type_struct_set (val,
549 6, info->subtitle->str,
550 7, info->description->str,
551 8, info->category->str,
552 9, info->basename->str,
560 gmyth_dbus_server_get_recorded_info (GObject *obj,
561 const gchar *basename,
566 GMythDbusServerPrivate *priv;
567 RecordedInfo *record_info;
570 g_debug ("%s:%d", __FUNCTION__, __LINE__);
571 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
573 g_return_val_if_fail (priv->myth_backend, FALSE);
575 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
578 record_type = GMYTH_DBUS_RECORD_G_TYPE;
580 record_info = gmyth_scheduler_get_recorded_info (priv->myth_scheduler,
587 g_value_init (&r, record_type);
588 g_value_take_boxed (&r,
589 dbus_g_type_specialized_construct (record_type));
591 gmyth_dbus_server_parse_recorded_info (record_info, &r);
592 gmyth_recorded_info_free (record_info);
594 *info = g_value_get_boxed (&r);
604 gmyth_dbus_server_get_recorded_list (GObject *obj,
612 GMythDbusServerPrivate *priv;
614 g_debug ("%s:%d", __FUNCTION__, __LINE__);
615 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
617 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
618 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
622 len = gmyth_scheduler_get_recorded_list (priv->myth_scheduler,
625 record_type = GMYTH_DBUS_RECORD_G_TYPE;
626 *records = g_ptr_array_sized_new (len);
628 for (walk = list; walk != NULL; walk = walk->next)
630 GValue record = { 0, };
633 data = (RecordedInfo *) walk->data;
635 g_value_init (&record, record_type);
636 g_value_take_boxed (&record,
637 dbus_g_type_specialized_construct (record_type));
639 gmyth_dbus_server_parse_recorded_info (data, &record);
641 g_ptr_array_add (*records, g_value_get_boxed (&record));
642 //g_value_unset (&record);
645 gmyth_recorded_info_list_free (list);
652 gmyth_dbus_server_get_schedule_list (GObject *obj,
653 GPtrArray **schedules)
659 GMythDbusServerPrivate *priv;
661 g_debug ("%s:%d", __FUNCTION__, __LINE__);
662 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
664 g_return_val_if_fail (priv->myth_backend, FALSE);
665 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
669 len = gmyth_scheduler_get_schedule_list (priv->myth_scheduler,
672 *schedules = g_ptr_array_sized_new (len);
673 schedule_type = GMYTH_DBUS_SCHEDULE_G_TYPE;
675 for (walk = list; walk != NULL; walk = walk->next)
677 GValue schedule = { 0, };
679 gchar *start_str_time;
682 data = (ScheduleInfo *) walk->data;
684 g_value_init (&schedule, schedule_type);
685 g_value_take_boxed (&schedule,
686 dbus_g_type_specialized_construct (schedule_type));
688 start_str_time = g_time_val_to_iso8601 (data->start_time);
689 end_str_time = g_time_val_to_iso8601 (data->end_time);
691 dbus_g_type_struct_set (&schedule,
692 0, data->schedule_id,
698 6, data->subtitle->str,
699 7, data->description->str,
700 8, data->category->str,
704 g_ptr_array_add (*schedules, g_value_get_boxed (&schedule));
706 g_free (start_str_time);
707 g_free (end_str_time);
710 gmyth_schedule_info_list_free (list);
717 gmyth_dbus_server_get_thumbnail (GObject *obj,
722 GMythFileTransfer *file_transfer;
724 GMythFileReadResult result;
725 GMythDbusServerPrivate *priv;
727 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
729 file_transfer = NULL;
731 g_return_val_if_fail (priv->myth_backend, FALSE);
733 if (!gmyth_util_file_exists (priv->myth_backend, uri))
736 file_transfer = gmyth_file_transfer_new (priv->myth_backend);
738 if (!gmyth_file_transfer_open (file_transfer, uri))
741 filesize = gmyth_file_transfer_get_filesize (file_transfer);
745 *image = g_byte_array_new ();
746 result = gmyth_file_transfer_read (file_transfer, *image, filesize, FALSE);
747 if (result == GMYTH_FILE_READ_ERROR)
750 gmyth_file_transfer_close (file_transfer);
751 g_object_unref (file_transfer);
753 if (filesize > (*image)->len)
760 g_byte_array_free (*image, TRUE);
761 g_object_unref(file_transfer);
766 gmyth_dbus_server_get_channel_icon (GObject *obj,
771 GMythChannelInfo *channel = NULL;
774 GMythDbusServerPrivate *priv;
776 g_debug ("%s:%d", __FUNCTION__, __LINE__);
777 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
778 g_return_val_if_fail (priv->myth_backend, FALSE);
780 channel = gmyth_epg_get_channel_info (priv->myth_epg,
788 if (!gmyth_epg_channel_has_icon(priv->myth_epg, channel))
790 gmyth_channel_info_free (channel);
791 g_debug("Channel does not have icon available");
797 if (!gmyth_epg_channel_get_icon (priv->myth_epg,
802 gmyth_channel_info_free (channel);
803 g_warning("Could not get channel icon for channel id = %u", channel_id);
807 *icon = g_byte_array_sized_new (icon_length);
808 *icon = g_byte_array_append (*icon, icon_data, icon_length);
811 gmyth_channel_info_free(channel);
817 gmyth_dbus_server_stop_recording (GObject *obj,
822 gboolean ret = FALSE;
823 GMythDbusServerPrivate *priv;
825 g_debug ("%s:%d", __FUNCTION__, __LINE__);
826 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
828 g_return_val_if_fail (priv->myth_backend, FALSE);
829 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
832 ret = gmyth_scheduler_stop_recording (priv->myth_scheduler,
839 gmyth_dbus_server_new_schedule_info (const gchar* description,
842 GTimeVal *start_vtime,
845 ScheduleInfo *new_sched_info;
847 new_sched_info = g_new0(ScheduleInfo, 1);
849 /* record_id == -1 for generating a new id */
850 new_sched_info->schedule_id = -1;
852 new_sched_info->channel_id = channel_id;
853 new_sched_info->program_id = program_id;
854 new_sched_info->start_time = g_new0 (GTimeVal, 1);
855 *new_sched_info->start_time = *start_vtime;
856 new_sched_info->end_time = g_new0 (GTimeVal, 1);
857 *new_sched_info->end_time = *end_vtime;
859 /* TODO: there is no frequency field */
860 /*new_sched_info->frequency = -1;*/
862 if (description != NULL) {
863 /* FIXME: description parameter is used as title and description */
864 new_sched_info->title = g_string_new(description);
865 new_sched_info->description = g_string_new(description);
868 return new_sched_info;
872 gmyth_dbus_server_add_schedule (GObject *obj,
875 const gchar *start_time,
876 const gchar *end_time,
878 const gchar *description,
882 ScheduleInfo *sch_info;
883 GTimeVal start_vtime;
885 GMythDbusServerPrivate *priv;
887 g_debug ("%s:%d", __FUNCTION__, __LINE__);
888 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
892 g_return_val_if_fail (priv->myth_backend, FALSE);
894 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
898 g_time_val_from_iso8601 (start_time, &start_vtime);
899 g_time_val_from_iso8601 (end_time, &end_vtime);
900 sch_info = gmyth_dbus_server_new_schedule_info (description,
905 if (sch_info != NULL) {
906 GMythScheduleType type;
911 GMYTH_SCHEDULE_ALL_OCCURRENCES :
912 GMYTH_SCHEDULE_ONE_OCCURRENCE);
914 g_get_current_time (&t_now);
916 has_record = gmyth_scheduler_was_recorded_before (priv->myth_scheduler,
918 (time_t) start_vtime.tv_sec);
921 if ((t_now.tv_sec >= start_vtime.tv_sec)
922 && (t_now.tv_sec <= end_vtime.tv_sec) && has_record)
925 gboolean res = FALSE;
927 socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
928 res = gmyth_scheduler_reactivate_schedule(priv->myth_scheduler,
930 (time_t) start_vtime.tv_sec);
932 GMythStringList *slist = gmyth_string_list_new();
934 gmyth_string_list_append_char_array(slist, "RESCHEDULE_RECORDINGS 0");
935 gmyth_socket_sendreceive_stringlist(socket, slist);
936 res = (gmyth_string_list_get_int(slist, 0) == 1);
937 g_object_unref(slist);
940 g_object_unref(socket);
945 if (!gmyth_scheduler_add_schedule_full (priv->myth_scheduler,
949 g_warning("Could not add schedule entry");
953 (*schedule_id) = sch_info->schedule_id;
954 gmyth_schedule_info_free (sch_info);
962 gmyth_dbus_server_add_exception (GObject *obj,
966 const gchar *start_time,
967 const gchar *end_time,
968 const gchar *description,
971 ScheduleInfo *sch_info;
972 GTimeVal start_vtime;
974 GMythDbusServerPrivate *priv;
976 g_debug ("%s:%d", __FUNCTION__, __LINE__);
977 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
979 g_return_val_if_fail (priv->myth_backend, FALSE);
981 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
984 g_time_val_from_iso8601 (start_time, &start_vtime);
985 g_time_val_from_iso8601 (end_time, &end_vtime);
987 sch_info = gmyth_dbus_server_new_schedule_info (description,
992 if (sch_info != NULL)
994 if (!gmyth_scheduler_add_exception (priv->myth_scheduler,
998 g_warning ("Could not add schedule exception");
999 gmyth_schedule_info_free (sch_info);
1003 gmyth_schedule_info_free (sch_info);
1010 gmyth_dbus_server_remove_schedule (GObject *obj,
1014 GMythDbusServerPrivate *priv;
1016 g_debug ("%s:%d", __FUNCTION__, __LINE__);
1017 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
1019 g_return_val_if_fail (priv->myth_backend, FALSE);
1021 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
1024 return gmyth_scheduler_delete_schedule (priv->myth_scheduler, schedule_id);
1028 gmyth_dbus_server_start_dbus_service (void)
1030 GError *error = NULL;
1032 DBusGConnection *bus;
1034 GMythDbusServer *self;
1036 self = g_object_new (GMYTH_DBUS_SERVER_TYPE, NULL);
1037 g_return_val_if_fail (self, FALSE);
1039 /* TODO: should verify if this service was already started */
1041 /* connect to session bus */
1042 bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
1045 g_warning ("Could not connect to dbus: %s", error->message);
1046 g_error_free (error);
1050 /* register dbus object */
1051 dbus_g_connection_register_g_object (bus,
1052 GMYTH_DBUS_SERVER_PATH, G_OBJECT (self));
1054 proxy = dbus_g_proxy_new_for_name (bus, DBUS_SERVICE_DBUS,
1055 DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
1057 /* registering download manager service */
1058 if (!org_freedesktop_DBus_request_name (proxy, GMYTH_DBUS_SERVER_IFACE,
1059 0, &request_ret, &error))
1061 g_warning ("Unable to register dbus service: %d %s",
1062 error->code, error->message);
1063 g_error_free (error);
1067 if (request_ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
1069 g_warning ("Got result code %u from requesting name", request_ret);
1076 g_object_unref (self);