~mhr3/libunity/remote-scope-sources

« back to all changes in this revision

Viewing changes to src/unity-scope.vala

  • Committer: Tarmac
  • Author(s): Michal Hruby
  • Date: 2012-01-06 13:53:21 UTC
  • mfrom: (100.2.10 libunity)
  • Revision ID: tarmac-20120106135321-sxkgofuygntazlhe
Changes the API for setting sources on the scope side. (and makes it actually work). Fixes: https://bugs.launchpad.net/bugs/879484. Appoved by Mikkel Kamstrup Erlandsen.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
  public bool exported { get; private set; default = false; }
37
37
  public bool search_in_global { get; set; default = true; }
38
38
  public string dbus_path { get; construct; }
39
 
  public string[] sources { get; set; }
 
39
  public OptionsFilter sources { get; internal set; }
40
40
  public List<Filter> filters { get { return _filters; } }
41
41
 
42
42
  public Dee.SerializableModel results_model {
47
47
    get { return _pimpl._global_results_model; }
48
48
  }
49
49
 
50
 
  public string[] active_sources { get; private set; }
51
 
 
52
50
  public signal ActivationResponse? activate_uri (string uri);
53
51
  public signal Preview? preview_uri (string uri);
54
52
  public signal void filters_changed ();
64
62
   
65
63
  public Scope (string dbus_path_)
66
64
  {
67
 
    Object (dbus_path:dbus_path_);
 
65
    Object (dbus_path: dbus_path_,
 
66
            sources: new CheckOptionFilter ("sources", "Sources", null, true));
68
67
  }
69
68
 
70
69
  construct
71
70
  {
 
71
    sources = new CheckOptionFilter ("sources", "Sources", null, true);
72
72
    _pimpl = new ScopeImpl (this);
73
73
    // make sure the length of last_search matches
74
74
    static_assert (SearchType.N_TYPES == 2);
159
159
 
160
160
  internal void set_active_sources_internal (string[] active_sources_)
161
161
  {
162
 
    active_sources = active_sources_;
 
162
    foreach (var filter_option in sources.options)
 
163
    {
 
164
      filter_option.active = filter_option.id in active_sources_;
 
165
    }
 
166
 
 
167
    // FIXME: emit a signal? ping the property?
163
168
  }
164
169
 
165
170
  internal void set_local (bool is_local_)