~unity-team/unity-lens-sample/trunk

« back to all changes in this revision

Viewing changes to src/daemon.vala

  • Committer: Mikkel Kamstrup Erlandsen
  • Date: 2011-02-04 15:32:27 UTC
  • Revision ID: mikkel.kamstrup@gmail.com-20110204153227-olxx3a1dwtoh22l5
Don't use deprecated Vala/GIO API g_content_type_get_icon() but use ContentType.get_icon()

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 */
6
6
using Dee;
7
7
using Gee;
 
8
using Unity.Place;
8
9
using Config;
9
10
 
10
11
namespace Unity.SamplePlace {
17
18
 
18
19
  /**
19
20
   * The Daemon class implements all of the logic for the place.
20
 
   * It implements the Unity.PlaceActivation interface in order to
 
21
   * It implements the Unity.Place.Activation interface in order to
21
22
   * do custom activation of the URI and Mime patterns defined in the
22
23
   * .place file.
23
24
   *
24
25
   */
25
 
  public class Daemon : GLib.Object, Unity.Activation
 
26
  public class Daemon : GLib.Object, Unity.Place.Activation
26
27
  {
27
 
    private Unity.PlaceController control;
28
 
    private Unity.PlaceEntryInfo place_entry;
 
28
    private Unity.Place.Controller control;
 
29
    private Unity.Place.EntryInfo place_entry;
29
30
 
30
31
    construct
31
32
    {
54
55
       * Object path of the EntryInfo must match the one defined in the
55
56
       * the place entry in the place .place file
56
57
       */
57
 
      place_entry = new PlaceEntryInfo ("/com/canonical/unity/sampleplace/stuff");
 
58
      place_entry = new EntryInfo ("/com/canonical/unity/sampleplace/stuff");
58
59
      place_entry.sections_model = sections_model;
59
60
      place_entry.entry_renderer_info.groups_model = groups_model;
60
61
      place_entry.entry_renderer_info.results_model = results_model;
90
91
       * The 'place' EntryInfo is exported for Unity to show by adding it to
91
92
       * the controller. You can add more than one EntryInfo here if you have
92
93
       * more than one place entry to export from the same place daemon */
93
 
      control = new Unity.PlaceController ("/com/canonical/unity/sampleplace");
 
94
      control = new Unity.Place.Controller ("/com/canonical/unity/sampleplace");
94
95
      control.add_entry (place_entry);
95
96
      
96
 
      /* Since the Daemon class implements the Unity.PlaceActivation interface
 
97
      /* Since the Daemon class implements the Unity.Place.Activation interface
97
98
       * we can override the default activation handler on the controller.
98
99
       * We need to do that to properly handle the activation patternts we
99
100
       * registered in the .place file  */
172
173
    /* Generic method to update a results model. We do it like this to minimize
173
174
     * code dup between updating the global- and the entry results model */
174
175
    private void update_results_model (Dee.Model results_model, Dee.Model groups_model,
175
 
                                       PlaceSearch? search, Section section)
 
176
                                       Search? search, Section section)
176
177
    {
177
178
      debug ("Rebuilding results model");
178
179
      results_model.clear ();
200
201
     * defined in the .place file.
201
202
     *
202
203
     * This method should return a member of the enumeration
203
 
     * Unity.PlaceActivationStatus:
 
204
     * Unity.Place.ActivationStatus:
204
205
     *
205
206
     * - ActivationStatus.ACTIVATED_HIDE_DASH
206
207
     * - ActivationStatus.ACTIVATED_SHOW_DASH