~ubuntu-branches/ubuntu/trusty/unity-place-files/trusty

« back to all changes in this revision

Viewing changes to src/daemon.vala

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-06-24 20:41:14 UTC
  • Revision ID: james.westby@ubuntu.com-20100624204114-6mbl6evlublzxw44
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2010 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 Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
 
17
 *
 
18
 */
 
19
using Dee;
 
20
using DBus;
 
21
using Zeitgeist;
 
22
using Zeitgeist.Timestamp;
 
23
using Unity.Place;
 
24
using Config;
 
25
using Gee;
 
26
 
 
27
namespace Unity.FilesPlace {
 
28
 
 
29
  public class FilesEntryInfo : Unity.Place.EntryInfo
 
30
  {
 
31
    private Zeitgeist.Index index;
 
32
    private Gee.List<PtrArray> section_templates;  
 
33
 
 
34
    public FilesEntryInfo (string dbus_path,
 
35
                           Gee.List<PtrArray> section_templates)
 
36
    {
 
37
      base(dbus_path);
 
38
      index = new Zeitgeist.Index ();
 
39
      this.section_templates = section_templates;
 
40
    }
 
41
 
 
42
    public override async uint set_global_search (Search search)
 
43
    {
 
44
      var results_model = global_renderer_info.results_model;
 
45
      var groups_model = global_renderer_info.groups_model;
 
46
      uint hit_count = yield do_search (search, Section.ALL_FILES,
 
47
                                        results_model, groups_model);
 
48
      return hit_count;
 
49
    }
 
50
 
 
51
    public override async uint set_search (Search search)
 
52
    {
 
53
      var results_model = entry_renderer_info.results_model;
 
54
      var groups_model = entry_renderer_info.groups_model;
 
55
      uint hit_count = yield do_search (search, (Section)active_section,
 
56
                                        results_model, groups_model);
 
57
      return hit_count;
 
58
    }
 
59
 
 
60
    private async uint do_search  (Search search,
 
61
                                   Section section,
 
62
                                   Dee.Model results_model,
 
63
                                   Dee.Model groups_model)
 
64
    {
 
65
      var templates = section_templates.get((int)section);
 
66
 
 
67
      try {
 
68
        /* Get relevancy ranked results for the "Top Results" group */
 
69
        var results = yield index.search (search.get_search_string (),
 
70
                                          new Zeitgeist.TimeRange.anytime(),
 
71
                                          templates,
 
72
                                          Zeitgeist.StorageState.ANY,
 
73
                                          100,
 
74
                                          Zeitgeist.ResultType.RELEVANCY,
 
75
                                          null);
 
76
        
 
77
        results_model.clear ();
 
78
        Unity.FilesPlace.append_top_results (results,
 
79
                                             results_model,
 
80
                                             groups_model);
 
81
 
 
82
        debug ("Found %u/%u matches for search '%s'",
 
83
               results.size (), results.estimated_matches (),
 
84
               search.get_search_string ());
 
85
 
 
86
        results = yield index.search (search.get_search_string (),
 
87
                                      new Zeitgeist.TimeRange.anytime(),
 
88
                                      templates,
 
89
                                      Zeitgeist.StorageState.ANY,
 
90
                                      100,
 
91
                                      Zeitgeist.ResultType.MOST_RECENT_SUBJECTS,
 
92
                                      null);
 
93
        Unity.FilesPlace.append_events_sorted (results,
 
94
                                               results_model, groups_model);
 
95
 
 
96
        return results.estimated_matches ();
 
97
      } catch (GLib.Error e) {
 
98
        warning ("Error performing search '%s': %s", 
 
99
                 search.get_search_string (), e.message);
 
100
        return 0;
 
101
      }
 
102
    }
 
103
  }
 
104
 
 
105
  public class Daemon : GLib.Object
 
106
  {
 
107
    private Zeitgeist.Log log;
 
108
    private Zeitgeist.Index index;
 
109
    private Zeitgeist.Monitor monitor;
 
110
 
 
111
    private Unity.Place.Controller control;
 
112
    private Unity.Place.EntryInfo files;
 
113
    
 
114
    /* For each section we have a set of Zeitgeist.Event templates that
 
115
     * we use to query Zeitgeist */
 
116
    private Gee.List<PtrArray> section_templates;
 
117
 
 
118
    /* Store a maping of DateMonth to Dee.ModelIter. We map to the iter and
 
119
     * not simply the offset, because in theory anyone on the bus could
 
120
     * update the Dee.SharedModel we use for the groups changing the row
 
121
     * offsets*/
 
122
    private Gee.List<unowned Dee.ModelIter?> months;
 
123
 
 
124
    construct
 
125
    {
 
126
      var sections_model = new Dee.SharedModel(
 
127
                                 "com.canonical.Unity.FilesPlace.SectionsModel",
 
128
                                 2, typeof (string), typeof (string));
 
129
 
 
130
      var groups_model = new Dee.SharedModel(
 
131
                                 "com.canonical.Unity.FilesPlace.GroupsModel",
 
132
                                 3, typeof (string), typeof (string),
 
133
                                 typeof (string));
 
134
 
 
135
      var global_groups_model = new Dee.SharedModel(
 
136
                                 "com.canonical.Unity.FilesPlace.GlobalGroupsModel",
 
137
                                 3, typeof (string), typeof (string),
 
138
                                 typeof (string));
 
139
 
 
140
      var results_model = new Dee.SharedModel(
 
141
                                 "com.canonical.Unity.FilesPlace.ResultsModel",
 
142
                                 6, typeof (string), typeof (string),
 
143
                                 typeof (uint), typeof (string),
 
144
                                 typeof (string), typeof (string));
 
145
 
 
146
      var global_results_model = new Dee.SharedModel(
 
147
                                 "com.canonical.Unity.FilesPlace.GlobalResultsModel",
 
148
                                 6, typeof (string), typeof (string),
 
149
                                 typeof (uint), typeof (string),
 
150
                                 typeof (string), typeof (string));
 
151
 
 
152
      section_templates = new Gee.ArrayList<PtrArray> ();
 
153
      prepare_section_templates();
 
154
 
 
155
      files = new FilesEntryInfo ("/com/canonical/unity/filesplace/files",
 
156
                                  section_templates);
 
157
      files.sections_model = sections_model;
 
158
      files.entry_renderer_info.groups_model = groups_model;
 
159
      files.entry_renderer_info.results_model = results_model;
 
160
      files.global_renderer_info.groups_model = global_groups_model;
 
161
      files.global_renderer_info.results_model = global_results_model;
 
162
 
 
163
      populate_sections ();
 
164
      populate_groups ();
 
165
 
 
166
      files.icon = @"$(Config.PREFIX)/share/unity/files.png";
 
167
      
 
168
 
 
169
      // FIXME: We monitor on all events, restrict templates to file events
 
170
      var templates = new PtrArray();
 
171
      var event = new Zeitgeist.Event ();
 
172
      templates.add (event);
 
173
      monitor = new Zeitgeist.Monitor (new Zeitgeist.TimeRange.from_now (),
 
174
                                       (owned) templates);
 
175
 
 
176
      log = new Zeitgeist.Log();
 
177
      index = new Zeitgeist.Index();
 
178
 
 
179
      /* Listen for section changes */
 
180
      files.notify["active-section"].connect (on_active_section_changed);
 
181
 
 
182
      /* We should not do anything with the results modelresults = yield index.search (search.get_search_string (),
 
183
                                          new Zeitgeist.TimeRange.anytime(),
 
184
                                          templates,
 
185
                                          Zeitgeist.StorageState.ANY,
 
186
                                          100,
 
187
                                          Zeitgeist.ResultType.RELEVANCY,
 
188
                                          null);
 
189
       * until we receieve the 'ready' signal */
 
190
      results_model.ready.connect (this.on_results_model_ready);
 
191
 
 
192
      sections_model.connect ();
 
193
      groups_model.connect ();
 
194
      global_groups_model.connect ();
 
195
      results_model.connect ();
 
196
      global_results_model.connect ();
 
197
      
 
198
      /* The last thing we do is export the controller. Once that is up,
 
199
       * clients will expect the SharedModels to work */
 
200
      control = new Unity.Place.Controller ("/com/canonical/unity/filesplace");
 
201
      control.add_entry (files);      
 
202
      try {
 
203
        control.export ();
 
204
      } catch (DBus.Error error) {
 
205
        critical ("Failed to export DBus service for '%s': %s",
 
206
                  control.dbus_path, error.message);
 
207
      }
 
208
    }
 
209
 
 
210
    private void populate_sections ()
 
211
    {
 
212
      var sections = files.sections_model;
 
213
      
 
214
      if (sections.get_n_rows() != 0)
 
215
        {
 
216
          critical ("The sections model should be empty before initial population");
 
217
          sections.clear ();
 
218
        }
 
219
 
 
220
      sections.append (SectionsColumn.DISPLAY_NAME, "All Files",
 
221
                       SectionsColumn.ICON_HINT, "", -1);
 
222
      sections.append (SectionsColumn.DISPLAY_NAME, "Documents",
 
223
                       SectionsColumn.ICON_HINT, "", -1);
 
224
      sections.append (SectionsColumn.DISPLAY_NAME, "Folders",
 
225
                       SectionsColumn.ICON_HINT, "", -1);
 
226
      sections.append (SectionsColumn.DISPLAY_NAME, "Images",
 
227
                       SectionsColumn.ICON_HINT, "", -1);
 
228
      sections.append (SectionsColumn.DISPLAY_NAME, "Videos",
 
229
                       SectionsColumn.ICON_HINT, "", -1);
 
230
      sections.append (SectionsColumn.DISPLAY_NAME, "Presentations",
 
231
                       SectionsColumn.ICON_HINT, "", -1);
 
232
      sections.append (SectionsColumn.DISPLAY_NAME, "Other",
 
233
                       SectionsColumn.ICON_HINT, "", -1);
 
234
    }
 
235
    
 
236
    private void populate_groups ()
 
237
    {
 
238
      var groups = files.entry_renderer_info.groups_model;
 
239
      
 
240
      if (groups.get_n_rows() != 0)
 
241
        {
 
242
          critical ("The groups model should be empty before initial population");
 
243
          groups.clear ();
 
244
        }
 
245
      
 
246
      groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer",
 
247
                     GroupsColumn.DISPLAY_NAME, "Top Results",
 
248
                     GroupsColumn.ICON_HINT, "", -1);
 
249
      groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer",
 
250
                     GroupsColumn.DISPLAY_NAME, "Today",
 
251
                     GroupsColumn.ICON_HINT, "", -1);
 
252
      groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer",
 
253
                     GroupsColumn.DISPLAY_NAME, "Yesterday",
 
254
                     GroupsColumn.ICON_HINT, "", -1);
 
