~phablet-team/dbus-cpp/15.04

« back to all changes in this revision

Viewing changes to src/core/dbus/service_watcher.cpp

  • Committer: CI Train Bot
  • Author(s): Manuel de la Pena
  • Date: 2015-10-20 10:55:08 UTC
  • mfrom: (97.1.4 name-acquired)
  • Revision ID: ci-train-bot@canonical.com-20151020105508-9yotjo05qtzm5igb
Ensure that the signals are correctly emitted for when the services appear and go.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        const std::string& old_owner(std::get<1>(args));
49
49
        const std::string& new_owner(std::get<2>(args));
50
50
 
 
51
 
 
52
        if (old_owner.empty() && !new_owner.empty())
 
53
        {
 
54
            service_registered();
 
55
        }
 
56
 
 
57
        if (!old_owner.empty() && new_owner.empty())
 
58
        {
 
59
            service_unregistered();
 
60
        }
 
61
 
51
62
        owner_changed(old_owner, new_owner);
52
 
 
53
 
        if (new_owner.empty())
54
 
        {
55
 
            service_unregistered();
56
 
        }
57
 
        else
58
 
        {
59
 
            service_registered();
60
 
        }
61
63
    }
62
64
 
63
65
    core::Signal<std::string, std::string> owner_changed;