diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2010-11-18 11:13:31 -0500 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2010-11-18 11:13:31 -0500 |
commit | 13bc64e0a3c144740c30e2469fdb5f605d58ee39 (patch) | |
tree | 21b2af1f4d2d796bdbf2af16761de5be769e87fa /src/music-player-bridge.c | |
parent | 908222c0681fba3c6e1265d0f85a0b667927c169 (diff) | |
parent | 0d5c60e9161f4b1b4315bbfac7862ef662f577ee (diff) | |
download | ayatana-indicator-sound-13bc64e0a3c144740c30e2469fdb5f605d58ee39.tar.gz ayatana-indicator-sound-13bc64e0a3c144740c30e2469fdb5f605d58ee39.tar.bz2 ayatana-indicator-sound-13bc64e0a3c144740c30e2469fdb5f605d58ee39.zip |
Import upstream version 0.5.2
Diffstat (limited to 'src/music-player-bridge.c')
-rw-r--r-- | src/music-player-bridge.c | 299 |
1 files changed, 203 insertions, 96 deletions
diff --git a/src/music-player-bridge.c b/src/music-player-bridge.c index 7e0a5a8..7c29522 100644 --- a/src/music-player-bridge.c +++ b/src/music-player-bridge.c @@ -1,4 +1,4 @@ -/* music-player-bridge.c generated by valac 0.10.0, the Vala compiler +/* music-player-bridge.c generated by valac 0.11.2, the Vala compiler * generated from music-player-bridge.vala, do not modify */ /* @@ -111,24 +111,24 @@ MusicPlayerBridge* music_player_bridge_new (void); MusicPlayerBridge* music_player_bridge_construct (GType object_type); FamiliarPlayersDB* familiar_players_db_new (void); FamiliarPlayersDB* familiar_players_db_construct (GType object_type); -void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type); -static void _music_player_bridge_on_server_added_indicate_listener_server_added (IndicateListener* _sender, IndicateListenerServer* object, const char* p0, gpointer self); -void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type); -static void _music_player_bridge_on_server_removed_indicate_listener_server_removed (IndicateListener* _sender, IndicateListenerServer* object, const char* p0, gpointer self); +void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const gchar* type); +static void _music_player_bridge_on_server_added_indicate_listener_server_added (IndicateListener* _sender, IndicateListenerServer* object, const gchar* p0, gpointer self); +void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const gchar* type); +static void _music_player_bridge_on_server_removed_indicate_listener_server_removed (IndicateListener* _sender, IndicateListenerServer* object, const gchar* p0, gpointer self); static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlayerBridge* self); GeeSet* familiar_players_db_records (FamiliarPlayersDB* self); -static char* music_player_bridge_determine_key (char* path); -char* familiar_players_db_fetch_icon_name (const char* desktop_path); +static gchar* music_player_bridge_determine_key (gchar* path); +gchar* familiar_players_db_fetch_icon_name (const gchar* desktop_path); static gint music_player_bridge_calculate_menu_position (MusicPlayerBridge* self); GType player_controller_state_get_type (void) G_GNUC_CONST; -PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const char* mpris_name, const char* icon_name, gint offset, PlayerControllerstate initial_state); -PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const char* mpris_name, const char* icon_name, gint offset, PlayerControllerstate initial_state); +PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const gchar* mpris_name, const gchar* icon_name, gint offset, PlayerControllerstate initial_state); +PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const gchar* mpris_name, const gchar* icon_name, gint offset, PlayerControllerstate initial_state); #define PLAYER_CONTROLLER_WIDGET_QUANTITY 4 -static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge* self, const char* type); -static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, IndicateListenerServer* server, char* path, void* data); -GAppInfo* music_player_bridge_create_app_info (const char* path); -gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const char* desktop); -void familiar_players_db_insert (FamiliarPlayersDB* self, const char* desktop); +static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge* self, const gchar* type); +static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, IndicateListenerServer* server, gchar* path, void* data); +GAppInfo* music_player_bridge_create_app_info (const gchar* path); +gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const gchar* desktop); +void familiar_players_db_insert (FamiliarPlayersDB* self, const gchar* desktop); void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state); void player_controller_activate (PlayerController* self); void player_controller_hibernate (PlayerController* self); @@ -139,26 +139,37 @@ static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify static gint _vala_array_length (gpointer array); - -static void _music_player_bridge_on_server_added_indicate_listener_server_added (IndicateListener* _sender, IndicateListenerServer* object, const char* p0, gpointer self) { +static void _music_player_bridge_on_server_added_indicate_listener_server_added (IndicateListener* _sender, IndicateListenerServer* object, const gchar* p0, gpointer self) { music_player_bridge_on_server_added (self, object, p0); } -static void _music_player_bridge_on_server_removed_indicate_listener_server_removed (IndicateListener* _sender, IndicateListenerServer* object, const char* p0, gpointer self) { +static void _music_player_bridge_on_server_removed_indicate_listener_server_removed (IndicateListener* _sender, IndicateListenerServer* object, const gchar* p0, gpointer self) { music_player_bridge_on_server_removed (self, object, p0); } MusicPlayerBridge* music_player_bridge_construct (GType object_type) { - MusicPlayerBridge * self; - FamiliarPlayersDB* _tmp0_; - GeeHashMap* _tmp1_; - IndicateListener* _tmp2_; + MusicPlayerBridge * self = NULL; + FamiliarPlayersDB* _tmp0_ = NULL; + FamiliarPlayersDB* _tmp1_; + GeeHashMap* _tmp2_ = NULL; + GeeHashMap* _tmp3_; + IndicateListener* _tmp4_ = NULL; + IndicateListener* _tmp5_; self = (MusicPlayerBridge*) g_object_new (object_type, NULL); - self->priv->playersDB = (_tmp0_ = familiar_players_db_new (), _g_object_unref0 (self->priv->playersDB), _tmp0_); - self->priv->registered_clients = (_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, TYPE_PLAYER_CONTROLLER, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL), _g_object_unref0 (self->priv->registered_clients), _tmp1_); - self->priv->listener = (_tmp2_ = indicate_listener_ref_default (), _g_object_unref0 (self->priv->listener), _tmp2_); + _tmp0_ = familiar_players_db_new (); + _tmp1_ = _tmp0_; + _g_object_unref0 (self->priv->playersDB); + self->priv->playersDB = _tmp1_; + _tmp2_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, TYPE_PLAYER_CONTROLLER, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL); + _tmp3_ = _tmp2_; + _g_object_unref0 (self->priv->registered_clients); + self->priv->registered_clients = _tmp3_; + _tmp4_ = indicate_listener_ref_default (); + _tmp5_ = _tmp4_; + _g_object_unref0 (self->priv->listener); + self->priv->listener = _tmp5_; g_signal_connect_object (self->priv->listener, "server-added", (GCallback) _music_player_bridge_on_server_added_indicate_listener_server_added, self, 0); g_signal_connect_object (self->priv->listener, "server-removed", (GCallback) _music_player_bridge_on_server_removed_indicate_listener_server_removed, self, 0); return self; @@ -178,23 +189,39 @@ static gpointer _g_object_ref0 (gpointer self) { static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlayerBridge* self) { g_return_if_fail (self != NULL); { - GeeSet* _tmp0_; - GeeIterator* _tmp1_; + GeeSet* _tmp0_ = NULL; + GeeSet* _tmp1_; + GeeIterator* _tmp2_ = NULL; + GeeIterator* _tmp3_; GeeIterator* _app_it; - _app_it = (_tmp1_ = gee_iterable_iterator ((GeeIterable*) (_tmp0_ = familiar_players_db_records (self->priv->playersDB))), _g_object_unref0 (_tmp0_), _tmp1_); + _tmp0_ = familiar_players_db_records (self->priv->playersDB); + _tmp1_ = _tmp0_; + _tmp2_ = gee_iterable_iterator ((GeeIterable*) _tmp1_); + _app_it = (_tmp3_ = _tmp2_, _g_object_unref0 (_tmp1_), _tmp3_); while (TRUE) { - char* app; + gboolean _tmp4_; + gpointer _tmp5_ = NULL; + gchar* app; + GDesktopAppInfo* _tmp6_ = NULL; GDesktopAppInfo* info; - GDesktopAppInfo* _tmp2_; + GDesktopAppInfo* _tmp7_; + GAppInfo* _tmp8_; GAppInfo* app_info; - char* mpris_key; - char* _tmp3_; - PlayerController* _tmp4_; + gchar* _tmp9_; + gchar* _tmp10_ = NULL; + gchar* mpris_key; + gchar* _tmp11_ = NULL; + gchar* _tmp12_; + gint _tmp13_; + PlayerController* _tmp14_ = NULL; + PlayerController* _tmp15_; PlayerController* ctrl; - if (!gee_iterator_next (_app_it)) { + _tmp4_ = gee_iterator_next (_app_it); + if (!_tmp4_) { break; } - app = (char*) gee_iterator_get (_app_it); + _tmp5_ = gee_iterator_get (_app_it); + app = (gchar*) _tmp5_; if (app == NULL) { g_warning ("music-player-bridge.vala:44: App string in keyfile is null therefore m" \ "oving on to next player"); @@ -202,7 +229,8 @@ static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlaye continue; } g_debug ("music-player-bridge.vala:48: attempting to make an app info from %s", app); - info = g_desktop_app_info_new_from_filename (app); + _tmp6_ = g_desktop_app_info_new_from_filename (app); + info = _tmp6_; if (info == NULL) { g_warning ("music-player-bridge.vala:53: Could not create a desktopappinfo instanc" \ "e from app,: %s , moving on to the next client", app); @@ -210,9 +238,16 @@ static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlaye _g_free0 (app); continue; } - app_info = _g_object_ref0 ((_tmp2_ = info, G_IS_APP_INFO (_tmp2_) ? ((GAppInfo*) _tmp2_) : NULL)); - mpris_key = music_player_bridge_determine_key (g_strdup (app)); - ctrl = (_tmp4_ = player_controller_new (self->priv->root_menu, app_info, mpris_key, _tmp3_ = familiar_players_db_fetch_icon_name (app), music_player_bridge_calculate_menu_position (self), PLAYER_CONTROLLER_STATE_OFFLINE), _g_free0 (_tmp3_), _tmp4_); + _tmp8_ = _g_object_ref0 ((_tmp7_ = info, G_IS_APP_INFO (_tmp7_) ? ((GAppInfo*) _tmp7_) : NULL)); + app_info = _tmp8_; + _tmp9_ = g_strdup (app); + _tmp10_ = music_player_bridge_determine_key (_tmp9_); + mpris_key = _tmp10_; + _tmp11_ = familiar_players_db_fetch_icon_name (app); + _tmp12_ = _tmp11_; + _tmp13_ = music_player_bridge_calculate_menu_position (self); + _tmp14_ = player_controller_new (self->priv->root_menu, app_info, mpris_key, _tmp12_, _tmp13_, PLAYER_CONTROLLER_STATE_OFFLINE); + ctrl = (_tmp15_ = _tmp14_, _g_free0 (_tmp12_), _tmp15_); gee_abstract_map_set ((GeeAbstractMap*) self->priv->registered_clients, mpris_key, ctrl); _g_object_unref0 (ctrl); _g_free0 (mpris_key); @@ -227,23 +262,29 @@ static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlaye static gint music_player_bridge_calculate_menu_position (MusicPlayerBridge* self) { gint result = 0; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - if (gee_map_get_size ((GeeMap*) self->priv->registered_clients) == 0) { + _tmp0_ = gee_map_get_size ((GeeMap*) self->priv->registered_clients); + if (_tmp0_ == 0) { result = 2; return result; } else { - result = 2 + (gee_map_get_size ((GeeMap*) self->priv->registered_clients) * PLAYER_CONTROLLER_WIDGET_QUANTITY); + gint _tmp1_; + _tmp1_ = gee_map_get_size ((GeeMap*) self->priv->registered_clients); + result = 2 + (_tmp1_ * PLAYER_CONTROLLER_WIDGET_QUANTITY); return result; } } -void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type) { +void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const gchar* type) { + gboolean _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (type != NULL); g_debug ("music-player-bridge.vala:81: MusicPlayerBridge -> on_server_added with" \ " value %s", type); - if (music_player_bridge_server_is_not_of_interest (self, type)) { + _tmp0_ = music_player_bridge_server_is_not_of_interest (self, type); + if (_tmp0_) { return; } if (self->priv->root_menu != NULL) { @@ -254,15 +295,22 @@ void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListe } -static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, IndicateListenerServer* server, char* path, void* data) { +static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, IndicateListenerServer* server, gchar* path, void* data) { void* _tmp0_; + MusicPlayerBridge* _tmp1_; MusicPlayerBridge* bridge; + GAppInfo* _tmp2_ = NULL; GAppInfo* app_info; - char* mpris_key; + gchar* _tmp3_; + gchar* _tmp4_ = NULL; + gchar* mpris_key; + gboolean _tmp5_; g_return_if_fail (self != NULL); g_return_if_fail (path != NULL); - bridge = _g_object_ref0 ((_tmp0_ = data, IS_MUSIC_PLAYER_BRIDGE (_tmp0_) ? ((MusicPlayerBridge*) _tmp0_) : NULL)); - app_info = music_player_bridge_create_app_info (path); + _tmp1_ = _g_object_ref0 ((_tmp0_ = data, IS_MUSIC_PLAYER_BRIDGE (_tmp0_) ? ((MusicPlayerBridge*) _tmp0_) : NULL)); + bridge = _tmp1_; + _tmp2_ = music_player_bridge_create_app_info (path); + app_info = _tmp2_; if (app_info == NULL) { g_warning ("music-player-bridge.vala:96: Could not create app_info for path %s \n" \ " Getting out of here ", path); @@ -271,26 +319,42 @@ static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, _g_free0 (path); return; } - mpris_key = music_player_bridge_determine_key (g_strdup (path)); - if (familiar_players_db_already_familiar (bridge->priv->playersDB, path) == FALSE) { - char* _tmp1_; - PlayerController* _tmp2_; + _tmp3_ = g_strdup (path); + _tmp4_ = music_player_bridge_determine_key (_tmp3_); + mpris_key = _tmp4_; + _tmp5_ = familiar_players_db_already_familiar (bridge->priv->playersDB, path); + if (_tmp5_ == FALSE) { + gchar* _tmp6_ = NULL; + gchar* _tmp7_; + gint _tmp8_; + PlayerController* _tmp9_ = NULL; + PlayerController* _tmp10_; PlayerController* ctrl; g_debug ("music-player-bridge.vala:103: New client has registered that we have s" \ "een before: %s", path); familiar_players_db_insert (bridge->priv->playersDB, path); - ctrl = (_tmp2_ = player_controller_new (bridge->priv->root_menu, app_info, mpris_key, _tmp1_ = familiar_players_db_fetch_icon_name (path), music_player_bridge_calculate_menu_position (bridge), PLAYER_CONTROLLER_STATE_READY), _g_free0 (_tmp1_), _tmp2_); + _tmp6_ = familiar_players_db_fetch_icon_name (path); + _tmp7_ = _tmp6_; + _tmp8_ = music_player_bridge_calculate_menu_position (bridge); + _tmp9_ = player_controller_new (bridge->priv->root_menu, app_info, mpris_key, _tmp7_, _tmp8_, PLAYER_CONTROLLER_STATE_READY); + ctrl = (_tmp10_ = _tmp9_, _g_free0 (_tmp7_), _tmp10_); gee_abstract_map_set ((GeeAbstractMap*) bridge->priv->registered_clients, mpris_key, ctrl); g_debug ("music-player-bridge.vala:112: successfully created appinfo and instanc" \ "e from path and set it on the respective instance"); _g_object_unref0 (ctrl); } else { - PlayerController* _tmp3_; - PlayerController* _tmp4_; - player_controller_update_state (_tmp3_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) bridge->priv->registered_clients, mpris_key), PLAYER_CONTROLLER_STATE_READY); - _g_object_unref0 (_tmp3_); - player_controller_activate (_tmp4_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) bridge->priv->registered_clients, mpris_key)); - _g_object_unref0 (_tmp4_); + gpointer _tmp11_ = NULL; + PlayerController* _tmp12_; + gpointer _tmp13_ = NULL; + PlayerController* _tmp14_; + _tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) bridge->priv->registered_clients, mpris_key); + _tmp12_ = (PlayerController*) _tmp11_; + player_controller_update_state (_tmp12_, PLAYER_CONTROLLER_STATE_READY); + _g_object_unref0 (_tmp12_); + _tmp13_ = gee_abstract_map_get ((GeeAbstractMap*) bridge->priv->registered_clients, mpris_key); + _tmp14_ = (PlayerController*) _tmp13_; + player_controller_activate (_tmp14_); + _g_object_unref0 (_tmp14_); g_debug ("music-player-bridge.vala:117: Ignoring desktop file path callback beca" \ "use the db cache file has it already: %s \n", path); } @@ -301,26 +365,36 @@ static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, } -void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type) { +void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const gchar* type) { + gboolean _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (type != NULL); g_debug ("music-player-bridge.vala:123: MusicPlayerBridge -> on_server_removed w" \ "ith value %s", type); - if (music_player_bridge_server_is_not_of_interest (self, type)) { + _tmp0_ = music_player_bridge_server_is_not_of_interest (self, type); + if (_tmp0_) { return; } if (self->priv->root_menu != NULL) { + gchar** _tmp1_; + gchar** _tmp2_ = NULL; gint tmp_length1; gint _tmp_size_; - char** _tmp1_; - char** _tmp0_; - char** tmp; - tmp = (_tmp1_ = _tmp0_ = g_strsplit (type, ".", 0), tmp_length1 = _vala_array_length (_tmp0_), _tmp_size_ = tmp_length1, _tmp1_); + gchar** _tmp3_; + gchar** tmp; + _tmp2_ = _tmp1_ = g_strsplit (type, ".", 0); + _tmp3_ = _tmp2_; + tmp_length1 = _vala_array_length (_tmp1_); + _tmp_size_ = tmp_length1; + tmp = _tmp3_; g_debug ("music-player-bridge.vala:127: attempt to remove %s", tmp[tmp_length1 - 1]); if (tmp_length1 > 0) { - PlayerController* _tmp2_; - player_controller_hibernate (_tmp2_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, tmp[tmp_length1 - 1])); - _g_object_unref0 (_tmp2_); + gpointer _tmp4_ = NULL; + PlayerController* _tmp5_; + _tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, tmp[tmp_length1 - 1]); + _tmp5_ = (PlayerController*) _tmp4_; + player_controller_hibernate (_tmp5_); + _g_object_unref0 (_tmp5_); g_debug ("music-player-bridge.vala:130: Successively offlined client %s", tmp[tmp_length1 - 1]); } tmp = (_vala_array_free (tmp, tmp_length1, (GDestroyNotify) g_free), NULL); @@ -328,24 +402,28 @@ void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateLis } -static gboolean string_contains (const char* self, const char* needle) { +static gboolean string_contains (const gchar* self, const gchar* needle) { gboolean result = FALSE; + const gchar* _tmp0_ = NULL; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (needle != NULL, FALSE); - result = strstr (self, needle) != NULL; + _tmp0_ = strstr (self, needle); + result = _tmp0_ != NULL; return result; } -static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge* self, const char* type) { +static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge* self, const gchar* type) { gboolean result = FALSE; + gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (type != NULL, FALSE); if (type == NULL) { result = TRUE; return result; } - if (string_contains (type, "music") == FALSE) { + _tmp0_ = string_contains (type, "music"); + if (_tmp0_ == FALSE) { g_debug ("music-player-bridge.vala:138: server is of no interest, it is not an " \ "music server"); result = TRUE; @@ -358,20 +436,27 @@ static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge void music_player_bridge_set_root_menu_item (MusicPlayerBridge* self, DbusmenuMenuitem* menu) { DbusmenuMenuitem* _tmp0_; + DbusmenuMenuitem* _tmp1_; g_return_if_fail (self != NULL); g_return_if_fail (menu != NULL); - self->priv->root_menu = (_tmp0_ = _g_object_ref0 (menu), _g_object_unref0 (self->priv->root_menu), _tmp0_); + _tmp0_ = _g_object_ref0 (menu); + _tmp1_ = _tmp0_; + _g_object_unref0 (self->priv->root_menu); + self->priv->root_menu = _tmp1_; music_player_bridge_try_to_add_inactive_familiar_clients (self); } -GAppInfo* music_player_bridge_create_app_info (const char* path) { +GAppInfo* music_player_bridge_create_app_info (const gchar* path) { GAppInfo* result = NULL; + GDesktopAppInfo* _tmp0_ = NULL; GDesktopAppInfo* info; - GDesktopAppInfo* _tmp0_; + GDesktopAppInfo* _tmp1_; + GAppInfo* _tmp2_; GAppInfo* app_info; g_return_val_if_fail (path != NULL, NULL); - info = g_desktop_app_info_new_from_filename (path); + _tmp0_ = g_desktop_app_info_new_from_filename (path); + info = _tmp0_; if (path == NULL) { g_warning ("music-player-bridge.vala:154: Could not create a desktopappinfo instan" \ "ce from app: %s", path); @@ -379,45 +464,68 @@ GAppInfo* music_player_bridge_create_app_info (const char* path) { _g_object_unref0 (info); return result; } - app_info = _g_object_ref0 ((_tmp0_ = info, G_IS_APP_INFO (_tmp0_) ? ((GAppInfo*) _tmp0_) : NULL)); + _tmp2_ = _g_object_ref0 ((_tmp1_ = info, G_IS_APP_INFO (_tmp1_) ? ((GAppInfo*) _tmp1_) : NULL)); + app_info = _tmp2_; result = app_info; _g_object_unref0 (info); return result; } -static char* music_player_bridge_determine_key (char* path) { - char* result = NULL; +static gchar* music_player_bridge_determine_key (gchar* path) { + gchar* result = NULL; + gchar** _tmp0_; + gchar** _tmp1_ = NULL; gint tokens_length1; gint _tokens_size_; - char** _tmp1_; - char** _tmp0_; - char** tokens; - char* filename; - char** _tmp2_; - char** _tmp3_; - gint _tmp3__length1; - char* _tmp4_; - char* _result_; + gchar** _tmp2_; + gchar** tokens; + gchar* _tmp3_; + gchar* filename; + gchar** _tmp4_; + gchar** _tmp5_ = NULL; + gchar** _tmp6_; + gint _tmp6__length1; + gchar* _tmp7_; + gchar* _tmp8_; + gchar* _result_; + gchar** _tmp9_; + gchar** _tmp10_ = NULL; gint temp_length1; gint _temp_size_; - char** _tmp6_; - char** _tmp5_; - char** temp; + gchar** _tmp11_; + gchar** temp; g_return_val_if_fail (path != NULL, NULL); - tokens = (_tmp1_ = _tmp0_ = g_strsplit (path, "/", 0), tokens_length1 = _vala_array_length (_tmp0_), _tokens_size_ = tokens_length1, _tmp1_); + _tmp1_ = _tmp0_ = g_strsplit (path, "/", 0); + _tmp2_ = _tmp1_; + tokens_length1 = _vala_array_length (_tmp0_); + _tokens_size_ = tokens_length1; + tokens = _tmp2_; if (tokens_length1 < 2) { result = NULL; tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL); _g_free0 (path); return result; } - filename = g_strdup (tokens[tokens_length1 - 1]); - _result_ = (_tmp4_ = g_strdup ((_tmp3_ = _tmp2_ = g_strsplit (filename, ".", 0), _tmp3__length1 = _vala_array_length (_tmp2_), _tmp3_)[0]), _tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL), _tmp4_); - temp = (_tmp6_ = _tmp5_ = g_strsplit (_result_, "-", 0), temp_length1 = _vala_array_length (_tmp5_), _temp_size_ = temp_length1, _tmp6_); + _tmp3_ = g_strdup (tokens[tokens_length1 - 1]); + filename = _tmp3_; + _tmp5_ = _tmp4_ = g_strsplit (filename, ".", 0); + _tmp6_ = _tmp5_; + _tmp6__length1 = _vala_array_length (_tmp4_); + _tmp7_ = g_strdup (_tmp6_[0]); + _result_ = (_tmp8_ = _tmp7_, _tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_free), NULL), _tmp8_); + _tmp10_ = _tmp9_ = g_strsplit (_result_, "-", 0); + _tmp11_ = _tmp10_; + temp_length1 = _vala_array_length (_tmp9_); + _temp_size_ = temp_length1; + temp = _tmp11_; if (temp_length1 > 1) { - char* _tmp7_; - _result_ = (_tmp7_ = g_strdup (temp[0]), _g_free0 (_result_), _tmp7_); + gchar* _tmp12_; + gchar* _tmp13_; + _tmp12_ = g_strdup (temp[0]); + _tmp13_ = _tmp12_; + _g_free0 (_result_); + _result_ = _tmp13_; } g_debug ("music-player-bridge.vala:171: determine key result = %s", _result_); result = _result_; @@ -495,4 +603,3 @@ static gint _vala_array_length (gpointer array) { - |