~charlesk/indicator-sound/nogtk2

« back to all changes in this revision

Viewing changes to src/mpris2-controller.vala

  • Committer: Charles Kerr
  • Date: 2012-03-19 19:01:28 UTC
  • mfrom: (313.1.1 indicator-sound)
  • Revision ID: charles.kerr@canonical.com-20120319190128-3orxajdpdxk3yshk
merge lp:~cjcurran/indicator-sound/fixes-945827 to fix a playlist crash.

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
    }
93
93
    Variant? playlist_v = changed_properties.lookup("ActivePlaylist");
94
94
    if ( playlist_v != null && this.owner.use_playlists == true ){
95
 
      Timeout.add (300, this.fetch_active_playlist);
 
95
      Timeout.add (500, this.fetch_active_playlist);
96
96
    }
97
97
    Variant? playlist_count_v = changed_properties.lookup("PlaylistCount");
98
98
    if ( playlist_count_v != null && this.owner.use_playlists == true ){
240
240
      playlists_item.update(current_playlists);
241
241
    }
242
242
    else{
243
 
      warning(" Playlists are on but its returning no current_playlists" );
 
243
      warning(" Playlists are on but %s is returning no current_playlists ?",
 
244
              this.owner.app_info.get_name());
244
245
      this.owner.use_playlists = false;
245
246
    }
246
247
  }
247
248
 
 
249
  private bool validate_playlists_details()
 
250
  {
 
251
    if (this.playlists.ActivePlaylist.valid == false){
 
252
      return false;
 
253
    }    
 
254
    if (this.playlists.ActivePlaylist.details == null){
 
255
      return false;
 
256
    }
 
257
    if (this.playlists.ActivePlaylist.details.path == null ||
 
258
        this.playlists.ActivePlaylist.details.name == null){
 
259
      return false;      
 
260
    } 
 
261
    return true;
 
262
  }
 
263
 
248
264
  private bool fetch_active_playlist()
249
265
  {    
250
 
    if (this.playlists.ActivePlaylist.valid == false){
 
266
    if (this.validate_playlists_details() == false){
251
267
      return false;
252
268
    }    
253
269
    PlaylistsMenuitem playlists_item = this.owner.custom_items[PlayerController.widget_order.PLAYLISTS] as PlaylistsMenuitem;