~jamesh/unity-lens-applications/index-local-scopes

« back to all changes in this revision

Viewing changes to src/daemon.vala

  • Committer: Michal Hruby
  • Date: 2013-02-12 12:03:36 UTC
  • Revision ID: michal.mhr@gmail.com-20130212120336-xy9wd7a6iwvocmk3
And update once again

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
    private bool ratings_db_initialized = false;
63
63
    private Unity.Ratings.Database? ratings = null;
64
64
 
65
 
    private Unity.Scope scope;
 
65
    private Unity.DeprecatedScope scope;
66
66
 
67
67
    /* Support aptd dbus interface; created when application install/remove was requested by preview action */
68
68
    private AptdProxy aptdclient;
164
164
      file_icon_cache = new HashTable<string,Icon>(str_hash, str_equal);
165
165
      sc_mangler = new SoftwareCenterUtils.MangledDesktopFileLookup ();
166
166
 
167
 
      scope = new Unity.Scope ("/com/canonical/unity/scope/applications",
 
167
      scope = new Unity.DeprecatedScope ("/com/canonical/unity/scope/applications",
168
168
                               "applications");
169
169
 
170
170
      scope.search_hint = _("Search Applications");
244
244
      ratings_db_initialized = true;
245
245
    }
246
246
 
247
 
    private async void dispatch_search (ScopeSearch lens_search,
 
247
    private async void dispatch_search (DeprecatedScopeSearch lens_search,
248
248
                                        SearchType search_type,
249
 
                                        Cancellable cancellable)
 
249
                                        GLib.Cancellable cancellable)
250
250
    {
251
251
      if (popularities_dirty)
252
252
      {
265
265
 
266
266
    private void populate_categories ()
267
267
    {
268
 
      GLib.List<Unity.Category> categories = new GLib.List<Unity.Category> ();
 
268
      Unity.CategorySet categories = new Unity.CategorySet ();
269
269
      File icon_dir = File.new_for_path (ICON_PATH);
270
270
 
271
271
      var cat = new Unity.Category ("apps", _("Applications"),
272
272
                                    new FileIcon (icon_dir.get_child ("group-apps.svg")));
273
 
      categories.append (cat);
 
273
      categories.add (cat);
274
274
 
275
275
      cat = new Unity.Category ("recently-used", _("Recently Used"),
276
276
                                new FileIcon (icon_dir.get_child ("group-recent.svg")));
277
 
      categories.append (cat);
 
277
      categories.add (cat);
278
278
 
279
279
      cat = new Unity.Category ("recent", _("Recent Apps"),
280
280
                                new FileIcon (icon_dir.get_child ("group-apps.svg")));
281
 
      categories.append (cat);
 
281
      categories.add (cat);
282
282
 
283
283
      cat = new Unity.Category ("installed", _("Installed"),
284
284
                                new FileIcon (icon_dir.get_child ("group-installed.svg")));
285
 
      categories.append (cat);
 
285
      categories.add (cat);
286
286
 
287
287
      cat = new Unity.Category ("more", _("More suggestions"),
288
288
                                new FileIcon (icon_dir.get_child ("group-treat-yourself.svg")),
289
289
                                Unity.CategoryRenderer.FLOW);
290
 
      categories.append (cat);
 
290
      categories.add (cat);
291
291
 
292
292
      scope.categories = categories;
293
293
    }
294
294
 
295
295
    private void populate_filters()
296
296
    {
297
 
      GLib.List<Unity.Filter> filters = new GLib.List<Unity.Filter> ();
 
297
      Unity.FilterSet filters = new Unity.FilterSet ();
298
298
 
299
299
      /* Type filter */
300
300
      {
315
315
        filter.add_option ("science-and-engineering", _("Science & Engineering"));
316
316
        filter.add_option ("system", _("System"));
317
317
 
318
 
        filters.append (filter);
 
318
        filters.add (filter);
319
319
      }
320
320
 
321
321
      scope.filters = filters;
454
454
      return app == null;
455
455
    }
456
456
 
457
 
    private async void update_scope_search (ScopeSearch search,
458
 
                                            Cancellable cancellable)
 
457
    private async void update_scope_search (DeprecatedScopeSearch search,
 
458
                                            GLib.Cancellable cancellable)
459
459
    {
460
460
      var model = search.results_model;
461
461
      /* We'll clear the model once we finish waiting for the dbus-call
607
607
      search.finished ();
608
608
    }
609
609
 
610
 
    private async void update_global_search (ScopeSearch search,
611
 
                                             Cancellable cancellable)
 
610
    private async void update_global_search (DeprecatedScopeSearch search,
 
611
                                             GLib.Cancellable cancellable)
612
612
    {
613
613
      /*
614
614
       * In global search, with a non-empty search string, we collate all
647
647
      search.finished ();
648
648
    }
649
649
 
650
 
    private async void update_global_without_search (ScopeSearch search,
651
 
                                                     Cancellable cancellable)
 
650
    private async void update_global_without_search (DeprecatedScopeSearch search,
 
651
                                                     GLib.Cancellable cancellable)
652
652
    {
653
653
      /*
654
654
       * In global search, with an empty search string, we show just Recent Apps