diff options
Diffstat (limited to 'src/music-player-bridge.c')
-rw-r--r-- | src/music-player-bridge.c | 809 |
1 files changed, 498 insertions, 311 deletions
diff --git a/src/music-player-bridge.c b/src/music-player-bridge.c index f04450b..a96d27c 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.14.2, the Vala compiler +/* music-player-bridge.c generated by valac 0.16.1, the Vala compiler * generated from music-player-bridge.vala, do not modify */ /* @@ -169,20 +169,23 @@ static gchar* music_player_bridge_determine_key (gchar* desktop_or_interface); void player_controller_remove_from_menu (PlayerController* self); 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 void music_player_bridge_on_preferred_update (MusicPlayerBridge* self, GeeArrayList* preferred); +void player_controller_set_as_preferred (PlayerController* self, gboolean val); static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlayerBridge* self); +GeeArrayList* settings_manager_fetch_preferred (SettingsManager* self); GeeArrayList* settings_manager_fetch_interested (SettingsManager* self); static GAppInfo* music_player_bridge_create_app_info (const gchar* desktop); static gchar* music_player_bridge_fetch_icon_name (const gchar* desktop); 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 gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state); -PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state); +PlayerController* player_controller_new (DbusmenuMenuitem* root, GAppInfo* app, const gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state, gboolean is_preferred); +PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, GAppInfo* app, const gchar* dbus_name, const gchar* icon_name, gint offset, gboolean* use_playlists, PlayerControllerstate initial_state, gboolean is_preferred); static void music_player_bridge_establish_file_monitoring (MusicPlayerBridge* self, GAppInfo* info, const gchar* mpris_key); static Block1Data* block1_data_ref (Block1Data* _data1_); -static void block1_data_unref (Block1Data* _data1_); -static void ___lambda2_ (Block1Data* _data1_, GFile* desktop_file, GFile* other_file, GFileMonitorEvent event_type); +static void block1_data_unref (void * _userdata_); +static void ___lambda4_ (Block1Data* _data1_, GFile* desktop_file, GFile* other_file, GFileMonitorEvent event_type); static void music_player_bridge_relevant_desktop_file_changed (MusicPlayerBridge* self, GFile* desktop_file, GFile* other_file, GFileMonitorEvent event_type, GFileMonitor* monitor); -static void ____lambda2__g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self); +static void ____lambda4__g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self); void settings_manager_remove_interested (SettingsManager* self, const gchar* app_desktop_name); #define PLAYER_CONTROLLER_WIDGET_QUANTITY 4 void music_player_bridge_client_has_become_available (MusicPlayerBridge* self, const gchar* desktop, const gchar* dbus_name, gboolean use_playlists); @@ -209,6 +212,7 @@ static GObject * music_player_bridge_constructor (GType type, guint n_construct_ SettingsManager* settings_manager_new (void); SettingsManager* settings_manager_construct (GType object_type); static void _music_player_bridge_on_blacklist_update_settings_manager_blacklist_updates (SettingsManager* _sender, gchar** new_blacklist, int new_blacklist_length1, gpointer self); +static void _music_player_bridge_on_preferred_update_settings_manager_preferred_updates (SettingsManager* _sender, GeeArrayList* new_preferred, gpointer self); static void music_player_bridge_finalize (GObject* obj); static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); @@ -232,7 +236,7 @@ static void music_player_bridge_on_blacklist_update (MusicPlayerBridge* self, gc gint _tmp0__length1; Mpris2Watcher* _tmp15_; g_return_if_fail (self != NULL); - g_debug ("music-player-bridge.vala:47: some blacklist update"); + g_debug ("music-player-bridge.vala:48: some blacklist update"); _tmp0_ = blacklist; _tmp0__length1 = blacklist_length1; { @@ -271,7 +275,7 @@ static void music_player_bridge_on_blacklist_update (MusicPlayerBridge* self, gc GeeHashMap* _tmp13_; const gchar* _tmp14_; _tmp8_ = key; - g_debug ("music-player-bridge.vala:52: Apparently %s is now blacklisted - remove" \ + g_debug ("music-player-bridge.vala:53: Apparently %s is now blacklisted - remove" \ " thy self", _tmp8_); _tmp9_ = self->priv->registered_clients; _tmp10_ = key; @@ -293,122 +297,254 @@ static void music_player_bridge_on_blacklist_update (MusicPlayerBridge* self, gc } +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static void music_player_bridge_on_preferred_update (MusicPlayerBridge* self, GeeArrayList* preferred) { + g_return_if_fail (self != NULL); + g_return_if_fail (preferred != NULL); + g_debug ("music-player-bridge.vala:64: Preferred players update. Clearing curren" \ +"t preferred players..."); + { + GeeHashMap* _tmp0_; + GeeCollection* _tmp1_; + GeeCollection* _tmp2_; + GeeCollection* _tmp3_; + GeeIterator* _tmp4_ = NULL; + GeeIterator* _tmp5_; + GeeIterator* _player_controller_it; + _tmp0_ = self->priv->registered_clients; + _tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = _tmp2_; + _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_); + _tmp5_ = _tmp4_; + _g_object_unref0 (_tmp3_); + _player_controller_it = _tmp5_; + while (TRUE) { + GeeIterator* _tmp6_; + gboolean _tmp7_ = FALSE; + GeeIterator* _tmp8_; + gpointer _tmp9_ = NULL; + PlayerController* player_controller; + PlayerController* _tmp10_; + _tmp6_ = _player_controller_it; + _tmp7_ = gee_iterator_next (_tmp6_); + if (!_tmp7_) { + break; + } + _tmp8_ = _player_controller_it; + _tmp9_ = gee_iterator_get (_tmp8_); + player_controller = (PlayerController*) _tmp9_; + _tmp10_ = player_controller; + player_controller_set_as_preferred (_tmp10_, FALSE); + _g_object_unref0 (player_controller); + } + _g_object_unref0 (_player_controller_it); + } + { + GeeArrayList* _tmp11_; + GeeArrayList* _tmp12_; + GeeArrayList* _s_list; + GeeArrayList* _tmp13_; + gint _tmp14_; + gint _tmp15_; + gint _s_size; + gint _s_index; + _tmp11_ = preferred; + _tmp12_ = _g_object_ref0 (_tmp11_); + _s_list = _tmp12_; + _tmp13_ = _s_list; + _tmp14_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp13_); + _tmp15_ = _tmp14_; + _s_size = _tmp15_; + _s_index = -1; + while (TRUE) { + gint _tmp16_; + gint _tmp17_; + gint _tmp18_; + GeeArrayList* _tmp19_; + gint _tmp20_; + gpointer _tmp21_ = NULL; + gchar* s; + const gchar* _tmp22_; + gchar* _tmp23_; + gchar* _tmp24_ = NULL; + gchar* key; + GeeHashMap* _tmp25_; + const gchar* _tmp26_; + gboolean _tmp27_ = FALSE; + _tmp16_ = _s_index; + _s_index = _tmp16_ + 1; + _tmp17_ = _s_index; + _tmp18_ = _s_size; + if (!(_tmp17_ < _tmp18_)) { + break; + } + _tmp19_ = _s_list; + _tmp20_ = _s_index; + _tmp21_ = gee_abstract_list_get ((GeeAbstractList*) _tmp19_, _tmp20_); + s = (gchar*) _tmp21_; + _tmp22_ = s; + _tmp23_ = g_strdup (_tmp22_); + _tmp24_ = music_player_bridge_determine_key (_tmp23_); + key = _tmp24_; + _tmp25_ = self->priv->registered_clients; + _tmp26_ = key; + _tmp27_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp25_, _tmp26_); + if (_tmp27_) { + const gchar* _tmp28_; + GeeHashMap* _tmp29_; + const gchar* _tmp30_; + gpointer _tmp31_ = NULL; + PlayerController* _tmp32_; + _tmp28_ = key; + g_debug ("music-player-bridge.vala:73: Setting %s as preferred player", _tmp28_); + _tmp29_ = self->priv->registered_clients; + _tmp30_ = key; + _tmp31_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp29_, _tmp30_); + _tmp32_ = (PlayerController*) _tmp31_; + player_controller_set_as_preferred (_tmp32_, TRUE); + _g_object_unref0 (_tmp32_); + } + _g_free0 (key); + _g_free0 (s); + } + _g_object_unref0 (_s_list); + } +} + + static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlayerBridge* self) { + SettingsManager* _tmp0_; + GeeArrayList* _tmp1_ = NULL; + GeeArrayList* preferred_players; g_return_if_fail (self != NULL); + _tmp0_ = self->priv->settings_manager; + _tmp1_ = settings_manager_fetch_preferred (_tmp0_); + preferred_players = _tmp1_; { - SettingsManager* _tmp0_; - GeeArrayList* _tmp1_ = NULL; + SettingsManager* _tmp2_; + GeeArrayList* _tmp3_ = NULL; GeeArrayList* _desktop_list; - GeeArrayList* _tmp2_; - gint _tmp3_; - gint _tmp4_; + GeeArrayList* _tmp4_; + gint _tmp5_; + gint _tmp6_; gint _desktop_size; gint _desktop_index; - _tmp0_ = self->priv->settings_manager; - _tmp1_ = settings_manager_fetch_interested (_tmp0_); - _desktop_list = _tmp1_; - _tmp2_ = _desktop_list; - _tmp3_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp2_); - _tmp4_ = _tmp3_; - _desktop_size = _tmp4_; + _tmp2_ = self->priv->settings_manager; + _tmp3_ = settings_manager_fetch_interested (_tmp2_); + _desktop_list = _tmp3_; + _tmp4_ = _desktop_list; + _tmp5_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp4_); + _tmp6_ = _tmp5_; + _desktop_size = _tmp6_; _desktop_index = -1; while (TRUE) { - gint _tmp5_; - gint _tmp6_; gint _tmp7_; - GeeArrayList* _tmp8_; + gint _tmp8_; gint _tmp9_; - gpointer _tmp10_ = NULL; + GeeArrayList* _tmp10_; + gint _tmp11_; + gpointer _tmp12_ = NULL; gchar* desktop; - const gchar* _tmp11_; - const gchar* _tmp12_; - gchar* _tmp13_ = NULL; - gchar* _tmp14_; - GAppInfo* _tmp15_ = NULL; - GAppInfo* _tmp16_; + const gchar* _tmp13_; + const gchar* _tmp14_; + gchar* _tmp15_ = NULL; + gchar* _tmp16_; + GAppInfo* _tmp17_ = NULL; + GAppInfo* _tmp18_; GAppInfo* app_info; - GAppInfo* _tmp17_; - const gchar* _tmp19_; - gchar* _tmp20_; - gchar* _tmp21_ = NULL; - gchar* mpris_key; - DbusmenuMenuitem* _tmp22_; - GAppInfo* _tmp23_; - const gchar* _tmp24_; - gchar* _tmp25_ = NULL; - gchar* _tmp26_; - gint _tmp27_ = 0; - PlayerController* _tmp28_; - PlayerController* _tmp29_; - PlayerController* ctrl; - GeeHashMap* _tmp30_; - const gchar* _tmp31_; + GAppInfo* _tmp19_; + GeeArrayList* _tmp21_; + const gchar* _tmp22_; + gboolean _tmp23_ = FALSE; + gboolean is_preferred; + DbusmenuMenuitem* _tmp24_; + GAppInfo* _tmp25_; + const gchar* _tmp26_; + gchar* _tmp27_ = NULL; + gchar* _tmp28_; + gint _tmp29_ = 0; + gboolean _tmp30_; + PlayerController* _tmp31_; PlayerController* _tmp32_; - GAppInfo* _tmp33_; - const gchar* _tmp34_; - _tmp5_ = _desktop_index; - _desktop_index = _tmp5_ + 1; - _tmp6_ = _desktop_index; - _tmp7_ = _desktop_size; - if (!(_tmp6_ < _tmp7_)) { + PlayerController* ctrl; + const gchar* _tmp33_; + gchar* _tmp34_; + gchar* _tmp35_ = NULL; + gchar* mpris_key; + GeeHashMap* _tmp36_; + const gchar* _tmp37_; + PlayerController* _tmp38_; + GAppInfo* _tmp39_; + const gchar* _tmp40_; + _tmp7_ = _desktop_index; + _desktop_index = _tmp7_ + 1; + _tmp8_ = _desktop_index; + _tmp9_ = _desktop_size; + if (!(_tmp8_ < _tmp9_)) { break; } - _tmp8_ = _desktop_list; - _tmp9_ = _desktop_index; - _tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _tmp9_); - desktop = (gchar*) _tmp10_; - _tmp11_ = desktop; - g_debug ("music-player-bridge.vala:64: interested client found : %s", _tmp11_); - _tmp12_ = desktop; - _tmp13_ = g_strconcat (_tmp12_, ".desktop", NULL); - _tmp14_ = _tmp13_; - _tmp15_ = music_player_bridge_create_app_info (_tmp14_); + _tmp10_ = _desktop_list; + _tmp11_ = _desktop_index; + _tmp12_ = gee_abstract_list_get ((GeeAbstractList*) _tmp10_, _tmp11_); + desktop = (gchar*) _tmp12_; + _tmp13_ = desktop; + g_debug ("music-player-bridge.vala:83: interested client found : %s", _tmp13_); + _tmp14_ = desktop; + _tmp15_ = g_strconcat (_tmp14_, ".desktop", NULL); _tmp16_ = _tmp15_; - _g_free0 (_tmp14_); - app_info = _tmp16_; - _tmp17_ = app_info; - if (_tmp17_ == NULL) { - const gchar* _tmp18_; - _tmp18_ = desktop; - g_warning ("music-player-bridge.vala:67: Could not create app_info for path %s \n" \ -" Getting out of here ", _tmp18_); + _tmp17_ = music_player_bridge_create_app_info (_tmp16_); + _tmp18_ = _tmp17_; + _g_free0 (_tmp16_); + app_info = _tmp18_; + _tmp19_ = app_info; + if (_tmp19_ == NULL) { + const gchar* _tmp20_; + _tmp20_ = desktop; + g_warning ("music-player-bridge.vala:86: Could not create app_info for path %s \n" \ +" Getting out of here ", _tmp20_); _g_object_unref0 (app_info); _g_free0 (desktop); continue; } - _tmp19_ = desktop; - _tmp20_ = g_strdup (_tmp19_); - _tmp21_ = music_player_bridge_determine_key (_tmp20_); - mpris_key = _tmp21_; - _tmp22_ = self->priv->root_menu; - _tmp23_ = app_info; - _tmp24_ = desktop; - _tmp25_ = music_player_bridge_fetch_icon_name (_tmp24_); - _tmp26_ = _tmp25_; - _tmp27_ = music_player_bridge_calculate_menu_position (self); - _tmp28_ = player_controller_new (_tmp22_, _tmp23_, NULL, _tmp26_, _tmp27_, NULL, PLAYER_CONTROLLER_STATE_OFFLINE); - _tmp29_ = _tmp28_; - _g_free0 (_tmp26_); - ctrl = _tmp29_; - _tmp30_ = self->priv->registered_clients; - _tmp31_ = mpris_key; - _tmp32_ = ctrl; - gee_abstract_map_set ((GeeAbstractMap*) _tmp30_, _tmp31_, _tmp32_); - _tmp33_ = app_info; - _tmp34_ = mpris_key; - music_player_bridge_establish_file_monitoring (self, _tmp33_, _tmp34_); - _g_object_unref0 (ctrl); + _tmp21_ = preferred_players; + _tmp22_ = desktop; + _tmp23_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp21_, _tmp22_); + is_preferred = _tmp23_; + _tmp24_ = self->priv->root_menu; + _tmp25_ = app_info; + _tmp26_ = desktop; + _tmp27_ = music_player_bridge_fetch_icon_name (_tmp26_); + _tmp28_ = _tmp27_; + _tmp29_ = music_player_bridge_calculate_menu_position (self); + _tmp30_ = is_preferred; + _tmp31_ = player_controller_new (_tmp24_, _tmp25_, NULL, _tmp28_, _tmp29_, NULL, PLAYER_CONTROLLER_STATE_OFFLINE, _tmp30_); + _tmp32_ = _tmp31_; + _g_free0 (_tmp28_); + ctrl = _tmp32_; + _tmp33_ = desktop; + _tmp34_ = g_strdup (_tmp33_); + _tmp35_ = music_player_bridge_determine_key (_tmp34_); + mpris_key = _tmp35_; + _tmp36_ = self->priv->registered_clients; + _tmp37_ = mpris_key; + _tmp38_ = ctrl; + gee_abstract_map_set ((GeeAbstractMap*) _tmp36_, _tmp37_, _tmp38_); + _tmp39_ = app_info; + _tmp40_ = mpris_key; + music_player_bridge_establish_file_monitoring (self, _tmp39_, _tmp40_); _g_free0 (mpris_key); + _g_object_unref0 (ctrl); _g_object_unref0 (app_info); _g_free0 (desktop); } _g_object_unref0 (_desktop_list); } -} - - -static gpointer _g_object_ref0 (gpointer self) { - return self ? g_object_ref (self) : NULL; + _g_object_unref0 (preferred_players); } @@ -418,15 +554,19 @@ static Block1Data* block1_data_ref (Block1Data* _data1_) { } -static void block1_data_unref (Block1Data* _data1_) { +static void block1_data_unref (void * _userdata_) { + Block1Data* _data1_; + _data1_ = (Block1Data*) _userdata_; if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) { - _g_object_unref0 (_data1_->self); + MusicPlayerBridge * self; + self = _data1_->self; + _g_object_unref0 (self); g_slice_free (Block1Data, _data1_); } } -static void ___lambda2_ (Block1Data* _data1_, GFile* desktop_file, GFile* other_file, GFileMonitorEvent event_type) { +static void ___lambda4_ (Block1Data* _data1_, GFile* desktop_file, GFile* other_file, GFileMonitorEvent event_type) { MusicPlayerBridge * self; GFile* _tmp0_; GFile* _tmp1_; @@ -442,8 +582,8 @@ static void ___lambda2_ (Block1Data* _data1_, GFile* desktop_file, GFile* other_ } -static void ____lambda2__g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self) { - ___lambda2_ (self, file, other_file, event_type); +static void ____lambda4__g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self) { + ___lambda4_ (self, file, other_file, event_type); } @@ -476,39 +616,37 @@ static void music_player_bridge_establish_file_monitoring (MusicPlayerBridge* se Block1Data* _data1_; GFile* _tmp7_; GFileMonitor* _tmp8_ = NULL; - GFileMonitor* _tmp9_; GFileMonitor* monitor; + GFileMonitor* _tmp9_; GFileMonitor* _tmp10_; GFileMonitor* _tmp11_; - GFileMonitor* _tmp12_; - const gchar* _tmp13_; - GeeHashMap* _tmp14_; + const gchar* _tmp12_; + GeeHashMap* _tmp13_; + const gchar* _tmp14_; const gchar* _tmp15_; - const gchar* _tmp16_; _data1_ = g_slice_new0 (Block1Data); _data1_->_ref_count_ = 1; _data1_->self = g_object_ref (self); _tmp7_ = f; _tmp8_ = g_file_monitor (_tmp7_, G_FILE_MONITOR_SEND_MOVED, NULL, &_inner_error_); - _tmp9_ = _g_object_ref0 (_tmp8_); - monitor = _tmp9_; + monitor = _tmp8_; if (_inner_error_ != NULL) { block1_data_unref (_data1_); _data1_ = NULL; goto __catch0_g_error; } + _tmp9_ = monitor; + _data1_->weak_monitor = _tmp9_; _tmp10_ = monitor; - _data1_->weak_monitor = _tmp10_; + g_signal_connect_data (_tmp10_, "changed", (GCallback) ____lambda4__g_file_monitor_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0); _tmp11_ = monitor; - g_signal_connect_data (_tmp11_, "changed", (GCallback) ____lambda2__g_file_monitor_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0); - _tmp12_ = monitor; - g_object_ref ((GObject*) _tmp12_); - _tmp13_ = file_path; - g_debug ("music-player-bridge.vala:95: monitoring file '%s'", _tmp13_); - _tmp14_ = self->priv->file_monitors; - _tmp15_ = file_path; - _tmp16_ = mpris_key; - gee_abstract_map_set ((GeeAbstractMap*) _tmp14_, _tmp15_, _tmp16_); + g_object_ref ((GObject*) _tmp11_); + _tmp12_ = file_path; + g_debug ("music-player-bridge.vala:116: monitoring file '%s'", _tmp12_); + _tmp13_ = self->priv->file_monitors; + _tmp14_ = file_path; + _tmp15_ = mpris_key; + gee_abstract_map_set ((GeeAbstractMap*) _tmp13_, _tmp14_, _tmp15_); _g_object_unref0 (monitor); block1_data_unref (_data1_); _data1_ = NULL; @@ -517,13 +655,13 @@ static void music_player_bridge_establish_file_monitoring (MusicPlayerBridge* se __catch0_g_error: { GError* e = NULL; - GAppInfo* _tmp17_; - const gchar* _tmp18_ = NULL; + GAppInfo* _tmp16_; + const gchar* _tmp17_ = NULL; e = _inner_error_; _inner_error_ = NULL; - _tmp17_ = info; - _tmp18_ = g_app_info_get_name (_tmp17_); - g_warning ("music-player-bridge.vala:99: Unable to create a file monitor for %s", _tmp18_); + _tmp16_ = info; + _tmp17_ = g_app_info_get_name (_tmp16_); + g_warning ("music-player-bridge.vala:120: Unable to create a file monitor for %s", _tmp17_); _g_error_free0 (e); _g_object_unref0 (f); _g_free0 (file_path); @@ -582,7 +720,7 @@ static void music_player_bridge_relevant_desktop_file_changed (MusicPlayerBridge path = _tmp2_; _tmp3_ = path; if (_tmp3_ == NULL) { - g_warning ("music-player-bridge.vala:114: relevant_desktop_file_changed is returni" \ + g_warning ("music-player-bridge.vala:135: relevant_desktop_file_changed is returni" \ "ng a file with no path !"); _g_free0 (path); return; @@ -593,7 +731,7 @@ static void music_player_bridge_relevant_desktop_file_changed (MusicPlayerBridge if (!_tmp6_) { const gchar* _tmp7_; _tmp7_ = path; - g_warning ("music-player-bridge.vala:118: relevant_desktop_file_changed is returni" \ + g_warning ("music-player-bridge.vala:139: relevant_desktop_file_changed is returni" \ "ng a file which we know nothing about - %s", _tmp7_); _g_free0 (path); return; @@ -604,7 +742,7 @@ static void music_player_bridge_relevant_desktop_file_changed (MusicPlayerBridge mpris_key = (gchar*) _tmp10_; _tmp11_ = path; _tmp12_ = mpris_key; - g_debug ("music-player-bridge.vala:124: file \"%s\" was removed; stopping monito" \ + g_debug ("music-player-bridge.vala:145: file \"%s\" was removed; stopping monito" \ "ring \"%s\"", _tmp11_, _tmp12_); _tmp13_ = self->priv->registered_clients; _tmp14_ = mpris_key; @@ -715,9 +853,16 @@ void music_player_bridge_client_has_become_available (MusicPlayerBridge* self, c gchar* _tmp21_; gchar* _tmp22_ = NULL; gchar* mpris_key; - GeeHashMap* _tmp23_; - const gchar* _tmp24_; - gboolean _tmp25_ = FALSE; + SettingsManager* _tmp23_; + GeeArrayList* _tmp24_ = NULL; + GeeArrayList* _tmp25_; + const gchar* _tmp26_; + gboolean _tmp27_ = FALSE; + gboolean _tmp28_; + gboolean is_preferred; + GeeHashMap* _tmp29_; + const gchar* _tmp30_; + gboolean _tmp31_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (desktop != NULL); g_return_if_fail (dbus_name != NULL); @@ -733,7 +878,7 @@ void music_player_bridge_client_has_become_available (MusicPlayerBridge* self, c if (_tmp3_) { const gchar* _tmp4_; _tmp4_ = dbus_name; - g_warning ("music-player-bridge.vala:147: Client %s attempting to register without" \ + g_warning ("music-player-bridge.vala:168: Client %s attempting to register without" \ " desktop entry being set on the mpris root", _tmp4_); return; } @@ -747,12 +892,12 @@ void music_player_bridge_client_has_become_available (MusicPlayerBridge* self, c if (_tmp10_) { const gchar* _tmp11_; _tmp11_ = desktop; - g_debug ("music-player-bridge.vala:152: Client %s attempting to register but I'm" \ + g_debug ("music-player-bridge.vala:173: Client %s attempting to register but I'm" \ " afraid it is blacklisted", _tmp11_); return; } _tmp12_ = desktop; - g_debug ("music-player-bridge.vala:157: client_has_become_available %s", _tmp12_); + g_debug ("music-player-bridge.vala:178: client_has_become_available %s", _tmp12_); _tmp13_ = desktop; _tmp14_ = g_strconcat (_tmp13_, ".desktop", NULL); _tmp15_ = _tmp14_; @@ -764,7 +909,7 @@ void music_player_bridge_client_has_become_available (MusicPlayerBridge* self, c if (_tmp18_ == NULL) { const gchar* _tmp19_; _tmp19_ = desktop; - g_warning ("music-player-bridge.vala:160: Could not create app_info for path %s \n" \ + g_warning ("music-player-bridge.vala:181: Could not create app_info for path %s \n" \ " Getting out of here ", _tmp19_); _g_object_unref0 (app_info); return; @@ -773,109 +918,119 @@ void music_player_bridge_client_has_become_available (MusicPlayerBridge* self, c _tmp21_ = g_strdup (_tmp20_); _tmp22_ = music_player_bridge_determine_key (_tmp21_); mpris_key = _tmp22_; - _tmp23_ = self->priv->registered_clients; - _tmp24_ = mpris_key; - _tmp25_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp23_, _tmp24_); - if (_tmp25_ == FALSE) { - const gchar* _tmp26_; - DbusmenuMenuitem* _tmp27_; - GAppInfo* _tmp28_; - const gchar* _tmp29_; - const gchar* _tmp30_; - gchar* _tmp31_ = NULL; - gchar* _tmp32_; - gint _tmp33_ = 0; - gboolean _tmp34_; - PlayerController* _tmp35_; - PlayerController* _tmp36_; + _tmp23_ = self->priv->settings_manager; + _tmp24_ = settings_manager_fetch_preferred (_tmp23_); + _tmp25_ = _tmp24_; + _tmp26_ = desktop; + _tmp27_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp25_, _tmp26_); + _tmp28_ = _tmp27_; + _g_object_unref0 (_tmp25_); + is_preferred = _tmp28_; + _tmp29_ = self->priv->registered_clients; + _tmp30_ = mpris_key; + _tmp31_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp29_, _tmp30_); + if (_tmp31_ == FALSE) { + const gchar* _tmp32_; + DbusmenuMenuitem* _tmp33_; + GAppInfo* _tmp34_; + const gchar* _tmp35_; + const gchar* _tmp36_; + gchar* _tmp37_ = NULL; + gchar* _tmp38_; + gint _tmp39_ = 0; + gboolean _tmp40_; + gboolean _tmp41_; + PlayerController* _tmp42_; + PlayerController* _tmp43_; PlayerController* ctrl; - GeeHashMap* _tmp37_; - const gchar* _tmp38_; - PlayerController* _tmp39_; - const gchar* _tmp40_; - SettingsManager* _tmp41_; - const gchar* _tmp42_; - GAppInfo* _tmp43_; - const gchar* _tmp44_; - _tmp26_ = dbus_name; - g_debug ("music-player-bridge.vala:168: New client has registered that we have n" \ -"ot seen before: %s", _tmp26_); - _tmp27_ = self->priv->root_menu; - _tmp28_ = app_info; - _tmp29_ = dbus_name; - _tmp30_ = desktop; - _tmp31_ = music_player_bridge_fetch_icon_name (_tmp30_); - _tmp32_ = _tmp31_; - _tmp33_ = music_player_bridge_calculate_menu_position (self); - _tmp34_ = use_playlists; - _tmp35_ = player_controller_new (_tmp27_, _tmp28_, _tmp29_, _tmp32_, _tmp33_, &_tmp34_, PLAYER_CONTROLLER_STATE_READY); - _tmp36_ = _tmp35_; - _g_free0 (_tmp32_); - ctrl = _tmp36_; - _tmp37_ = self->priv->registered_clients; - _tmp38_ = mpris_key; - _tmp39_ = ctrl; - gee_abstract_map_set ((GeeAbstractMap*) _tmp37_, _tmp38_, _tmp39_); - _tmp40_ = desktop; - g_debug ("music-player-bridge.vala:177: Have not seen this %s before, new contro" \ -"ller created.", _tmp40_); - _tmp41_ = self->priv->settings_manager; - _tmp42_ = desktop; - settings_manager_add_interested (_tmp41_, _tmp42_); - _tmp43_ = app_info; - _tmp44_ = mpris_key; - music_player_bridge_establish_file_monitoring (self, _tmp43_, _tmp44_); - g_debug ("music-player-bridge.vala:180: application added to the interested list"); + GeeHashMap* _tmp44_; + const gchar* _tmp45_; + PlayerController* _tmp46_; + const gchar* _tmp47_; + SettingsManager* _tmp48_; + const gchar* _tmp49_; + GAppInfo* _tmp50_; + const gchar* _tmp51_; + _tmp32_ = dbus_name; + g_debug ("music-player-bridge.vala:190: New client has registered that we have n" \ +"ot seen before: %s", _tmp32_); + _tmp33_ = self->priv->root_menu; + _tmp34_ = app_info; + _tmp35_ = dbus_name; + _tmp36_ = desktop; + _tmp37_ = music_player_bridge_fetch_icon_name (_tmp36_); + _tmp38_ = _tmp37_; + _tmp39_ = music_player_bridge_calculate_menu_position (self); + _tmp40_ = use_playlists; + _tmp41_ = is_preferred; + _tmp42_ = player_controller_new (_tmp33_, _tmp34_, _tmp35_, _tmp38_, _tmp39_, &_tmp40_, PLAYER_CONTROLLER_STATE_READY, _tmp41_); + _tmp43_ = _tmp42_; + _g_free0 (_tmp38_); + ctrl = _tmp43_; + _tmp44_ = self->priv->registered_clients; + _tmp45_ = mpris_key; + _tmp46_ = ctrl; + gee_abstract_map_set ((GeeAbstractMap*) _tmp44_, _tmp45_, _tmp46_); + _tmp47_ = desktop; + g_debug ("music-player-bridge.vala:200: Have not seen this %s before, new contro" \ +"ller created.", _tmp47_); + _tmp48_ = self->priv->settings_manager; + _tmp49_ = desktop; + settings_manager_add_interested (_tmp48_, _tmp49_); + _tmp50_ = app_info; + _tmp51_ = mpris_key; + music_player_bridge_establish_file_monitoring (self, _tmp50_, _tmp51_); + g_debug ("music-player-bridge.vala:203: application added to the interested list"); _g_object_unref0 (ctrl); } else { - GeeHashMap* _tmp45_; - const gchar* _tmp46_; - gpointer _tmp47_ = NULL; - PlayerController* _tmp48_; - gboolean _tmp49_; - gboolean* _tmp50_; - GeeHashMap* _tmp51_; - const gchar* _tmp52_; - gpointer _tmp53_ = NULL; - PlayerController* _tmp54_; - GeeHashMap* _tmp55_; - const gchar* _tmp56_; - gpointer _tmp57_ = NULL; - PlayerController* _tmp58_; + GeeHashMap* _tmp52_; + const gchar* _tmp53_; + gpointer _tmp54_ = NULL; + PlayerController* _tmp55_; + gboolean _tmp56_; + gboolean* _tmp57_; + GeeHashMap* _tmp58_; const gchar* _tmp59_; - const gchar* _tmp60_; - gboolean _tmp61_; - gchar* _tmp62_ = NULL; - gchar* _tmp63_; - _tmp45_ = self->priv->registered_clients; - _tmp46_ = mpris_key; - _tmp47_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp45_, _tmp46_); - _tmp48_ = (PlayerController*) _tmp47_; - _tmp49_ = use_playlists; - _tmp50_ = __bool_dup0 (&_tmp49_); - _g_free0 (_tmp48_->use_playlists); - _tmp48_->use_playlists = _tmp50_; - _g_object_unref0 (_tmp48_); - _tmp51_ = self->priv->registered_clients; - _tmp52_ = mpris_key; - _tmp53_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp51_, _tmp52_); - _tmp54_ = (PlayerController*) _tmp53_; - player_controller_update_state (_tmp54_, PLAYER_CONTROLLER_STATE_READY); - _g_object_unref0 (_tmp54_); - _tmp55_ = self->priv->registered_clients; - _tmp56_ = mpris_key; - _tmp57_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp55_, _tmp56_); - _tmp58_ = (PlayerController*) _tmp57_; - _tmp59_ = dbus_name; - player_controller_activate (_tmp58_, _tmp59_); - _g_object_unref0 (_tmp58_); - _tmp60_ = dbus_name; - _tmp61_ = use_playlists; - _tmp62_ = bool_to_string (_tmp61_); - _tmp63_ = _tmp62_; - g_debug ("music-player-bridge.vala:186: Application has already registered - awa" \ -"ken the hibernation: %s with playlists %s \n", _tmp60_, _tmp63_); - _g_free0 (_tmp63_); + gpointer _tmp60_ = NULL; + PlayerController* _tmp61_; + GeeHashMap* _tmp62_; + const gchar* _tmp63_; + gpointer _tmp64_ = NULL; + PlayerController* _tmp65_; + const gchar* _tmp66_; + const gchar* _tmp67_; + gboolean _tmp68_; + gchar* _tmp69_ = NULL; + gchar* _tmp70_; + _tmp52_ = self->priv->registered_clients; + _tmp53_ = mpris_key; + _tmp54_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp52_, _tmp53_); + _tmp55_ = (PlayerController*) _tmp54_; + _tmp56_ = use_playlists; + _tmp57_ = __bool_dup0 (&_tmp56_); + _g_free0 (_tmp55_->use_playlists); + _tmp55_->use_playlists = _tmp57_; + _g_object_unref0 (_tmp55_); + _tmp58_ = self->priv->registered_clients; + _tmp59_ = mpris_key; + _tmp60_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp58_, _tmp59_); + _tmp61_ = (PlayerController*) _tmp60_; + player_controller_update_state (_tmp61_, PLAYER_CONTROLLER_STATE_READY); + _g_object_unref0 (_tmp61_); + _tmp62_ = self->priv->registered_clients; + _tmp63_ = mpris_key; + _tmp64_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp62_, _tmp63_); + _tmp65_ = (PlayerController*) _tmp64_; + _tmp66_ = dbus_name; + player_controller_activate (_tmp65_, _tmp66_); + _g_object_unref0 (_tmp65_); + _tmp67_ = dbus_name; + _tmp68_ = use_playlists; + _tmp69_ = bool_to_string (_tmp68_); + _tmp70_ = _tmp69_; + g_debug ("music-player-bridge.vala:209: Application has already registered - awa" \ +"ken the hibernation: %s with playlists %s \n", _tmp67_, _tmp70_); + _g_free0 (_tmp70_); } _g_free0 (mpris_key); _g_object_unref0 (app_info); @@ -888,8 +1043,8 @@ void music_player_bridge_client_has_vanished (MusicPlayerBridge* self, const gch g_return_if_fail (self != NULL); g_return_if_fail (mpris_root_interface != NULL); _tmp0_ = mpris_root_interface; - g_debug ("music-player-bridge.vala:192: MusicPlayerBridge -> client with dbus in" \ -"terface %s has vanished", _tmp0_); + g_debug ("music-player-bridge.vala:215: \n" \ +" MusicPlayerBridge -> client with dbus interface %s has vanished", _tmp0_); _tmp1_ = self->priv->root_menu; if (_tmp1_ != NULL) { const gchar* _tmp2_; @@ -901,7 +1056,7 @@ void music_player_bridge_client_has_vanished (MusicPlayerBridge* self, const gch const gchar* _tmp7_; gboolean _tmp11_; _tmp2_ = mpris_root_interface; - g_debug ("music-player-bridge.vala:195: attempt to remove %s", _tmp2_); + g_debug ("music-player-bridge.vala:218: \n attempt to remove %s", _tmp2_); _tmp3_ = mpris_root_interface; _tmp4_ = g_strdup (_tmp3_); _tmp5_ = music_player_bridge_determine_key (_tmp4_); @@ -932,7 +1087,7 @@ void music_player_bridge_client_has_vanished (MusicPlayerBridge* self, const gch player_controller_hibernate (_tmp15_); _g_object_unref0 (_tmp15_); _tmp16_ = mpris_key; - g_debug ("music-player-bridge.vala:199: Successively offlined client %s", _tmp16_); + g_debug ("music-player-bridge.vala:222: \n Successively offlined client %s", _tmp16_); } _g_free0 (mpris_key); } @@ -998,7 +1153,7 @@ void music_player_bridge_enable_player_specific_items_for_client (MusicPlayerBri if (_tmp5_ == FALSE) { const gchar* _tmp6_; _tmp6_ = desktop_id; - g_warning ("music-player-bridge.vala:218: we don't have a client with desktop id %" \ + g_warning ("music-player-bridge.vala:241: we don't have a client with desktop id %" \ "s registered", _tmp6_); _g_free0 (mpris_key); return; @@ -1040,7 +1195,7 @@ void music_player_bridge_enable_track_specific_items_for_client (MusicPlayerBrid if (_tmp5_ == FALSE) { const gchar* _tmp6_; _tmp6_ = desktop_id; - g_warning ("music-player-bridge.vala:229: we don't have a client with desktop id %" \ + g_warning ("music-player-bridge.vala:252: we don't have a client with desktop id %" \ "s registered", _tmp6_); _g_free0 (mpris_key); return; @@ -1083,7 +1238,7 @@ static GAppInfo* music_player_bridge_create_app_info (const gchar* desktop) { if (_tmp5_) { const gchar* _tmp6_; _tmp6_ = desktop; - g_warning ("music-player-bridge.vala:239: Could not create a desktopappinfo instan" \ + g_warning ("music-player-bridge.vala:262: Could not create a desktopappinfo instan" \ "ce from app: %s", _tmp6_); result = NULL; _g_object_unref0 (info); @@ -1147,7 +1302,7 @@ static gchar* music_player_bridge_fetch_icon_name (const gchar* desktop) { GError* _error_ = NULL; _error_ = _inner_error_; _inner_error_ = NULL; - g_warning ("music-player-bridge.vala:255: Error loading keyfile - FileError"); + g_warning ("music-player-bridge.vala:278: Error loading keyfile - FileError"); result = NULL; _g_error_free0 (_error_); _g_key_file_free0 (desktop_keyfile); @@ -1160,7 +1315,7 @@ static gchar* music_player_bridge_fetch_icon_name (const gchar* desktop) { GError* _error_ = NULL; _error_ = _inner_error_; _inner_error_ = NULL; - g_warning ("music-player-bridge.vala:259: Error loading keyfile - KeyFileError"); + g_warning ("music-player-bridge.vala:282: Error loading keyfile - KeyFileError"); result = NULL; _g_error_free0 (_error_); _g_key_file_free0 (desktop_keyfile); @@ -1203,7 +1358,7 @@ static gchar* music_player_bridge_fetch_icon_name (const gchar* desktop) { GError* _error_ = NULL; _error_ = _inner_error_; _inner_error_ = NULL; - g_warning ("music-player-bridge.vala:268: Error trying to fetch the icon name from" \ + g_warning ("music-player-bridge.vala:291: Error trying to fetch the icon name from" \ " the keyfile"); result = NULL; _g_error_free0 (_error_); @@ -1220,96 +1375,120 @@ static gchar* music_player_bridge_fetch_icon_name (const gchar* desktop) { } +static gboolean string_contains (const gchar* self, const gchar* needle) { + gboolean result = FALSE; + const gchar* _tmp0_; + gchar* _tmp1_ = NULL; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (needle != NULL, FALSE); + _tmp0_ = needle; + _tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_); + result = _tmp1_ != NULL; + return result; +} + + static gchar* music_player_bridge_determine_key (gchar* desktop_or_interface) { gchar* result = NULL; const gchar* _tmp0_; - gchar* _tmp1_; + gboolean _tmp1_ = FALSE; + const gchar* _tmp3_; + gchar* _tmp4_; gchar* _result_; - const gchar* _tmp2_; - gchar** _tmp3_; - gchar** _tmp4_ = NULL; + const gchar* _tmp5_; + gchar** _tmp6_; + gchar** _tmp7_ = NULL; gchar** tokens; gint tokens_length1; gint _tokens_size_; - gboolean _tmp5_ = FALSE; - gchar** _tmp6_; - gint _tmp6__length1; - gboolean _tmp8_; - const gchar* _tmp13_; - gchar** _tmp14_; - gchar** _tmp15_ = NULL; + gboolean _tmp8_ = FALSE; + gchar** _tmp9_; + gint _tmp9__length1; + gboolean _tmp11_; + const gchar* _tmp16_; + gchar** _tmp17_; + gchar** _tmp18_ = NULL; gchar** temp; gint temp_length1; gint _temp_size_; - gboolean _tmp16_ = FALSE; - gchar** _tmp17_; - gint _tmp17__length1; - gboolean _tmp19_; + gboolean _tmp19_ = FALSE; + gchar** _tmp20_; + gint _tmp20__length1; + gboolean _tmp22_; g_return_val_if_fail (desktop_or_interface != NULL, NULL); _tmp0_ = desktop_or_interface; - _tmp1_ = g_strdup (_tmp0_); - _result_ = _tmp1_; - _tmp2_ = desktop_or_interface; - _tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ".", 0); - tokens = _tmp4_; - tokens_length1 = _vala_array_length (_tmp3_); - _tokens_size_ = tokens_length1; - _tmp6_ = tokens; - _tmp6__length1 = tokens_length1; - if (_tmp6_ != NULL) { - gchar** _tmp7_; - gint _tmp7__length1; - _tmp7_ = tokens; - _tmp7__length1 = tokens_length1; - _tmp5_ = _tmp7__length1 > 1; - } else { - _tmp5_ = FALSE; + _tmp1_ = string_contains (_tmp0_, "amarok"); + if (_tmp1_) { + gchar* _tmp2_; + _tmp2_ = g_strdup ("amarok"); + result = _tmp2_; + _g_free0 (desktop_or_interface); + return result; } - _tmp8_ = _tmp5_; - if (_tmp8_) { - gchar** _tmp9_; - gint _tmp9__length1; + _tmp3_ = desktop_or_interface; + _tmp4_ = g_strdup (_tmp3_); + _result_ = _tmp4_; + _tmp5_ = desktop_or_interface; + _tmp7_ = _tmp6_ = g_strsplit (_tmp5_, ".", 0); + tokens = _tmp7_; + tokens_length1 = _vala_array_length (_tmp6_); + _tokens_size_ = tokens_length1; + _tmp9_ = tokens; + _tmp9__length1 = tokens_length1; + if (_tmp9_ != NULL) { gchar** _tmp10_; gint _tmp10__length1; - const gchar* _tmp11_; - gchar* _tmp12_; - _tmp9_ = tokens; - _tmp9__length1 = tokens_length1; _tmp10_ = tokens; _tmp10__length1 = tokens_length1; - _tmp11_ = _tmp9_[_tmp10__length1 - 1]; - _tmp12_ = g_strdup (_tmp11_); + _tmp8_ = _tmp10__length1 > 1; + } else { + _tmp8_ = FALSE; + } + _tmp11_ = _tmp8_; + if (_tmp11_) { + gchar** _tmp12_; + gint _tmp12__length1; + gchar** _tmp13_; + gint _tmp13__length1; + const gchar* _tmp14_; + gchar* _tmp15_; + _tmp12_ = tokens; + _tmp12__length1 = tokens_length1; + _tmp13_ = tokens; + _tmp13__length1 = tokens_length1; + _tmp14_ = _tmp12_[_tmp13__length1 - 1]; + _tmp15_ = g_strdup (_tmp14_); _g_free0 (_result_); - _result_ = _tmp12_; + _result_ = _tmp15_; } - _tmp13_ = _result_; - _tmp15_ = _tmp14_ = g_strsplit (_tmp13_, "-", 0); - temp = _tmp15_; - temp_length1 = _vala_array_length (_tmp14_); + _tmp16_ = _result_; + _tmp18_ = _tmp17_ = g_strsplit (_tmp16_, "-", 0); + temp = _tmp18_; + temp_length1 = _vala_array_length (_tmp17_); _temp_size_ = temp_length1; - _tmp17_ = temp; - _tmp17__length1 = temp_length1; - if (_tmp17_ != NULL) { - gchar** _tmp18_; - gint _tmp18__length1; - _tmp18_ = temp; - _tmp18__length1 = temp_length1; - _tmp16_ = _tmp18__length1 > 1; + _tmp20_ = temp; + _tmp20__length1 = temp_length1; + if (_tmp20_ != NULL) { + gchar** _tmp21_; + gint _tmp21__length1; + _tmp21_ = temp; + _tmp21__length1 = temp_length1; + _tmp19_ = _tmp21__length1 > 1; } else { - _tmp16_ = FALSE; + _tmp19_ = FALSE; } - _tmp19_ = _tmp16_; - if (_tmp19_) { - gchar** _tmp20_; - gint _tmp20__length1; - const gchar* _tmp21_; - gchar* _tmp22_; - _tmp20_ = temp; - _tmp20__length1 = temp_length1; - _tmp21_ = _tmp20_[0]; - _tmp22_ = g_strdup (_tmp21_); + _tmp22_ = _tmp19_; + if (_tmp22_) { + gchar** _tmp23_; + gint _tmp23__length1; + const gchar* _tmp24_; + gchar* _tmp25_; + _tmp23_ = temp; + _tmp23__length1 = temp_length1; + _tmp24_ = _tmp23_[0]; + _tmp25_ = g_strdup (_tmp24_); _g_free0 (_result_); - _result_ = _tmp22_; + _result_ = _tmp25_; } result = _result_; temp = (_vala_array_free (temp, temp_length1, (GDestroyNotify) g_free), NULL); @@ -1324,6 +1503,11 @@ static void _music_player_bridge_on_blacklist_update_settings_manager_blacklist_ } +static void _music_player_bridge_on_preferred_update_settings_manager_preferred_updates (SettingsManager* _sender, GeeArrayList* new_preferred, gpointer self) { + music_player_bridge_on_preferred_update (self, new_preferred); +} + + static GObject * music_player_bridge_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { GObject * obj; GObjectClass * parent_class; @@ -1332,6 +1516,7 @@ static GObject * music_player_bridge_constructor (GType type, guint n_construct_ GeeHashMap* _tmp1_; SettingsManager* _tmp2_; SettingsManager* _tmp3_; + SettingsManager* _tmp4_; parent_class = G_OBJECT_CLASS (music_player_bridge_parent_class); obj = parent_class->constructor (type, n_construct_properties, construct_properties); self = MUSIC_PLAYER_BRIDGE (obj); @@ -1346,6 +1531,8 @@ static GObject * music_player_bridge_constructor (GType type, guint n_construct_ self->priv->settings_manager = _tmp2_; _tmp3_ = self->priv->settings_manager; g_signal_connect_object (_tmp3_, "blacklist-updates", (GCallback) _music_player_bridge_on_blacklist_update_settings_manager_blacklist_updates, self, 0); + _tmp4_ = self->priv->settings_manager; + g_signal_connect_object (_tmp4_, "preferred-updates", (GCallback) _music_player_bridge_on_preferred_update_settings_manager_preferred_updates, self, 0); return obj; } |