aboutsummaryrefslogtreecommitdiff
path: root/src/mpris2-watcher.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-09-28 14:34:36 -0400
committerKen VanDine <ken.vandine@canonical.com>2011-09-28 14:34:36 -0400
commitbf90e843f9ecc907ab917d3d3b540014137d6964 (patch)
treec99b9ca5d7821632919c2d57cf17b707a3b53841 /src/mpris2-watcher.c
parentec7f559d69b40d9186cb307cb0dde5c600bd8c0b (diff)
parentf5e29e773bd56d7aa6e459c46db6f68a4dd7f845 (diff)
downloadayatana-indicator-sound-bf90e843f9ecc907ab917d3d3b540014137d6964.tar.gz
ayatana-indicator-sound-bf90e843f9ecc907ab917d3d3b540014137d6964.tar.bz2
ayatana-indicator-sound-bf90e843f9ecc907ab917d3d3b540014137d6964.zip
Import upstream version 0.7.8
Diffstat (limited to 'src/mpris2-watcher.c')
-rw-r--r--src/mpris2-watcher.c572
1 files changed, 356 insertions, 216 deletions
diff --git a/src/mpris2-watcher.c b/src/mpris2-watcher.c
index 3b4c72d..9742166 100644
--- a/src/mpris2-watcher.c
+++ b/src/mpris2-watcher.c
@@ -1,4 +1,4 @@
-/* mpris2-watcher.c generated by valac 0.12.1, the Vala compiler
+/* mpris2-watcher.c generated by valac 0.14.0, the Vala compiler
* generated from mpris2-watcher.vala, do not modify */
/*
@@ -120,24 +120,38 @@ struct _Mpris2WatcherCheckForActiveClientsData {
gchar** interfaces;
gint interfaces_length1;
gint _interfaces_size_;
- gint _tmp0_;
- gchar** _tmp1_;
+ FreeDesktopObject* _tmp0_;
+ gint _tmp1_;
gchar** _tmp2_;
- gint _tmp2__length1;
- gint __tmp2__size_;
- GError * e;
+ gchar** _tmp3_;
+ gint _tmp3__length1;
+ gint __tmp3__size_;
+ GError* e;
+ GError* _tmp4_;
+ const gchar* _tmp5_;
+ gchar** _tmp6_;
+ gint _tmp6__length1;
gchar** address_collection;
- int address_collection_length1;
- int address_it;
- gchar* _tmp3_;
+ gint address_collection_length1;
+ gint _address_collection_size_;
+ gint address_it;
+ gchar* _tmp7_;
gchar* address;
- gboolean _tmp4_;
- MprisRoot* _tmp5_;
+ const gchar* _tmp8_;
+ gboolean _tmp9_;
+ const gchar* _tmp10_;
+ MprisRoot* _tmp11_;
MprisRoot* mpris2_root;
- gboolean _tmp6_;
+ MprisRoot* _tmp12_;
+ const gchar* _tmp13_;
+ gboolean _tmp14_;
gboolean use_playlists;
- gchar* _tmp7_;
- gchar* _tmp8_;
+ MprisRoot* _tmp15_;
+ gchar* _tmp16_;
+ gchar* _tmp17_;
+ gchar* _tmp18_;
+ const gchar* _tmp19_;
+ gboolean _tmp20_;
GError * _inner_error_;
};
@@ -162,7 +176,7 @@ Mpris2Watcher* mpris2_watcher_construct (GType object_type);
static void mpris2_watcher_check_for_active_clients_data_free (gpointer _data);
void mpris2_watcher_check_for_active_clients (Mpris2Watcher* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void mpris2_watcher_check_for_active_clients_finish (Mpris2Watcher* self, GAsyncResult* _res_);
-static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckForActiveClientsData* data);
+static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckForActiveClientsData* _data_);
void free_desktop_object_list_names (FreeDesktopObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
gchar** free_desktop_object_list_names_finish (FreeDesktopObject* self, GAsyncResult* _res_, int* result_length1, GError** error);
static void mpris2_watcher_check_for_active_clients_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
@@ -203,10 +217,10 @@ Mpris2Watcher* mpris2_watcher_new (void) {
static void mpris2_watcher_check_for_active_clients_data_free (gpointer _data) {
- Mpris2WatcherCheckForActiveClientsData* data;
- data = _data;
- _g_object_unref0 (data->self);
- g_slice_free (Mpris2WatcherCheckForActiveClientsData, data);
+ Mpris2WatcherCheckForActiveClientsData* _data_;
+ _data_ = _data;
+ _g_object_unref0 (_data_->self);
+ g_slice_free (Mpris2WatcherCheckForActiveClientsData, _data_);
}
@@ -217,10 +231,12 @@ static gpointer _g_object_ref0 (gpointer self) {
void mpris2_watcher_check_for_active_clients (Mpris2Watcher* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
Mpris2WatcherCheckForActiveClientsData* _data_;
+ Mpris2Watcher* _tmp0_;
_data_ = g_slice_new0 (Mpris2WatcherCheckForActiveClientsData);
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, mpris2_watcher_check_for_active_clients);
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, mpris2_watcher_check_for_active_clients_data_free);
- _data_->self = _g_object_ref0 (self);
+ _tmp0_ = _g_object_ref0 (self);
+ _data_->self = _tmp0_;
mpris2_watcher_check_for_active_clients_co (_data_);
}
@@ -232,16 +248,16 @@ void mpris2_watcher_check_for_active_clients_finish (Mpris2Watcher* self, GAsync
static void mpris2_watcher_check_for_active_clients_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
- Mpris2WatcherCheckForActiveClientsData* data;
- data = _user_data_;
- data->_source_object_ = source_object;
- data->_res_ = _res_;
- mpris2_watcher_check_for_active_clients_co (data);
+ Mpris2WatcherCheckForActiveClientsData* _data_;
+ _data_ = _user_data_;
+ _data_->_source_object_ = source_object;
+ _data_->_res_ = _res_;
+ mpris2_watcher_check_for_active_clients_co (_data_);
}
-static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckForActiveClientsData* data) {
- switch (data->_state_) {
+static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckForActiveClientsData* _data_) {
+ switch (_data_->_state_) {
case 0:
goto _state_0;
case 1:
@@ -250,144 +266,196 @@ static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckFo
g_assert_not_reached ();
}
_state_0:
- data->interfaces_length1 = 0;
- data->_interfaces_size_ = 0;
- data->_state_ = 1;
- free_desktop_object_list_names (data->self->priv->fdesktop_obj, mpris2_watcher_check_for_active_clients_ready, data);
- return FALSE;
- _state_1:
- data->_tmp1_ = NULL;
- data->_tmp1_ = free_desktop_object_list_names_finish (data->self->priv->fdesktop_obj, data->_res_, &data->_tmp0_, &data->_inner_error_);
- data->_tmp2_ = data->_tmp1_;
- data->_tmp2__length1 = data->_tmp0_;
- data->__tmp2__size_ = data->_tmp0_;
- if (data->_inner_error_ != NULL) {
- if (data->_inner_error_->domain == G_IO_ERROR) {
- goto __catch7_g_io_error;
- }
- data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL);
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code);
- g_clear_error (&data->_inner_error_);
+ _data_->interfaces_length1 = 0;
+ _data_->_interfaces_size_ = 0;
+ {
+ _data_->_tmp0_ = _data_->self->priv->fdesktop_obj;
+ _data_->_tmp1_ = 0;
+ _data_->_state_ = 1;
+ free_desktop_object_list_names (_data_->_tmp0_, mpris2_watcher_check_for_active_clients_ready, _data_);
return FALSE;
+ _state_1:
+ _data_->_tmp2_ = NULL;
+ _data_->_tmp2_ = free_desktop_object_list_names_finish (_data_->_tmp0_, _data_->_res_, &_data_->_tmp1_, &_data_->_inner_error_);
+ _data_->_tmp3_ = _data_->_tmp2_;
+ _data_->_tmp3__length1 = _data_->_tmp1_;
+ _data_->__tmp3__size_ = _data_->_tmp3__length1;
+ if (_data_->_inner_error_ != NULL) {
+ if (_data_->_inner_error_->domain == G_IO_ERROR) {
+ goto __catch7_g_io_error;
+ }
+ _data_->interfaces = (_vala_array_free (_data_->interfaces, _data_->interfaces_length1, (GDestroyNotify) g_free), NULL);
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
+ g_clear_error (&_data_->_inner_error_);
+ return FALSE;
+ }
+ _data_->interfaces = (_vala_array_free (_data_->interfaces, _data_->interfaces_length1, (GDestroyNotify) g_free), NULL);
+ _data_->interfaces = _data_->_tmp3_;
+ _data_->interfaces_length1 = _data_->_tmp3__length1;
+ _data_->_interfaces_size_ = _data_->interfaces_length1;
}
- data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL);
- data->interfaces = data->_tmp2_;
- data->interfaces_length1 = data->_tmp2__length1;
- data->_interfaces_size_ = data->_tmp2__length1;
goto __finally7;
__catch7_g_io_error:
{
- data->e = data->_inner_error_;
- data->_inner_error_ = NULL;
+ _data_->e = _data_->_inner_error_;
+ _data_->_inner_error_ = NULL;
+ _data_->_tmp4_ = _data_->e;
+ _data_->_tmp5_ = _data_->_tmp4_->message;
g_warning ("mpris2-watcher.vala:60: Mpris2watcher could fetch active interfaces at" \
-" startup: %s", data->e->message);
- _g_error_free0 (data->e);
- data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL);
- if (data->_state_ == 0) {
- g_simple_async_result_complete_in_idle (data->_async_result);
+" startup: %s", _data_->_tmp5_);
+ _g_error_free0 (_data_->e);
+ _data_->interfaces = (_vala_array_free (_data_->interfaces, _data_->interfaces_length1, (GDestroyNotify) g_free), NULL);
+ if (_data_->_state_ == 0) {
+ g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
- g_simple_async_result_complete (data->_async_result);
+ g_simple_async_result_complete (_data_->_async_result);
}
- g_object_unref (data->_async_result);
+ g_object_unref (_data_->_async_result);
return FALSE;
}
__finally7:
- if (data->_inner_error_ != NULL) {
- data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code);
- g_clear_error (&data->_inner_error_);
+ if (_data_->_inner_error_ != NULL) {
+ _data_->interfaces = (_vala_array_free (_data_->interfaces, _data_->interfaces_length1, (GDestroyNotify) g_free), NULL);
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
+ g_clear_error (&_data_->_inner_error_);
return FALSE;
}
+ _data_->_tmp6_ = _data_->interfaces;
+ _data_->_tmp6__length1 = _data_->interfaces_length1;
{
- data->address_collection = data->interfaces;
- data->address_collection_length1 = data->interfaces_length1;
- for (data->address_it = 0; data->address_it < data->interfaces_length1; data->address_it = data->address_it + 1) {
- data->_tmp3_ = g_strdup (data->address_collection[data->address_it]);
- data->address = data->_tmp3_;
+ _data_->address_collection_length1 = 0;
+ _data_->_address_collection_size_ = 0;
+ _data_->address_collection = _data_->_tmp6_;
+ _data_->address_collection_length1 = _data_->_tmp6__length1;
+ _data_->address_it = 0;
+ for (_data_->address_it = 0; _data_->address_it < _data_->_tmp6__length1; _data_->address_it = _data_->address_it + 1) {
+ _data_->_tmp7_ = g_strdup (_data_->address_collection[_data_->address_it]);
+ _data_->address = _data_->_tmp7_;
{
- data->_tmp4_ = g_str_has_prefix (data->address, MPRIS_PREFIX);
- if (data->_tmp4_) {
- data->_tmp5_ = NULL;
- data->_tmp5_ = mpris2_watcher_create_mpris_root (data->self, data->address);
- data->mpris2_root = data->_tmp5_;
- if (data->mpris2_root == NULL) {
- _g_object_unref0 (data->mpris2_root);
- _g_free0 (data->address);
- data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL);
- if (data->_state_ == 0) {
- g_simple_async_result_complete_in_idle (data->_async_result);
+ _data_->_tmp8_ = _data_->address;
+ _data_->_tmp9_ = FALSE;
+ _data_->_tmp9_ = g_str_has_prefix (_data_->_tmp8_, MPRIS_PREFIX);
+ if (_data_->_tmp9_) {
+ _data_->_tmp10_ = _data_->address;
+ _data_->_tmp11_ = NULL;
+ _data_->_tmp11_ = mpris2_watcher_create_mpris_root (_data_->self, _data_->_tmp10_);
+ _data_->mpris2_root = _data_->_tmp11_;
+ _data_->_tmp12_ = _data_->mpris2_root;
+ if (_data_->_tmp12_ == NULL) {
+ _g_object_unref0 (_data_->mpris2_root);
+ _g_free0 (_data_->address);
+ _data_->interfaces = (_vala_array_free (_data_->interfaces, _data_->interfaces_length1, (GDestroyNotify) g_free), NULL);
+ if (_data_->_state_ == 0) {
+ g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
- g_simple_async_result_complete (data->_async_result);
+ g_simple_async_result_complete (_data_->_async_result);
}
- g_object_unref (data->_async_result);
+ g_object_unref (_data_->_async_result);
return FALSE;
}
- data->_tmp6_ = mpris2_watcher_supports_playlists (data->self, data->address);
- data->use_playlists = data->_tmp6_;
- data->_tmp7_ = NULL;
- data->_tmp7_ = mpris_root_get_DesktopEntry (data->mpris2_root);
- data->_tmp8_ = data->_tmp7_;
- g_signal_emit_by_name (data->self, "client-appeared", data->_tmp8_, data->address, data->use_playlists);
- _g_free0 (data->_tmp8_);
- _g_object_unref0 (data->mpris2_root);
+ _data_->_tmp13_ = _data_->address;
+ _data_->_tmp14_ = FALSE;
+ _data_->_tmp14_ = mpris2_watcher_supports_playlists (_data_->self, _data_->_tmp13_);
+ _data_->use_playlists = _data_->_tmp14_;
+ _data_->_tmp15_ = _data_->mpris2_root;
+ _data_->_tmp16_ = mpris_root_get_DesktopEntry (_data_->_tmp15_);
+ _data_->_tmp17_ = _data_->_tmp16_;
+ _data_->_tmp18_ = _data_->_tmp17_;
+ _data_->_tmp19_ = _data_->address;
+ _data_->_tmp20_ = _data_->use_playlists;
+ g_signal_emit_by_name (_data_->self, "client-appeared", _data_->_tmp18_, _data_->_tmp19_, _data_->_tmp20_);
+ _g_free0 (_data_->_tmp18_);
+ _g_object_unref0 (_data_->mpris2_root);
}
- _g_free0 (data->address);
+ _g_free0 (_data_->address);
}
}
}
- data->interfaces = (_vala_array_free (data->interfaces, data->interfaces_length1, (GDestroyNotify) g_free), NULL);
- if (data->_state_ == 0) {
- g_simple_async_result_complete_in_idle (data->_async_result);
+ _data_->interfaces = (_vala_array_free (_data_->interfaces, _data_->interfaces_length1, (GDestroyNotify) g_free), NULL);
+ if (_data_->_state_ == 0) {
+ g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
- g_simple_async_result_complete (data->_async_result);
+ g_simple_async_result_complete (_data_->_async_result);
}
- g_object_unref (data->_async_result);
+ g_object_unref (_data_->_async_result);
return FALSE;
}
static void mpris2_watcher_name_changes_detected (Mpris2Watcher* self, FreeDesktopObject* dbus_obj, const gchar* name, const gchar* previous_owner, const gchar* current_owner) {
- MprisRoot* _tmp0_ = NULL;
+ const gchar* _tmp0_;
+ MprisRoot* _tmp1_ = NULL;
MprisRoot* mpris2_root;
- gboolean _tmp1_ = FALSE;
+ MprisRoot* _tmp2_;
+ gboolean _tmp3_ = FALSE;
+ const gchar* _tmp4_;
+ gboolean _tmp6_;
g_return_if_fail (self != NULL);
g_return_if_fail (dbus_obj != NULL);
g_return_if_fail (name != NULL);
g_return_if_fail (previous_owner != NULL);
g_return_if_fail (current_owner != NULL);
- _tmp0_ = mpris2_watcher_create_mpris_root (self, name);
- mpris2_root = _tmp0_;
- if (mpris2_root == NULL) {
+ _tmp0_ = name;
+ _tmp1_ = mpris2_watcher_create_mpris_root (self, _tmp0_);
+ mpris2_root = _tmp1_;
+ _tmp2_ = mpris2_root;
+ if (_tmp2_ == NULL) {
_g_object_unref0 (mpris2_root);
return;
}
- if (g_strcmp0 (previous_owner, "") != 0) {
- _tmp1_ = g_strcmp0 (current_owner, "") == 0;
+ _tmp4_ = previous_owner;
+ if (g_strcmp0 (_tmp4_, "") != 0) {
+ const gchar* _tmp5_;
+ _tmp5_ = current_owner;
+ _tmp3_ = g_strcmp0 (_tmp5_, "") == 0;
} else {
- _tmp1_ = FALSE;
+ _tmp3_ = FALSE;
}
- if (_tmp1_) {
- g_debug ("mpris2-watcher.vala:84: Client '%s' gone down", name);
- g_signal_emit_by_name (self, "client-disappeared", name);
+ _tmp6_ = _tmp3_;
+ if (_tmp6_) {
+ const gchar* _tmp7_;
+ const gchar* _tmp8_;
+ _tmp7_ = name;
+ g_debug ("mpris2-watcher.vala:84: Client '%s' gone down", _tmp7_);
+ _tmp8_ = name;
+ g_signal_emit_by_name (self, "client-disappeared", _tmp8_);
} else {
- gboolean _tmp2_ = FALSE;
- if (g_strcmp0 (previous_owner, "") == 0) {
- _tmp2_ = g_strcmp0 (current_owner, "") != 0;
+ gboolean _tmp9_ = FALSE;
+ const gchar* _tmp10_;
+ gboolean _tmp12_;
+ _tmp10_ = previous_owner;
+ if (g_strcmp0 (_tmp10_, "") == 0) {
+ const gchar* _tmp11_;
+ _tmp11_ = current_owner;
+ _tmp9_ = g_strcmp0 (_tmp11_, "") != 0;
} else {
- _tmp2_ = FALSE;
+ _tmp9_ = FALSE;
}
- if (_tmp2_) {
- gboolean _tmp3_;
+ _tmp12_ = _tmp9_;
+ if (_tmp12_) {
+ const gchar* _tmp13_;
+ const gchar* _tmp14_;
+ gboolean _tmp15_ = FALSE;
gboolean use_playlists;
- gchar* _tmp4_ = NULL;
- gchar* _tmp5_;
- g_debug ("mpris2-watcher.vala:88: Client '%s' has appeared", name);
- _tmp3_ = mpris2_watcher_supports_playlists (self, name);
- use_playlists = _tmp3_;
- _tmp4_ = mpris_root_get_DesktopEntry (mpris2_root);
- _tmp5_ = _tmp4_;
- g_signal_emit_by_name (self, "client-appeared", _tmp5_, name, use_playlists);
- _g_free0 (_tmp5_);
+ MprisRoot* _tmp16_;
+ gchar* _tmp17_;
+ gchar* _tmp18_;
+ gchar* _tmp19_;
+ const gchar* _tmp20_;
+ gboolean _tmp21_;
+ _tmp13_ = name;
+ g_debug ("mpris2-watcher.vala:88: Client '%s' has appeared", _tmp13_);
+ _tmp14_ = name;
+ _tmp15_ = mpris2_watcher_supports_playlists (self, _tmp14_);
+ use_playlists = _tmp15_;
+ _tmp16_ = mpris2_root;
+ _tmp17_ = mpris_root_get_DesktopEntry (_tmp16_);
+ _tmp18_ = _tmp17_;
+ _tmp19_ = _tmp18_;
+ _tmp20_ = name;
+ _tmp21_ = use_playlists;
+ g_signal_emit_by_name (self, "client-appeared", _tmp19_, _tmp20_, _tmp21_);
+ _g_free0 (_tmp19_);
}
}
_g_object_unref0 (mpris2_root);
@@ -397,36 +465,46 @@ static void mpris2_watcher_name_changes_detected (Mpris2Watcher* self, FreeDeskt
static MprisRoot* mpris2_watcher_create_mpris_root (Mpris2Watcher* self, const gchar* name) {
MprisRoot* result = NULL;
MprisRoot* mpris2_root;
- gboolean _tmp0_;
+ const gchar* _tmp0_;
+ gboolean _tmp1_ = FALSE;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (name != NULL, NULL);
mpris2_root = NULL;
- _tmp0_ = g_str_has_prefix (name, MPRIS_PREFIX);
- if (_tmp0_) {
- MprisRoot* _tmp1_ = NULL;
- MprisRoot* _tmp2_;
- _tmp1_ = g_initable_new (TYPE_MPRIS_ROOT_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", name, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", MPRIS_MEDIA_PLAYER_PATH, "g-interface-name", "org.mpris.MediaPlayer2", NULL);
- _tmp2_ = (MprisRoot*) _tmp1_;
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == G_IO_ERROR) {
- goto __catch8_g_io_error;
+ _tmp0_ = name;
+ _tmp1_ = g_str_has_prefix (_tmp0_, MPRIS_PREFIX);
+ if (_tmp1_) {
+ {
+ const gchar* _tmp2_;
+ MprisRoot* _tmp3_ = NULL;
+ MprisRoot* _tmp4_;
+ _tmp2_ = name;
+ _tmp3_ = g_initable_new (TYPE_MPRIS_ROOT_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", _tmp2_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", MPRIS_MEDIA_PLAYER_PATH, "g-interface-name", "org.mpris.MediaPlayer2", NULL);
+ _tmp4_ = (MprisRoot*) _tmp3_;
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_IO_ERROR) {
+ goto __catch8_g_io_error;
+ }
+ _g_object_unref0 (mpris2_root);
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return NULL;
}
_g_object_unref0 (mpris2_root);
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return NULL;
+ mpris2_root = _tmp4_;
}
- _g_object_unref0 (mpris2_root);
- mpris2_root = _tmp2_;
goto __finally8;
__catch8_g_io_error:
{
- GError * e;
+ GError* e = NULL;
+ GError* _tmp5_;
+ const gchar* _tmp6_;
e = _inner_error_;
_inner_error_ = NULL;
+ _tmp5_ = e;
+ _tmp6_ = _tmp5_->message;
g_warning ("mpris2-watcher.vala:103: Mpris2watcher could not create a root interfa" \
-"ce: %s", e->message);
+"ce: %s", _tmp6_);
_g_error_free0 (e);
}
__finally8:
@@ -445,51 +523,62 @@ static MprisRoot* mpris2_watcher_create_mpris_root (Mpris2Watcher* self, const g
static gboolean mpris2_watcher_supports_playlists (Mpris2Watcher* self, const gchar* name) {
gboolean result = FALSE;
FreeDesktopIntrospectable* introspectable = NULL;
- FreeDesktopIntrospectable* _tmp0_ = NULL;
- FreeDesktopIntrospectable* _tmp1_;
- gchar* _tmp2_ = NULL;
- gchar* results;
- gboolean _tmp3_;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (name != NULL, FALSE);
- _tmp0_ = g_initable_new (TYPE_FREE_DESKTOP_INTROSPECTABLE_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", name, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", MPRIS_MEDIA_PLAYER_PATH, "g-interface-name", "org.freedesktop.DBus.Introspectable", NULL);
- _tmp1_ = (FreeDesktopIntrospectable*) _tmp0_;
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == G_IO_ERROR) {
- goto __catch9_g_io_error;
+ {
+ const gchar* _tmp0_;
+ FreeDesktopIntrospectable* _tmp1_ = NULL;
+ FreeDesktopIntrospectable* _tmp2_;
+ FreeDesktopIntrospectable* _tmp3_;
+ gchar* _tmp4_ = NULL;
+ gchar* results;
+ const gchar* _tmp5_;
+ gboolean _tmp6_ = FALSE;
+ _tmp0_ = name;
+ _tmp1_ = g_initable_new (TYPE_FREE_DESKTOP_INTROSPECTABLE_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", _tmp0_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", MPRIS_MEDIA_PLAYER_PATH, "g-interface-name", "org.freedesktop.DBus.Introspectable", NULL);
+ _tmp2_ = (FreeDesktopIntrospectable*) _tmp1_;
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_IO_ERROR) {
+ goto __catch9_g_io_error;
+ }
+ _g_object_unref0 (introspectable);
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
}
_g_object_unref0 (introspectable);
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return FALSE;
- }
- _g_object_unref0 (introspectable);
- introspectable = _tmp1_;
- _tmp2_ = free_desktop_introspectable_Introspect (introspectable, &_inner_error_);
- results = _tmp2_;
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == G_IO_ERROR) {
- goto __catch9_g_io_error;
+ introspectable = _tmp2_;
+ _tmp3_ = introspectable;
+ _tmp4_ = free_desktop_introspectable_Introspect (_tmp3_, &_inner_error_);
+ results = _tmp4_;
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_IO_ERROR) {
+ goto __catch9_g_io_error;
+ }
+ _g_object_unref0 (introspectable);
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
}
+ _tmp5_ = results;
+ _tmp6_ = mpris2_watcher_parse_interfaces (self, _tmp5_);
+ result = _tmp6_;
+ _g_free0 (results);
_g_object_unref0 (introspectable);
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return FALSE;
+ return result;
}
- _tmp3_ = mpris2_watcher_parse_interfaces (self, results);
- result = _tmp3_;
- _g_free0 (results);
- _g_object_unref0 (introspectable);
- return result;
- _g_free0 (results);
goto __finally9;
__catch9_g_io_error:
{
- GError * e;
+ GError* e = NULL;
+ GError* _tmp7_;
+ const gchar* _tmp8_;
e = _inner_error_;
_inner_error_ = NULL;
- g_warning ("mpris2-watcher.vala:131: Could not create an introspectable object: %s", e->message);
+ _tmp7_ = e;
+ _tmp8_ = _tmp7_->message;
+ g_warning ("mpris2-watcher.vala:131: Could not create an introspectable object: %s", _tmp8_);
_g_error_free0 (e);
}
__finally9:
@@ -508,69 +597,111 @@ static gboolean mpris2_watcher_supports_playlists (Mpris2Watcher* self, const gc
static gboolean mpris2_watcher_parse_interfaces (Mpris2Watcher* self, const gchar* interface_info) {
gboolean result = FALSE;
gboolean _result_;
- xmlDoc* _tmp0_ = NULL;
+ const gchar* _tmp0_;
+ xmlDoc* _tmp1_ = NULL;
xmlDoc* xml_doc;
- xmlNode* _tmp1_ = NULL;
+ xmlDoc* _tmp2_;
+ xmlDoc* _tmp3_;
+ xmlNode* _tmp4_ = NULL;
xmlNode* root_node;
+ xmlNode* _tmp5_;
+ xmlDoc* _tmp27_;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (interface_info != NULL, FALSE);
_result_ = FALSE;
- _tmp0_ = xmlParseDoc (interface_info);
- xml_doc = _tmp0_;
- if (xml_doc == NULL) {
+ _tmp0_ = interface_info;
+ _tmp1_ = xmlParseDoc (_tmp0_);
+ xml_doc = _tmp1_;
+ _tmp2_ = xml_doc;
+ if (_tmp2_ == NULL) {
g_warning ("mpris2-watcher.vala:143: Mpris2Watcher - parse-interfaces - failed to " \
"instantiate xml doc");
result = FALSE;
return result;
}
- _tmp1_ = xmlDocGetRootElement (xml_doc);
- root_node = _tmp1_;
- if (root_node == NULL) {
- xmlFreeDoc (xml_doc);
+ _tmp3_ = xml_doc;
+ _tmp4_ = xmlDocGetRootElement (_tmp3_);
+ root_node = _tmp4_;
+ _tmp5_ = root_node;
+ if (_tmp5_ == NULL) {
+ xmlDoc* _tmp6_;
+ _tmp6_ = xml_doc;
+ xmlFreeDoc (_tmp6_);
g_warning ("mpris2-watcher.vala:151: Mpris2Watcher - the interface info xml is emp" \
"ty");
result = FALSE;
return result;
}
{
+ xmlNode* _tmp7_;
+ xmlNode* _tmp8_;
xmlNode* iter;
- iter = root_node->children;
+ _tmp7_ = root_node;
+ _tmp8_ = _tmp7_->children;
+ iter = _tmp8_;
{
- gboolean _tmp2_;
- _tmp2_ = TRUE;
+ gboolean _tmp9_;
+ _tmp9_ = TRUE;
while (TRUE) {
+ gboolean _tmp10_;
+ xmlNode* _tmp13_;
+ xmlNode* _tmp14_;
+ xmlElementType _tmp15_;
+ xmlNode* _tmp16_;
+ xmlAttr* _tmp17_;
xmlAttr* attributes;
- gchar* _tmp3_;
+ xmlAttr* _tmp18_;
+ xmlNode* _tmp19_;
+ const gchar* _tmp20_;
+ gchar* _tmp21_;
gchar* interface_name;
- gchar* _tmp4_ = NULL;
- gchar* _tmp5_;
- gboolean _tmp6_;
- if (!_tmp2_) {
- iter = iter->next;
+ const gchar* _tmp22_;
+ const gchar* _tmp23_;
+ gchar* _tmp24_ = NULL;
+ gchar* _tmp25_;
+ gboolean _tmp26_;
+ _tmp10_ = _tmp9_;
+ if (!_tmp10_) {
+ xmlNode* _tmp11_;
+ xmlNode* _tmp12_;
+ _tmp11_ = iter;
+ _tmp12_ = _tmp11_->next;
+ iter = _tmp12_;
}
- _tmp2_ = FALSE;
- if (!(iter != NULL)) {
+ _tmp9_ = FALSE;
+ _tmp13_ = iter;
+ if (!(_tmp13_ != NULL)) {
break;
}
- if (iter->type != XML_ELEMENT_NODE) {
+ _tmp14_ = iter;
+ _tmp15_ = _tmp14_->type;
+ if (_tmp15_ != XML_ELEMENT_NODE) {
continue;
}
- attributes = iter->properties;
- _tmp3_ = g_strdup (attributes->children->content);
- interface_name = _tmp3_;
- g_debug ("mpris2-watcher.vala:163: this dbus object has interface %s ", interface_name);
- _tmp4_ = g_strconcat (MPRIS_PREFIX, "Playlists", NULL);
- _tmp5_ = _tmp4_;
- _tmp6_ = g_strcmp0 (interface_name, _tmp5_) == 0;
- _g_free0 (_tmp5_);
- if (_tmp6_) {
+ _tmp16_ = iter;
+ _tmp17_ = _tmp16_->properties;
+ attributes = _tmp17_;
+ _tmp18_ = attributes;
+ _tmp19_ = _tmp18_->children;
+ _tmp20_ = _tmp19_->content;
+ _tmp21_ = g_strdup (_tmp20_);
+ interface_name = _tmp21_;
+ _tmp22_ = interface_name;
+ g_debug ("mpris2-watcher.vala:163: this dbus object has interface %s ", _tmp22_);
+ _tmp23_ = interface_name;
+ _tmp24_ = g_strconcat (MPRIS_PREFIX, "Playlists", NULL);
+ _tmp25_ = _tmp24_;
+ _tmp26_ = g_strcmp0 (_tmp23_, _tmp25_) == 0;
+ _g_free0 (_tmp25_);
+ if (_tmp26_) {
_result_ = TRUE;
}
_g_free0 (interface_name);
}
}
}
- xmlFreeDoc (xml_doc);
+ _tmp27_ = xml_doc;
+ xmlFreeDoc (_tmp27_);
result = _result_;
return result;
}
@@ -580,7 +711,8 @@ static void g_cclosure_user_marshal_VOID__STRING_STRING_BOOLEAN (GClosure * clos
typedef void (*GMarshalFunc_VOID__STRING_STRING_BOOLEAN) (gpointer data1, const char* arg_1, const char* arg_2, gboolean arg_3, gpointer data2);
register GMarshalFunc_VOID__STRING_STRING_BOOLEAN callback;
register GCClosure * cc;
- register gpointer data1, data2;
+ register gpointer data1;
+ register gpointer data2;
cc = (GCClosure *) closure;
g_return_if_fail (n_param_values == 4);
if (G_CCLOSURE_SWAP_DATA (closure)) {
@@ -604,33 +736,41 @@ static GObject * mpris2_watcher_constructor (GType type, guint n_construct_prope
GObject * obj;
GObjectClass * parent_class;
Mpris2Watcher * self;
- FreeDesktopObject* _tmp0_ = NULL;
- FreeDesktopObject* _tmp1_;
GError * _inner_error_ = NULL;
parent_class = G_OBJECT_CLASS (mpris2_watcher_parent_class);
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
self = MPRIS2_WATCHER (obj);
- _tmp0_ = g_initable_new (TYPE_FREE_DESKTOP_OBJECT_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", FREEDESKTOP_SERVICE, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", FREEDESKTOP_OBJECT, "g-interface-name", "org.freedesktop.DBus", NULL);
- _tmp1_ = (FreeDesktopObject*) _tmp0_;
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == G_IO_ERROR) {
- goto __catch10_g_io_error;
+ {
+ FreeDesktopObject* _tmp0_ = NULL;
+ FreeDesktopObject* _tmp1_;
+ FreeDesktopObject* _tmp2_;
+ _tmp0_ = g_initable_new (TYPE_FREE_DESKTOP_OBJECT_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", FREEDESKTOP_SERVICE, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", FREEDESKTOP_OBJECT, "g-interface-name", "org.freedesktop.DBus", NULL);
+ _tmp1_ = (FreeDesktopObject*) _tmp0_;
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_IO_ERROR) {
+ goto __catch10_g_io_error;
+ }
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
}
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
+ _g_object_unref0 (self->priv->fdesktop_obj);
+ self->priv->fdesktop_obj = _tmp1_;
+ _tmp2_ = self->priv->fdesktop_obj;
+ g_signal_connect_object (_tmp2_, "name-owner-changed", (GCallback) _mpris2_watcher_name_changes_detected_free_desktop_object_name_owner_changed, self, 0);
+ mpris2_watcher_check_for_active_clients (self, NULL, NULL);
}
- _g_object_unref0 (self->priv->fdesktop_obj);
- self->priv->fdesktop_obj = _tmp1_;
- g_signal_connect_object (self->priv->fdesktop_obj, "name-owner-changed", (GCallback) _mpris2_watcher_name_changes_detected_free_desktop_object_name_owner_changed, self, 0);
- mpris2_watcher_check_for_active_clients (self, NULL, NULL);
goto __finally10;
__catch10_g_io_error:
{
- GError * e;
+ GError* e = NULL;
+ GError* _tmp3_;
+ const gchar* _tmp4_;
e = _inner_error_;
_inner_error_ = NULL;
+ _tmp3_ = e;
+ _tmp4_ = _tmp3_->message;
g_warning ("mpris2-watcher.vala:46: Mpris2watcher could not set up a watch for mpr" \
-"is clients appearing on the bus: %s", e->message);
+"is clients appearing on the bus: %s", _tmp4_);
_g_error_free0 (e);
}
__finally10: