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

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/UBusWrapper.cpp

  • Committer: Neil Jagdish Patel
  • Date: 2011-09-05 14:00:26 UTC
  • mto: (55.359.876 unity)
  • mto: This revision was merged to the branch mainline in revision 558.
  • Revision ID: neil.patel@canonical.com-20110905140026-hkc3myq0ka5l5kp6
Change DashController to load lazily, clean up some bits and pieces

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
{
39
39
  UBusConnection::Ptr connection (new UBusConnection());
40
40
  connection->manager = this;
 
41
  connection->name = interest_name;
41
42
  connection->slot = slot;
42
43
  connection->id = ubus_server_register_interest(server_,
43
44
                                                 interest_name.c_str(),
46
47
  connections_.push_back(connection);
47
48
}
48
49
 
 
50
void UBusManager::UnregisterInterest(std::string const& interest_name)
 
51
{
 
52
  for (auto it = connections_.begin(); it != connections_.end(); ++it)
 
53
  {
 
54
    if ((*it)->name == interest_name)
 
55
    {
 
56
      ubus_server_unregister_interest(server_, (*it)->id);
 
57
      connections_.erase(it);
 
58
      break;
 
59
    }
 
60
  }
 
61
}
 
62
 
49
63
void UBusManager::OnCallback(GVariant* args, gpointer user_data)
50
64
{
51
65
  UBusConnection* connection = static_cast<UBusConnection*>(user_data);