~liuxingcs/unity-china-music-scope/1.0

« back to all changes in this revision

Viewing changes to src/filter-parser-genre.vala

  • Committer: Package Import Robot
  • Author(s): whzhang-kylin
  • Date: 2012-12-13 09:29:34 UTC
  • Revision ID: package-import@ubuntu.com-20121213092934-0z4qywr7i1fp6nsy
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2011 Canonical Ltd
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License version 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by Alex Launi <alex.launi@canonical.com>
 
17
 *
 
18
 */
 
19
 
 
20
using GLib;
 
21
 
 
22
namespace Unity.MusicLens {
 
23
  
 
24
  public class GenreFilterParser : FilterParser
 
25
  {
 
26
    public GenreFilterParser (CheckOptionFilterCompact filter)
 
27
    {
 
28
      base (filter);
 
29
      map = new Genre ();
 
30
    }
 
31
   
 
32
    public override string parse ()
 
33
    {
 
34
      return "";
 
35
    }
 
36
 
 
37
    protected override string id { get { return "genre"; } }
 
38
    protected Genre map { get; private set; }
 
39
 
 
40
    protected List<FilterOption> get_all_selected_genres ()
 
41
    {
 
42
      unowned List<FilterOption> options = (filter as CheckOptionFilterCompact).options;
 
43
      var active = new List<FilterOption> ();
 
44
 
 
45
      foreach (FilterOption option in options)
 
46
        {
 
47
        if (option.active)
 
48
          active.append (option);
 
49
      }
 
50
      
 
51
      return active;
 
52
    }
 
53
  }
 
54
}