255
      groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer",
 
256
                     GroupsColumn.DISPLAY_NAME, "This week",
 
257
                     GroupsColumn.ICON_HINT, "", -1);
 
258
      groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer",
 
259
                     GroupsColumn.DISPLAY_NAME, "Last Week",
 
260
                     GroupsColumn.ICON_HINT, "", -1);
 
261
      groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer",
 
262
                     GroupsColumn.DISPLAY_NAME, "This Month",
 
263
                     GroupsColumn.ICON_HINT, "", -1);
 
264
      groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer",
 
265
                     GroupsColumn.DISPLAY_NAME, "Past Six Months",
 
266
                     GroupsColumn.ICON_HINT, "", -1);
 
267
      groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer",
 
268
                     GroupsColumn.DISPLAY_NAME, "This Year",
 
269
                     GroupsColumn.ICON_HINT, "", -1);
 
270
      groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer",
 
271
                     GroupsColumn.DISPLAY_NAME, "Last Year",
 
272
                     GroupsColumn.ICON_HINT, "", -1);
 
273
      groups.append (GroupsColumn.RENDERER, "Specific Year", // FIXME: Use actual year, eg "2009"
 
274
                     GroupsColumn.DISPLAY_NAME, "Today",
 
275
                     GroupsColumn.ICON_HINT, "", -1);
 
