~ubuntu-branches/ubuntu/wily/unity/wily

« back to all changes in this revision

Viewing changes to UnityCore/HomeLens.cpp

  • Committer: Michal Hruby
  • Date: 2012-08-16 16:25:00 UTC
  • mto: (55.1863.233 unity)
  • mto: This revision was merged to the branch mainline in revision 768.
  • Revision ID: michal.mhr@gmail.com-20120816162500-jggglmi855hfivq0
Act on review comments

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
nux::logging::Logger logger("unity.dash.homelens");
43
43
 
 
44
const gchar* const HOMELENS_PRIORITY = "unity-homelens-priority";
 
45
const gchar* const HOMELENS_RESULTS_MODEL = "unity-homelens-results-model";
 
46
 
44
47
}
45
48
 
46
49
/*
317
320
  {
318
321
    if (it->second == source)
319
322
      return; // this model was already added
320
 
    sig_manager_.Disconnect(it->second.RawPtr());
 
323
    sig_manager_.Disconnect(it->second);
321
324
  }
322
325
  sources_by_owner_[owner_lens] = source;
323
326
 
394
397
  EnsureRowBuf(model);
395
398
 
396
399
  results_model = static_cast<DeeModel*>(g_object_get_data(
397
 
                              G_OBJECT(model), "unity-homelens-results-model"));
 
400
                              G_OBJECT(model), HOMELENS_RESULTS_MODEL));
398
401
  if (results_model == NULL)
399
402
  {
400
403
    LOG_DEBUG(logger) << "Category model " << model
429
432
                                          display_name);
430
433
 
431
434
  gsize lens_priority = GPOINTER_TO_SIZE(g_object_get_data(
432
 
                                   G_OBJECT(model), "unity-homelens-priority"));
 
435
                                   G_OBJECT(model), HOMELENS_PRIORITY));
433
436
  unsigned lens_prio = static_cast<unsigned>(lens_priority);
434
437
  category_ordering_.insert(std::pair<unsigned, unsigned>(lens_prio, target_cat_index));
435
438
  if (category_ordering_.rbegin()->second != target_cat_index)
662
665
    }
663
666
 
664
667
    g_object_set_data(G_OBJECT(categories),
665
 
                      "unity-homelens-results-model",
 
668
                      HOMELENS_RESULTS_MODEL,
666
669
                      results);
667
670
 
668
671
    gsize lens_priority = FindLensPriority(lens);
669
672
    g_object_set_data(G_OBJECT(categories),
670
 
                      "unity-homelens-priority",
 
673
                      HOMELENS_PRIORITY,
671
674
                      GSIZE_TO_POINTER(lens_priority));
672
675
 
673
676
    LOG_DEBUG(logger) << "Registering results model "  << results