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)
235 gmyth_dbus_server_disconnect (obj, NULL);
238 priv->myth_backend = gmyth_backend_info_new_full (host,
244 s = gmyth_backend_info_get_connected_socket (priv->myth_backend);
252 g_debug ("FAIL TO CONNECT");
253 g_object_unref (priv->myth_backend);
254 priv->myth_backend = NULL;
258 priv->connected = *result;
263 gmyth_dbus_server_connected (GObject *obj,
267 GMythDbusServerPrivate *priv;
269 g_debug ("%s:%d", __FUNCTION__, __LINE__);
271 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
273 if (priv->myth_backend)
281 gmyth_dbus_server_disconnect (GObject *obj,
284 GMythDbusServerPrivate *priv;
286 g_debug ("%s:%d", __FUNCTION__, __LINE__);
288 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
292 g_object_unref (priv->myth_epg);
293 priv->myth_epg = NULL;
297 if (priv->myth_backend)
299 g_object_unref (priv->myth_backend);
300 priv->myth_backend = NULL;
303 if (priv->myth_scheduler)
305 g_object_unref (priv->myth_scheduler);
306 priv->myth_scheduler = NULL;
314 gmyth_dbus_server_get_server_info (GObject *obj,
315 guint64 *total_space,
320 GMythBackendDetails *details;
321 GMythDbusServerPrivate *priv;
322 gboolean ret = FALSE;
325 g_debug ("%s:%d", __FUNCTION__, __LINE__);
326 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
328 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
330 socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
333 gmyth_util_get_backend_details (socket,
337 *total_space = details->total_space;
338 *used_space = details->used_space;
339 *free_space = *total_space - *used_space;
340 gmyth_util_backend_details_free (details);
345 g_object_unref (socket);
352 gmyth_dbus_server_parse_channel_info (GMythChannelInfo *info,
355 dbus_g_type_struct_set (val,
357 1, info->channel_num->str,
358 2, info->channel_name->str,
359 3, info->channel_icon->str,
364 gmyth_dbus_server_get_channel_info (GObject *obj,
370 GMythChannelInfo *ch_info;
371 GMythDbusServerPrivate *priv;
373 g_debug ("%s:%d", __FUNCTION__, __LINE__);
374 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
376 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
378 if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)))
381 ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
383 ch_info = gmyth_epg_get_channel_info (priv->myth_epg, channel_id);
387 g_value_init (&v, ch_type);
388 g_value_take_boxed (&v, dbus_g_type_specialized_construct (ch_type));
389 gmyth_dbus_server_parse_channel_info (ch_info, &v);
391 *info = g_value_get_boxed (&v);
400 gmyth_dbus_server_get_channel_list (GObject *obj,
401 GPtrArray **channels,
408 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 != NULL, FALSE);
414 if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)))
419 len = gmyth_epg_get_channel_list (priv->myth_epg, &lst);
421 *channels = g_ptr_array_sized_new (len);
422 ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
424 for (walk = lst; walk != NULL; walk = walk->next)
427 GMythChannelInfo *data;
429 data = (GMythChannelInfo *) walk->data;
431 g_value_init (&ch, ch_type);
432 g_value_take_boxed (&ch, dbus_g_type_specialized_construct (ch_type));
433 gmyth_dbus_server_parse_channel_info (data, &ch);
434 g_ptr_array_add (*channels, g_value_get_boxed (&ch));
437 gmyth_free_channel_list (lst);
442 gmyth_dbus_server_file_exists (GObject *obj,
443 const gchar *file_name,
447 GMythDbusServerPrivate *priv;
448 g_debug ("%s:%d", __FUNCTION__, __LINE__);
449 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
451 g_return_val_if_fail (priv->myth_backend, FALSE);
453 *exists = gmyth_util_file_exists (priv->myth_backend, file_name);
459 gmyth_dbus_server_get_program_list (GObject *obj,
461 const gchar *start_time,
462 const gchar *end_time,
463 GPtrArray **programs)
469 GTimeVal start_time_val;
470 GTimeVal end_time_val;
471 GMythDbusServerPrivate *priv;
473 g_debug ("%s:%d", __FUNCTION__, __LINE__);
474 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
476 g_return_val_if_fail (priv->myth_backend, FALSE);
477 if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)))
480 g_time_val_from_iso8601 (start_time, &start_time_val);
481 g_time_val_from_iso8601 (end_time, &end_time_val);
484 len = gmyth_epg_get_program_list (priv->myth_epg,
490 *programs = g_ptr_array_sized_new (len);
491 program_type = GMYTH_DBUS_PROGRAM_G_TYPE;
493 for (walk = list; walk != NULL; walk = walk->next)
495 GValue program = { 0, };
498 GMythProgramInfo *data;
500 data = (GMythProgramInfo *) walk->data;
505 g_value_init (&program, program_type);
506 g_value_take_boxed (&program,
507 dbus_g_type_specialized_construct (program_type));
509 start_str = g_time_val_to_iso8601 (data->startts);
510 end_str = g_time_val_to_iso8601 (data->endts);
512 dbus_g_type_struct_set (&program,
513 0, data->chanid->str,
517 4, data->subtitle->str,
518 5, data->description->str,
519 6, data->category->str,
522 g_ptr_array_add (*programs, g_value_get_boxed (&program));
528 gmyth_free_program_list (list);
530 g_debug ("%s:%d", __FUNCTION__, __LINE__);
535 gmyth_dbus_server_parse_recorded_info (RecordedInfo *info,
541 start_str = g_time_val_to_iso8601 (info->start_time);
542 end_str = g_time_val_to_iso8601 (info->end_time);
544 dbus_g_type_struct_set (val,
551 6, info->subtitle->str,
552 7, info->description->str,
553 8, info->category->str,
554 9, info->basename->str,
562 gmyth_dbus_server_get_recorded_info (GObject *obj,
563 const gchar *basename,
568 GMythDbusServerPrivate *priv;
569 RecordedInfo *record_info;
572 g_debug ("%s:%d", __FUNCTION__, __LINE__);
573 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
575 g_return_val_if_fail (priv->myth_backend, FALSE);
577 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
580 record_type = GMYTH_DBUS_RECORD_G_TYPE;
582 record_info = gmyth_scheduler_get_recorded_info (priv->myth_scheduler,
589 g_value_init (&r, record_type);
590 g_value_take_boxed (&r,
591 dbus_g_type_specialized_construct (record_type));
593 gmyth_dbus_server_parse_recorded_info (record_info, &r);
594 gmyth_recorded_info_free (record_info);
596 *info = g_value_get_boxed (&r);
606 gmyth_dbus_server_get_recorded_list (GObject *obj,
614 GMythDbusServerPrivate *priv;
616 g_debug ("%s:%d", __FUNCTION__, __LINE__);
617 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
619 g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
620 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
624 len = gmyth_scheduler_get_recorded_list (priv->myth_scheduler,
627 record_type = GMYTH_DBUS_RECORD_G_TYPE;
628 *records = g_ptr_array_sized_new (len);
630 for (walk = list; walk != NULL; walk = walk->next)
632 GValue record = { 0, };
635 data = (RecordedInfo *) walk->data;
637 g_value_init (&record, record_type);
638 g_value_take_boxed (&record,
639 dbus_g_type_specialized_construct (record_type));
641 gmyth_dbus_server_parse_recorded_info (data, &record);
643 g_ptr_array_add (*records, g_value_get_boxed (&record));
644 //g_value_unset (&record);
647 gmyth_recorded_info_list_free (list);
654 gmyth_dbus_server_get_schedule_list (GObject *obj,
655 GPtrArray **schedules)
661 GMythDbusServerPrivate *priv;
663 g_debug ("%s:%d", __FUNCTION__, __LINE__);
664 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
666 g_return_val_if_fail (priv->myth_backend, FALSE);
667 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
671 len = gmyth_scheduler_get_schedule_list (priv->myth_scheduler,
674 *schedules = g_ptr_array_sized_new (len);
675 schedule_type = GMYTH_DBUS_SCHEDULE_G_TYPE;
677 for (walk = list; walk != NULL; walk = walk->next)
679 GValue schedule = { 0, };
681 gchar *start_str_time;
684 data = (ScheduleInfo *) walk->data;
686 g_value_init (&schedule, schedule_type);
687 g_value_take_boxed (&schedule,
688 dbus_g_type_specialized_construct (schedule_type));
690 start_str_time = g_time_val_to_iso8601 (data->start_time);
691 end_str_time = g_time_val_to_iso8601 (data->end_time);
693 dbus_g_type_struct_set (&schedule,
694 0, data->schedule_id,
700 6, data->subtitle->str,
701 7, data->description->str,
702 8, data->category->str,
706 g_ptr_array_add (*schedules, g_value_get_boxed (&schedule));
708 g_free (start_str_time);
709 g_free (end_str_time);
712 gmyth_schedule_info_list_free (list);
719 gmyth_dbus_server_get_thumbnail (GObject *obj,
724 GMythFileTransfer *file_transfer;
726 GMythFileReadResult result;
727 GMythDbusServerPrivate *priv;
729 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
731 file_transfer = NULL;
733 g_return_val_if_fail (priv->myth_backend, FALSE);
735 if (!gmyth_util_file_exists (priv->myth_backend, uri))
738 file_transfer = gmyth_file_transfer_new (priv->myth_backend);
740 if (!gmyth_file_transfer_open (file_transfer, uri))
743 filesize = gmyth_file_transfer_get_filesize (file_transfer);
747 *image = g_byte_array_new ();
748 result = gmyth_file_transfer_read (file_transfer, *image, filesize, FALSE);
749 if (result == GMYTH_FILE_READ_ERROR)
752 gmyth_file_transfer_close (file_transfer);
753 g_object_unref (file_transfer);
755 if (filesize > (*image)->len)
762 g_byte_array_free (*image, TRUE);
763 g_object_unref(file_transfer);
768 gmyth_dbus_server_get_channel_icon (GObject *obj,
773 GMythChannelInfo *channel = NULL;
776 GMythDbusServerPrivate *priv;
778 g_debug ("%s:%d", __FUNCTION__, __LINE__);
779 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
780 g_return_val_if_fail (priv->myth_backend, FALSE);
782 channel = gmyth_epg_get_channel_info (priv->myth_epg,
790 if (!gmyth_epg_channel_has_icon(priv->myth_epg, channel))
792 gmyth_channel_info_free (channel);
793 g_debug("Channel does not have icon available");
799 if (!gmyth_epg_channel_get_icon (priv->myth_epg,
804 gmyth_channel_info_free (channel);
805 g_warning("Could not get channel icon for channel id = %u", channel_id);
809 *icon = g_byte_array_sized_new (icon_length);
810 *icon = g_byte_array_append (*icon, icon_data, icon_length);
813 gmyth_channel_info_free(channel);
819 gmyth_dbus_server_stop_recording (GObject *obj,
824 gboolean ret = FALSE;
825 GMythDbusServerPrivate *priv;
827 g_debug ("%s:%d", __FUNCTION__, __LINE__);
828 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
830 g_return_val_if_fail (priv->myth_backend, FALSE);
831 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
834 ret = gmyth_scheduler_stop_recording (priv->myth_scheduler,
841 gmyth_dbus_server_new_schedule_info (const gchar* description,
844 GTimeVal *start_vtime,
847 ScheduleInfo *new_sched_info;
849 new_sched_info = g_new0(ScheduleInfo, 1);
851 /* record_id == -1 for generating a new id */
852 new_sched_info->schedule_id = -1;
854 new_sched_info->channel_id = channel_id;
855 new_sched_info->program_id = program_id;
856 new_sched_info->start_time = g_new0 (GTimeVal, 1);
857 *new_sched_info->start_time = *start_vtime;
858 new_sched_info->end_time = g_new0 (GTimeVal, 1);
859 *new_sched_info->end_time = *end_vtime;
861 /* TODO: there is no frequency field */
862 /*new_sched_info->frequency = -1;*/
864 if (description != NULL) {
865 /* FIXME: description parameter is used as title and description */
866 new_sched_info->title = g_string_new(description);
867 new_sched_info->description = g_string_new(description);
870 return new_sched_info;
874 gmyth_dbus_server_add_schedule (GObject *obj,
877 const gchar *start_time,
878 const gchar *end_time,
880 const gchar *description,
884 ScheduleInfo *sch_info;
885 GTimeVal start_vtime;
887 GMythDbusServerPrivate *priv;
889 g_debug ("%s:%d", __FUNCTION__, __LINE__);
890 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
894 g_return_val_if_fail (priv->myth_backend, FALSE);
896 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
900 g_time_val_from_iso8601 (start_time, &start_vtime);
901 g_time_val_from_iso8601 (end_time, &end_vtime);
902 sch_info = gmyth_dbus_server_new_schedule_info (description,
907 if (sch_info != NULL) {
908 GMythScheduleType type;
913 GMYTH_SCHEDULE_ALL_OCCURRENCES :
914 GMYTH_SCHEDULE_ONE_OCCURRENCE);
916 g_get_current_time (&t_now);
918 has_record = gmyth_scheduler_was_recorded_before (priv->myth_scheduler,
920 (time_t) start_vtime.tv_sec);
923 if ((t_now.tv_sec >= start_vtime.tv_sec)
924 && (t_now.tv_sec <= end_vtime.tv_sec) && has_record)
927 gboolean res = FALSE;
929 socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
930 res = gmyth_scheduler_reactivate_schedule(priv->myth_scheduler,
932 (time_t) start_vtime.tv_sec);
934 GMythStringList *slist = gmyth_string_list_new();
936 gmyth_string_list_append_char_array(slist, "RESCHEDULE_RECORDINGS 0");
937 gmyth_socket_sendreceive_stringlist(socket, slist);
938 res = (gmyth_string_list_get_int(slist, 0) == 1);
939 g_object_unref(slist);
942 g_object_unref(socket);
947 if (!gmyth_scheduler_add_schedule_full (priv->myth_scheduler,
951 g_warning("Could not add schedule entry");
955 (*schedule_id) = sch_info->schedule_id;
956 gmyth_schedule_info_free (sch_info);
964 gmyth_dbus_server_add_exception (GObject *obj,
968 const gchar *start_time,
969 const gchar *end_time,
970 const gchar *description,
973 ScheduleInfo *sch_info;
974 GTimeVal start_vtime;
976 GMythDbusServerPrivate *priv;
978 g_debug ("%s:%d", __FUNCTION__, __LINE__);
979 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
981 g_return_val_if_fail (priv->myth_backend, FALSE);
983 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
986 g_time_val_from_iso8601 (start_time, &start_vtime);
987 g_time_val_from_iso8601 (end_time, &end_vtime);
989 sch_info = gmyth_dbus_server_new_schedule_info (description,
994 if (sch_info != NULL)
996 if (!gmyth_scheduler_add_exception (priv->myth_scheduler,
1000 g_warning ("Could not add schedule exception");
1001 gmyth_schedule_info_free (sch_info);
1005 gmyth_schedule_info_free (sch_info);
1012 gmyth_dbus_server_remove_schedule (GObject *obj,
1016 GMythDbusServerPrivate *priv;
1018 g_debug ("%s:%d", __FUNCTION__, __LINE__);
1019 priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
1021 g_return_val_if_fail (priv->myth_backend, FALSE);
1023 if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
1026 return gmyth_scheduler_delete_schedule (priv->myth_scheduler, schedule_id);
1030 gmyth_dbus_server_start_dbus_service (void)
1032 GError *error = NULL;
1034 DBusGConnection *bus;
1036 GMythDbusServer *self;
1038 self = g_object_new (GMYTH_DBUS_SERVER_TYPE, NULL);
1039 g_return_val_if_fail (self, FALSE);
1041 /* TODO: should verify if this service was already started */
1043 /* connect to session bus */
1044 bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
1047 g_warning ("Could not connect to dbus: %s", error->message);
1048 g_error_free (error);
1052 /* register dbus object */
1053 dbus_g_connection_register_g_object (bus,
1054 GMYTH_DBUS_SERVER_PATH, G_OBJECT (self));
1056 proxy = dbus_g_proxy_new_for_name (bus, DBUS_SERVICE_DBUS,
1057 DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
1059 /* registering download manager service */
1060 if (!org_freedesktop_DBus_request_name (proxy, GMYTH_DBUS_SERVER_IFACE,
1061 0, &request_ret, &error))
1063 g_warning ("Unable to register dbus service: %d %s",
1064 error->code, error->message);
1065 g_error_free (error);
1069 if (request_ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
1071 g_warning ("Got result code %u from requesting name", request_ret);
1078 g_object_unref (self);