276
      groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer",
 
277
                     GroupsColumn.DISPLAY_NAME, "Today",
 
278
                     GroupsColumn.ICON_HINT, "", -1);
 
279
            
 
280
      months = new Gee.ArrayList<unowned Dee.ModelIter?>();
 
281
      months.add(null);
 
282
      for (uint i = 1; i <= DateMonth.DECEMBER; i++)
 
283
      {
 
284
        unowned Dee.ModelIter iter = groups.append (
 
285
                                  GroupsColumn.RENDERER, "UnityDefaultRenderer",
 
286
                                  GroupsColumn.DISPLAY_NAME, Utils.get_month_name ((DateMonth)i),
 
287
                                  GroupsColumn.ICON_HINT, "", -1);
 
288
        months.add(iter);
 
289
                                  
 
290
      }
 
291
    }
 
292
    
 
293
    private void prepare_section_templates ()
 
294
    {
 
295
      PtrArray templates;
 
296
      Event event;
 
297
      
 
298
      /* HACK ALERT: All the (event as GLib.Object).ref() are needed because
 
299
       *             GPtrArray doesn't grab a ref to the event objects */
 
300
      
 
301
      /* Section.ALL_FILES */
 
302
      templates = new PtrArray.sized(1);
 
303
      event = new Event.full("", ZG_USER_ACTIVITY, "",
 
304
                             new Subject.full ("file:*",
 
305
                                               "",
 
306
                                               NFO_FILE_DATA_OBJECT,
 
307
                                               "", "", "", ""));
 
308
      templates.add ((event as GLib.Object).ref());
 
309
      section_templates.add (templates);
 
310
      
 
311
      /* Section.DOCUMENTS
 
312
       * FIXME: Filter out presentations: https://bugs.launchpad.net/zeitgeist/+bug/592599 */
 
313
      templates = new PtrArray.sized(1);
 
314
      event = new Event.full("", ZG_USER_ACTIVITY, "",
 
315
                             new Subject.full ("file:*",
 
316
                                               NFO_DOCUMENT,
 
317
                                               NFO_FILE_DATA_OBJECT,
 
318
                                               "", "", "", ""));
 
319
      templates.add ((event as GLib.Object).ref());
 
320
      section_templates.add (templates);
 
321
      
 
322
      /* Section.FOLDERS.
 
323
       * FIXME: We probably need to be clever here and use something
 
324
       *       like subject.origin in stead of NFO_FOLDER */
 
325
      templates = new PtrArray.sized(1);
 
326
      event = new Event.full("", ZG_USER_ACTIVITY, "",
 
327
                             new Subject.full ("file:*",
 
328
                                               NFO_FOLDER,
 
329
                                               NFO_FILE_DATA_OBJECT,
 
330
                                               "", "", "", ""));
 
331
      templates.add ((event as GLib.Object).ref());
 
332
      section_templates.add (templates);
 
333
      
 
334
      /* Section.IMAGES */
 
335
      templates = new PtrArray.sized(1);
 
336
      event = new Event.full("", ZG_USER_ACTIVITY, "",
 
337
                             new Subject.full ("file:*",
 
338
                                               NFO_IMAGE,
 
339
                                               NFO_FILE_DATA_OBJECT,
 
340
                                               "", "", "", ""));
 
341
      templates.add ((event as GLib.Object).ref());
 
342
      section_templates.add (templates);
 
343
      
 
344
      /* Section.VIDEOS */
 
345
      templates = new PtrArray.sized(1);
 
346
      event = new Event.full("", ZG_USER_ACTIVITY, "",
 
347
                             new Subject.full ("file:*",
 
348
                                               NFO_VIDEO,
 
349
                                               NFO_FILE_DATA_OBJECT,
 
350
                                               "", "", "", ""));
 
351
      templates.add ((event as GLib.Object).ref());
 
352
      section_templates.add (templates);
 
353
      
 
354
      /* Section.PRESENTATIONS
 
355
       * FIXME: Zeitgeist logger needs to user finer granularity
 
356
       *        on classification as I am not sure it uses
 
357
       *        NFO_PRESENTATION yet */
 
358
      templates = new PtrArray.sized(1);
 
359
      event = new Event.full("", ZG_USER_ACTIVITY, "",
 
360
                             new Subject.full ("file:*",
 
361
                                               NFO_PRESENTATION,
 
362
                                               NFO_FILE_DATA_OBJECT,
 
363
                                               "", "", "", ""));
 
364
      templates.add ((event as GLib.Object).ref());
 
365
      section_templates.add (templates);
 
366
      
 
367
      /* Section.OTHER
 
368
       * FIXME: Zeitgeist doesn't support collated AND NOT queries yet */
 
369
      templates = new PtrArray.sized(1);
 
370
      event = new Event.full("", ZG_USER_ACTIVITY, "",
 
371
                             new Subject.full ("file:*",
 
372
                                               "",
 
373
                                               NFO_FILE_DATA_OBJECT,
 
374
                                               "", "", "", ""));
 
375
      templates.add ((event as GLib.Object).ref());
 
376
      section_templates.add (templates);
 
377
    }
 
