aboutsummaryrefslogtreecommitdiff
path: root/src/mpris2-watcher.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mpris2-watcher.c')
-rw-r--r--src/mpris2-watcher.c74
1 files changed, 34 insertions, 40 deletions
diff --git a/src/mpris2-watcher.c b/src/mpris2-watcher.c
index f93a528..f22c63c 100644
--- a/src/mpris2-watcher.c
+++ b/src/mpris2-watcher.c
@@ -1,4 +1,4 @@
-/* mpris2-watcher.c generated by valac 0.11.6, the Vala compiler
+/* mpris2-watcher.c generated by valac 0.11.7, the Vala compiler
* generated from mpris2-watcher.vala, do not modify */
/*
@@ -125,20 +125,19 @@ struct _Mpris2WatcherCheckForActiveClientsData {
gchar** _tmp2_;
gint _tmp2__length1;
gint __tmp2__size_;
- gchar** _tmp3_;
GError * e;
gchar** address_collection;
int address_collection_length1;
int address_it;
- gchar* _tmp4_;
+ gchar* _tmp3_;
gchar* address;
- gboolean _tmp5_;
- MprisRoot* _tmp6_;
+ gboolean _tmp4_;
+ MprisRoot* _tmp5_;
MprisRoot* mpris2_root;
- gboolean _tmp7_;
+ gboolean _tmp6_;
gboolean use_playlists;
+ gchar* _tmp7_;
gchar* _tmp8_;
- gchar* _tmp9_;
GError * _inner_error_;
};
@@ -271,11 +270,10 @@ static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckFo
g_clear_error (&data->_inner_error_);
return FALSE;
}
- data->_tmp3_ = data->_tmp2_;
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->interfaces_length1;
- data->interfaces = data->_tmp3_;
+ data->_interfaces_size_ = data->__tmp2__size_;
goto __finally7;
__catch7_g_io_error:
{
@@ -304,14 +302,14 @@ static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckFo
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->_tmp4_ = g_strdup (data->address_collection[data->address_it]);
- data->address = data->_tmp4_;
+ data->_tmp3_ = g_strdup (data->address_collection[data->address_it]);
+ data->address = data->_tmp3_;
{
- data->_tmp5_ = g_str_has_prefix (data->address, MPRIS_PREFIX);
- if (data->_tmp5_) {
- data->_tmp6_ = NULL;
- data->_tmp6_ = mpris2_watcher_create_mpris_root (data->self, data->address);
- data->mpris2_root = data->_tmp6_;
+ 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);
@@ -324,13 +322,13 @@ static gboolean mpris2_watcher_check_for_active_clients_co (Mpris2WatcherCheckFo
g_object_unref (data->_async_result);
return FALSE;
}
- data->_tmp7_ = mpris2_watcher_supports_playlists (data->self, data->address);
- data->use_playlists = data->_tmp7_;
- data->_tmp8_ = NULL;
- data->_tmp8_ = mpris_root_get_DesktopEntry (data->mpris2_root);
- data->_tmp9_ = data->_tmp8_;
- g_signal_emit_by_name (data->self, "client-appeared", data->_tmp9_, data->address, data->use_playlists);
- _g_free0 (data->_tmp9_);
+ 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);
}
_g_free0 (data->address);
@@ -408,7 +406,6 @@ static MprisRoot* mpris2_watcher_create_mpris_root (Mpris2Watcher* self, const g
if (_tmp0_) {
MprisRoot* _tmp1_ = NULL;
MprisRoot* _tmp2_;
- MprisRoot* _tmp3_;
_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) {
@@ -420,9 +417,8 @@ static MprisRoot* mpris2_watcher_create_mpris_root (Mpris2Watcher* self, const g
g_clear_error (&_inner_error_);
return NULL;
}
- _tmp3_ = _tmp2_;
_g_object_unref0 (mpris2_root);
- mpris2_root = _tmp3_;
+ mpris2_root = _tmp2_;
goto __finally8;
__catch8_g_io_error:
{
@@ -451,10 +447,9 @@ static gboolean mpris2_watcher_supports_playlists (Mpris2Watcher* self, const gc
FreeDesktopIntrospectable* introspectable = NULL;
FreeDesktopIntrospectable* _tmp0_ = NULL;
FreeDesktopIntrospectable* _tmp1_;
- FreeDesktopIntrospectable* _tmp2_;
- gchar* _tmp3_ = NULL;
+ gchar* _tmp2_ = NULL;
gchar* results;
- gboolean _tmp4_;
+ gboolean _tmp3_;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (name != NULL, FALSE);
@@ -469,11 +464,10 @@ static gboolean mpris2_watcher_supports_playlists (Mpris2Watcher* self, const gc
g_clear_error (&_inner_error_);
return FALSE;
}
- _tmp2_ = _tmp1_;
_g_object_unref0 (introspectable);
- introspectable = _tmp2_;
- _tmp3_ = free_desktop_introspectable_Introspect (introspectable, &_inner_error_);
- results = _tmp3_;
+ 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;
@@ -483,8 +477,8 @@ static gboolean mpris2_watcher_supports_playlists (Mpris2Watcher* self, const gc
g_clear_error (&_inner_error_);
return FALSE;
}
- _tmp4_ = mpris2_watcher_parse_interfaces (self, results);
- result = _tmp4_;
+ _tmp3_ = mpris2_watcher_parse_interfaces (self, results);
+ result = _tmp3_;
_g_free0 (results);
_g_object_unref0 (introspectable);
return result;
@@ -567,7 +561,9 @@ static gboolean mpris2_watcher_parse_interfaces (Mpris2Watcher* self, const gcha
g_debug ("mpris2-watcher.vala:163: this dbus object has interface %s ", interface_name);
_tmp4_ = g_strconcat (MPRIS_PREFIX, "Playlists", NULL);
_tmp5_ = _tmp4_;
- if ((_tmp6_ = g_strcmp0 (interface_name, _tmp5_) == 0, _g_free0 (_tmp5_), _tmp6_)) {
+ _tmp6_ = g_strcmp0 (interface_name, _tmp5_) == 0;
+ _g_free0 (_tmp5_);
+ if (_tmp6_) {
_result_ = TRUE;
}
_g_free0 (interface_name);
@@ -610,7 +606,6 @@ static GObject * mpris2_watcher_constructor (GType type, guint n_construct_prope
Mpris2Watcher * self;
FreeDesktopObject* _tmp0_ = NULL;
FreeDesktopObject* _tmp1_;
- FreeDesktopObject* _tmp2_;
GError * _inner_error_ = NULL;
parent_class = G_OBJECT_CLASS (mpris2_watcher_parent_class);
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
@@ -624,9 +619,8 @@ static GObject * mpris2_watcher_constructor (GType type, guint n_construct_prope
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_);
}
- _tmp2_ = _tmp1_;
_g_object_unref0 (self->priv->fdesktop_obj);
- self->priv->fdesktop_obj = _tmp2_;
+ 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;