Merge lp:~mandel/dbus-cpp/name-acquired into lp:dbus-cpp

Proposed by Manuel de la Peña
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: 98
Merged at revision: 100
Proposed branch: lp:~mandel/dbus-cpp/name-acquired
Merge into: lp:dbus-cpp
Diff against target: 44 lines (+12/-10)
2 files modified
src/core/dbus/message.cpp (+1/-1)
src/core/dbus/service_watcher.cpp (+11/-9)
To merge this branch: bzr merge lp:~mandel/dbus-cpp/name-acquired
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Alfonso Sanchez-Beato Approve
Review via email: mp+262955@code.launchpad.net

Commit message

Ensure that the signals are correctly emitted for when the services appear and go.

Description of the change

Ensure that the signals are correctly emitted for when the services appear and go.

To post a comment you must log in.
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~mandel/dbus-cpp/name-acquired updated
99. By Manuel de la Peña

No need to add that extra step in the push_boolean method.

100. By Manuel de la Peña

Fix tests.

101. By Manuel de la Peña

Auto does the right thing and allows to pass the correct value.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/core/dbus/message.cpp'
2--- src/core/dbus/message.cpp 2014-04-01 09:14:20 +0000
3+++ src/core/dbus/message.cpp 2015-07-21 18:32:56 +0000
4@@ -298,7 +298,7 @@
5
6 void Message::Writer::push_boolean(bool value)
7 {
8- dbus_bool_t bool_value = value ? TRUE : FALSE;
9+ auto bool_value = value ? TRUE : FALSE;
10
11 if (!dbus_message_iter_append_basic(
12 std::addressof(d->iter),
13
14=== modified file 'src/core/dbus/service_watcher.cpp'
15--- src/core/dbus/service_watcher.cpp 2014-01-30 17:47:19 +0000
16+++ src/core/dbus/service_watcher.cpp 2015-07-21 18:32:56 +0000
17@@ -48,16 +48,18 @@
18 const std::string& old_owner(std::get<1>(args));
19 const std::string& new_owner(std::get<2>(args));
20
21+
22+ if (old_owner.empty() && !new_owner.empty())
23+ {
24+ service_registered();
25+ }
26+
27+ if (!old_owner.empty() && new_owner.empty())
28+ {
29+ service_unregistered();
30+ }
31+
32 owner_changed(old_owner, new_owner);
33-
34- if (new_owner.empty())
35- {
36- service_unregistered();
37- }
38- else
39- {
40- service_registered();
41- }
42 }
43
44 core::Signal<std::string, std::string> owner_changed;

Subscribers

People subscribed via source and target branches