378
    
 
379
    public void on_results_model_ready (Dee.SharedModel model)
 
380
    {
 
381
      update_entry_results_model.begin();
 
382
      monitor.events_inserted.connect (on_events_inserted);
 
383
      
 
384
      // FIXME: Use the section queries as monitor templates as well
 
385
      //        and make sure we de-dupe the existing results as updates
 
386
      //        trickle in.
 
387
      //        See https://bugs.launchpad.net/anjali/+bug/598078
 
388
      //log.install_monitor.begin (monitor, null);
 
389
    }
 
390
 
 
391
    public void on_active_section_changed ()
 
392
    {
 
393
      // FIXME: Take active search into account
 
394
      //        See https://bugs.launchpad.net/anjali/+bug/598082
 
395
      files.entry_renderer_info.results_model.clear();
 
396
      update_entry_results_model.begin();
 
397
    }
 
398
 
 
399
    private async void update_entry_results_model ()
 
400
    {
 
401
      var section = files.active_section;
 
402
      var sections_model = files.sections_model;
 
403
      var results_model = files.entry_renderer_info.results_model;
 
404
      var groups_model = files.entry_renderer_info.groups_model;
 
405
      
 
406
      if (Section.LAST_SECTION != sections_model.get_n_rows())
 
407
        {
 
408
          critical ("Section model malformed");
 
409
          return;
 
410
        }
 
411
      
 
412
      if (section > Section.LAST_SECTION)
 
413
        {
 
414
          critical ("Active section out of bounds: %u", section);
 
415
          return;
 
416
        }
 
417
      
 
418
      var templates = section_templates.get((int)section);
 
419
      
 
420
      try {
 
421
        var events = yield log.find_events (
 
422
                                        new Zeitgeist.TimeRange.anytime(),
 
423
                                        templates,
 
424
                                        Zeitgeist.StorageState.ANY,
 
425
                                        100,
 
426
                                        Zeitgeist.ResultType.MOST_RECENT_SUBJECTS,
 
427
                                        null);
 
428
        debug ("Got %u events for section %u", events.size(), section);
 
429
 
 
430
        Unity.FilesPlace.append_events_sorted (events,
 
431
                                               results_model, groups_model);
 
432
      } catch (GLib.Error e) {
 
433
        warning ("Error fetching recetnly used files: %s", e.message);
 
434
      }
 
435
    }    
 
