~cjcurran/indicator-sound/source-monitoring

« back to all changes in this revision

Viewing changes to src/playlists-menu-item.vala

  • Committer: Conor Curran
  • Date: 2011-03-23 15:49:11 UTC
  • Revision ID: conor.curran@canonical.com-20110323154911-1xsc4xodwwcu0k1n
Tags: 0.6.5-natty-beta
make sure on playlist update it doesn't use the custom icon

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
    }
84
84
  }
85
85
 
86
 
  private string? parse_icon_path (string path)  
87
 
  {
88
 
    if (path == "")return null;
89
 
    var icon_file = File.new_for_path (path);
90
 
    if (icon_file.get_path() == null)return null;
91
 
    return icon_file.get_basename().split(".")[0];
92
 
  }
93
 
 
94
86
  public void update_individual_playlist (PlaylistDetails new_detail)
95
87
  {
96
88
    foreach ( Dbusmenu.Menuitem item in this.current_playlists.values ){
97
89
      if (new_detail.path == item.property_get (MENUITEM_PATH)){
98
90
        item.property_set (MENUITEM_PROP_LABEL, new_detail.name);
99
 
        var result = this.parse_icon_path (new_detail.icon_path);
100
 
        if (result != null) {
101
 
          item.property_set (MENUITEM_PROP_ICON_NAME, result);
102
 
        }
103
91
      }
104
92
    }
105
93
    // If its active make sure the name is updated on the root item.