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
=== modified file 'src/core/dbus/message.cpp'
--- src/core/dbus/message.cpp 2014-04-01 09:14:20 +0000
+++ src/core/dbus/message.cpp 2015-07-21 18:32:56 +0000
@@ -298,7 +298,7 @@
298298
299void Message::Writer::push_boolean(bool value)299void Message::Writer::push_boolean(bool value)
300{300{
301 dbus_bool_t bool_value = value ? TRUE : FALSE;301 auto bool_value = value ? TRUE : FALSE;
302302
303 if (!dbus_message_iter_append_basic(303 if (!dbus_message_iter_append_basic(
304 std::addressof(d->iter),304 std::addressof(d->iter),
305305
=== modified file 'src/core/dbus/service_watcher.cpp'
--- src/core/dbus/service_watcher.cpp 2014-01-30 17:47:19 +0000
+++ src/core/dbus/service_watcher.cpp 2015-07-21 18:32:56 +0000
@@ -48,16 +48,18 @@
48 const std::string& old_owner(std::get<1>(args));48 const std::string& old_owner(std::get<1>(args));
49 const std::string& new_owner(std::get<2>(args));49 const std::string& new_owner(std::get<2>(args));
5050
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 owner_changed(old_owner, new_owner);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 }
6264
63 core::Signal<std::string, std::string> owner_changed;65 core::Signal<std::string, std::string> owner_changed;

Subscribers

People subscribed via source and target branches