436
 
 
437
    private void on_events_inserted (Zeitgeist.Monitor mon,
 
438
                                     Zeitgeist.TimeRange time_range,
 
439
                                     ResultSet events)
 
440
    {
 
441
      // FIXME: Since we don't really have the timestamps for the evens in
 
442
      //        our model, we can't insert the events in the correct place
 
443
      //        although it's likely fine to just prepend them
 
444
 
 
445
      var results_model = files.entry_renderer_info.results_model;
 
446
      var groups_model = files.entry_renderer_info.groups_model;
 
447
 
 
448
      foreach (var ev in events)
 
449
        {
 
450
          if (ev.num_subjects() > 0)
 
451
            {
 
452
              // FIXME: We only use the first subject...
 
453
              Zeitgeist.Subject su = ev.get_subject(0);
 
454
 
 
455
              string icon = "";
 
456
              uint group_id = Utils.get_time_group (ev, groups_model);
 
457
 
 
458
              debug ("Notify %s, %s, %u", su.get_uri(), su.get_mimetype(), group_id);
 
459
 
 
460
              results_model.prepend (ResultsColumn.URI, su.get_uri(),
 
461
                                     ResultsColumn.ICON_HINT, icon,
 
462
                                     ResultsColumn.GROUP_ID, group_id,
 
463
                                     ResultsColumn.MIMETYPE, su.get_mimetype(),
 
464
                                     ResultsColumn.DISPLAY_NAME, su.get_text(),
 
465
                                     ResultsColumn.COMMENT, su.get_uri(),
 
466
                                     -1);
 
467
            }
 
468
        }
 
469
    }
 
