diff options
Diffstat (limited to 'src/music-player-bridge.c')
-rw-r--r-- | src/music-player-bridge.c | 95 |
1 files changed, 42 insertions, 53 deletions
diff --git a/src/music-player-bridge.c b/src/music-player-bridge.c index 1e908a9..0f513ae 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.9.7, the Vala compiler +/* music-player-bridge.c generated by valac 0.9.8, the Vala compiler * generated from music-player-bridge.vala, do not modify */ /* @@ -218,9 +218,7 @@ static char* string_strip (const char* self) { static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlayerBridge* self) { - gint count; g_return_if_fail (self != NULL); - count = 0; { GeeSet* _tmp0_; GeeIterator* _tmp1_; @@ -228,50 +226,41 @@ static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlaye _app_it = (_tmp1_ = gee_iterable_iterator ((GeeIterable*) (_tmp0_ = familiar_players_db_records (self->priv->playersDB))), _g_object_unref0 (_tmp0_), _tmp1_); while (TRUE) { char* app; + GDesktopAppInfo* info; + GDesktopAppInfo* _tmp2_; + GAppInfo* app_info; + PlayerController* ctrl; + char* _tmp3_; + char* _tmp4_; if (!gee_iterator_next (_app_it)) { break; } app = (char*) gee_iterator_get (_app_it); - if (count == 0) { - GDesktopAppInfo* info; - GDesktopAppInfo* _tmp2_; - GAppInfo* app_info; - PlayerController* ctrl; - char* _tmp3_; - char* _tmp4_; - char* _tmp5_; - char* _tmp6_; - if (app == NULL) { - g_warning ("music-player-bridge.vala:52: App string in keyfile is null therefore m" \ + if (app == NULL) { + g_warning ("music-player-bridge.vala:49: App string in keyfile is null therefore m" \ "oving on to next player"); - _g_free0 (app); - continue; - } - info = g_desktop_app_info_new_from_filename (app); - if (info == NULL) { - g_warning ("music-player-bridge.vala:57: Could not create a desktopappinfo instanc" \ + _g_free0 (app); + continue; + } + g_debug ("music-player-bridge.vala:53: attempting to make an app info from %s", app); + info = g_desktop_app_info_new_from_filename (app); + if (info == NULL) { + g_warning ("music-player-bridge.vala:57: Could not create a desktopappinfo instanc" \ "e from app: %s", app); - _g_object_unref0 (info); - _g_free0 (app); - continue; - } - app_info = _g_object_ref0 ((_tmp2_ = info, G_IS_APP_INFO (_tmp2_) ? ((GAppInfo*) _tmp2_) : NULL)); - ctrl = player_controller_new (self->priv->root_menu, g_app_info_get_name (app_info), music_player_bridge_calculate_menu_position (self), PLAYER_CONTROLLER_STATE_OFFLINE); - g_object_set ((GObject*) ctrl, "app_info", app_info, NULL); - gee_abstract_map_set ((GeeAbstractMap*) self->priv->registered_clients, _tmp4_ = string_strip (_tmp3_ = g_utf8_strdown (g_app_info_get_name (app_info), -1)), ctrl); - _g_free0 (_tmp4_); - _g_free0 (_tmp3_); - g_debug ("music-player-bridge.vala:67: Created a player controller for %s which " \ -"was found in the cache file", _tmp6_ = string_strip (_tmp5_ = g_utf8_strdown (g_app_info_get_name (app_info), -1))); - _g_free0 (_tmp6_); - _g_free0 (_tmp5_); - count = count + 1; - _g_object_unref0 (ctrl); - _g_object_unref0 (app_info); _g_object_unref0 (info); + _g_free0 (app); + continue; } + app_info = _g_object_ref0 ((_tmp2_ = info, G_IS_APP_INFO (_tmp2_) ? ((GAppInfo*) _tmp2_) : NULL)); + ctrl = player_controller_new (self->priv->root_menu, g_app_info_get_name (app_info), music_player_bridge_calculate_menu_position (self), PLAYER_CONTROLLER_STATE_OFFLINE); + g_object_set ((GObject*) ctrl, "app_info", app_info, NULL); + gee_abstract_map_set ((GeeAbstractMap*) self->priv->registered_clients, _tmp4_ = string_strip (_tmp3_ = g_utf8_strdown (g_app_info_get_name (app_info), -1)), ctrl); + _g_free0 (_tmp4_); + _g_free0 (_tmp3_); + _g_object_unref0 (ctrl); + _g_object_unref0 (app_info); + _g_object_unref0 (info); _g_free0 (app); - break; } _g_object_unref0 (_app_it); } @@ -300,7 +289,7 @@ void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListe gboolean _tmp3_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (type != NULL); - g_debug ("music-player-bridge.vala:86: MusicPlayerBridge -> on_server_added with" \ + g_debug ("music-player-bridge.vala:82: MusicPlayerBridge -> on_server_added with" \ " value %s", type); if (music_player_bridge_server_is_not_of_interest (self, type)) { return; @@ -319,7 +308,7 @@ void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListe if ((_tmp5_ = gee_collection_contains ((GeeCollection*) (_tmp4_ = gee_map_get_keys ((GeeMap*) self->priv->registered_clients)), client_name), _g_object_unref0 (_tmp4_), _tmp5_)) { PlayerController* _tmp6_; PlayerController* _tmp7_; - g_debug ("music-player-bridge.vala:92: It figured out that it already has an ins" \ + g_debug ("music-player-bridge.vala:88: It figured out that it already has an ins" \ "tance for this player already"); player_controller_update_state (_tmp6_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, client_name), PLAYER_CONTROLLER_STATE_READY); _g_object_unref0 (_tmp6_); @@ -329,8 +318,8 @@ void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListe PlayerController* ctrl; ctrl = player_controller_new (self->priv->root_menu, client_name, music_player_bridge_calculate_menu_position (self), PLAYER_CONTROLLER_STATE_READY); gee_abstract_map_set ((GeeAbstractMap*) self->priv->registered_clients, client_name, ctrl); - g_debug ("music-player-bridge.vala:103: New Client of name %s has successfully r" \ -"egistered with us", client_name); + g_debug ("music-player-bridge.vala:99: New Client of name %s has successfully re" \ +"gistered with us", client_name); _g_object_unref0 (ctrl); } if ((_tmp9_ = player_controller_get_app_info (_tmp8_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, client_name)) == NULL, _g_object_unref0 (_tmp8_), _tmp9_)) { @@ -352,7 +341,7 @@ void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateLis gboolean _tmp3_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (type != NULL); - g_debug ("music-player-bridge.vala:115: MusicPlayerBridge -> on_server_removed w" \ + g_debug ("music-player-bridge.vala:111: MusicPlayerBridge -> on_server_removed w" \ "ith value %s", type); if (music_player_bridge_server_is_not_of_interest (self, type)) { return; @@ -367,7 +356,7 @@ void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateLis PlayerController* _tmp4_; player_controller_hibernate (_tmp4_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, client_name)); _g_object_unref0 (_tmp4_); - g_debug ("music-player-bridge.vala:120: Successively offlined client %s", client_name); + g_debug ("music-player-bridge.vala:116: Successively offlined client %s", client_name); } _g_free0 (client_name); } @@ -391,7 +380,7 @@ static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge return result; } if (string_contains (type, "music") == FALSE) { - g_debug ("music-player-bridge.vala:127: server is of no interest, it is not an " \ + g_debug ("music-player-bridge.vala:123: server is of no interest, it is not an " \ "music server"); result = TRUE; return result; @@ -415,7 +404,7 @@ static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, } if (_tmp1_) { GAppInfo* app_info; - g_debug ("music-player-bridge.vala:138: About to store desktop file path: %s", path); + g_debug ("music-player-bridge.vala:134: About to store desktop file path: %s", path); familiar_players_db_insert (bridge->priv->playersDB, path); app_info = music_player_bridge_create_app_info (path); if (app_info != NULL) { @@ -425,13 +414,13 @@ static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, PlayerController* ctrl; ctrl = (_tmp4_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) bridge->priv->registered_clients, _tmp3_ = string_strip (_tmp2_ = g_utf8_strdown (g_app_info_get_name (app_info), -1))), _g_free0 (_tmp3_), _g_free0 (_tmp2_), _tmp4_); g_object_set ((GObject*) ctrl, "app_info", app_info, NULL); - g_debug ("music-player-bridge.vala:144: successfully created appinfo from path a" \ + g_debug ("music-player-bridge.vala:140: successfully created appinfo from path a" \ "nd set it on the respective instance"); _g_object_unref0 (ctrl); } _g_object_unref0 (app_info); } else { - g_debug ("music-player-bridge.vala:148: Ignoring desktop file path because its e" \ + g_debug ("music-player-bridge.vala:144: Ignoring desktop file path because its e" \ "ither invalid of the db cache file has it already: %s", path); } _g_object_unref0 (bridge); @@ -450,20 +439,20 @@ void music_player_bridge_set_root_menu_item (MusicPlayerBridge* self, DbusmenuMe void music_player_bridge_on_server_count_changed (MusicPlayerBridge* self, IndicateListenerServer* object, guint i) { g_return_if_fail (self != NULL); - g_debug ("music-player-bridge.vala:160: MusicPlayerBridge-> on_server_count_chan" \ + g_debug ("music-player-bridge.vala:156: MusicPlayerBridge-> on_server_count_chan" \ "ged with value %u", i); } void music_player_bridge_on_indicator_added (MusicPlayerBridge* self, IndicateListenerServer* object, IndicateListenerIndicator* p0) { g_return_if_fail (self != NULL); - g_debug ("music-player-bridge.vala:164: MusicPlayerBridge-> on_indicator_added"); + g_debug ("music-player-bridge.vala:160: MusicPlayerBridge-> on_indicator_added"); } void music_player_bridge_on_indicator_removed (MusicPlayerBridge* self, IndicateListenerServer* object, IndicateListenerIndicator* p0) { g_return_if_fail (self != NULL); - g_debug ("music-player-bridge.vala:169: MusicPlayerBridge -> on_indicator_remove" \ + g_debug ("music-player-bridge.vala:165: MusicPlayerBridge -> on_indicator_remove" \ "d"); } @@ -471,7 +460,7 @@ void music_player_bridge_on_indicator_removed (MusicPlayerBridge* self, Indicate void music_player_bridge_on_indicator_modified (MusicPlayerBridge* self, IndicateListenerServer* object, IndicateListenerIndicator* p0, const char* s) { g_return_if_fail (self != NULL); g_return_if_fail (s != NULL); - g_debug ("music-player-bridge.vala:174: MusicPlayerBridge -> indicator_modified " \ + g_debug ("music-player-bridge.vala:170: MusicPlayerBridge -> indicator_modified " \ "with vale %s", s); } @@ -484,7 +473,7 @@ GAppInfo* music_player_bridge_create_app_info (const char* path) { g_return_val_if_fail (path != NULL, NULL); info = g_desktop_app_info_new_from_filename (path); if (path == NULL) { - g_warning ("music-player-bridge.vala:181: Could not create a desktopappinfo instan" \ + g_warning ("music-player-bridge.vala:177: Could not create a desktopappinfo instan" \ "ce from app: %s", path); result = NULL; _g_object_unref0 (info); |