~tatokis/unity/gcc-72-errors

« back to all changes in this revision

Viewing changes to launcher/LauncherModel.cpp

  • Committer: CI Train Bot
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2015-12-11 12:44:27 UTC
  • mfrom: (4027.5.25 switcher-dynamic-model)
  • Revision ID: ci-train-bot@canonical.com-20151211124427-opfhmbzulgczo4gs
SwitcherModel: allow to add/remove icons dynamically and update them when they require it

We keep hidden applications in a separated vector; when an application becomes
invisible in switcher we need to move it to the hidden_applications_ vector,
if it becomes visible again we put it back on the main model vector. Fixes: #1512349
Approved by: Andrea Azzarone

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
  .add("selection", selection_);
44
44
}
45
45
 
46
 
unity::debug::Introspectable::IntrospectableList LauncherModel::GetIntrospectableChildren()
 
46
debug::Introspectable::IntrospectableList LauncherModel::GetIntrospectableChildren()
47
47
{
48
48
  int order = 0;
49
 
  introspection_results_.clear();
 
49
  std::list<unity::debug::Introspectable*> children;
50
50
 
51
 
  for (auto icon : _inner)
 
51
  for (auto const& icon : _inner)
 
52
  {
52
53
    if (!icon->removed)
53
54
    {
54
55
      icon->SetOrder(++order);
55
 
      introspection_results_.push_back(icon.GetPointer());
 
56
      children.push_back(icon.GetPointer());
56
57
    }
 
58
  }
57
59
 
58
 
  return introspection_results_;
 
60
  return children;
59
61
}
60
62
 
61
63
bool LauncherModel::IconShouldShelf(AbstractLauncherIcon::Ptr const& icon) const