470
  }
 
471
  
 
472
  /* Appends a set of Zeitgeist.Events to our Dee.Model assuming that
 
473
   * these events are already sorted with descending timestamps */
 
474
  public void append_events_sorted (ResultSet events,
 
475
                                    Dee.Model results,
 
476
                                    Dee.Model groups)
 
477
    {
 
478
      foreach (var ev in events)
 
479
        {
 
480
          if (ev.num_subjects() > 0)
 
481
            {
 
482
              // FIXME: We only use the first subject...
 
483
              Zeitgeist.Subject su = ev.get_subject(0);
 
484
 
 
485
              string icon = "";//yield get_icon_for_subject (su);
 
486
              uint group_id = Utils.get_time_group (ev, groups);
 
487
              
 
488
              debug ("Got %s, %s, %u", su.get_uri(), su.get_mimetype(), group_id);
 
489
 
 
490
              results.append (ResultsColumn.URI, su.get_uri(),
 
491
                              ResultsColumn.ICON_HINT, icon,
 
492
                              ResultsColumn.GROUP_ID, group_id,
 
493
                              ResultsColumn.MIMETYPE, su.get_mimetype(),
 
494
                              ResultsColumn.DISPLAY_NAME, su.get_text(),
 
495
                              ResultsColumn.COMMENT, su.get_uri(),
 
496
                              -1);
 
497
            }
 
498
        }
 
499
    }
 
500
  
 
501
  /* Appends a set of Zeitgeist.Events to our Dee.Model assuming that
 
502
   * these events are already sorted according to query relevancy.
 
503
   * The results will be added to the Top Results group */
 
504
  public void append_top_results (ResultSet events,
 
505
                                  Dee.Model results,
 
506
                                  Dee.Model groups)
 
507
    {
 
508
      Gee.Set<string> seen_uris = new Gee.HashSet<string>(str_hash);
 
509
    
 
510
      foreach (var ev in events)
 
511
        {
 
512
          if (ev.num_subjects() > 0)
 
513
            {
 
514
              // FIXME: We only use the first subject...
 
515
              Zeitgeist.Subject su = ev.get_subject(0);
 
516
              
 
517
              /* De-dup the results keyed on the subject URIs */
 
518
              var uri = su.get_uri();
 
519
              if (uri in seen_uris)
 
520
                continue;
 
521
              seen_uris.add (uri);
 
522
              
 
523
              string icon = "";
 
524
              
 
525
              debug ("Got %s, %s, %u", uri, su.get_mimetype(), Group.TOP_RESULTS);
 
526
 
 
527
              results.append (ResultsColumn.URI, uri,
 
528
                              ResultsColumn.ICON_HINT, icon,
 
529
                              ResultsColumn.GROUP_ID, Group.TOP_RESULTS,
 
530
                              ResultsColumn.MIMETYPE, su.get_mimetype(),
 
531
                              ResultsColumn.DISPLAY_NAME, su.get_text(),
 
532
                              ResultsColumn.COMMENT, uri,
 
533
                              -1);
 
534
            }
 
535
        }
 
536
    }
 
537
  
 
538
} /* namespace */