Merge lp:~mzanetti/autopilot-qt/marshalling-fix into lp:autopilot-qt

Proposed by Michael Zanetti
Status: Merged
Approved by: Juhapekka Piiroinen
Approved revision: 36
Merged at revision: 25
Proposed branch: lp:~mzanetti/autopilot-qt/marshalling-fix
Merge into: lp:autopilot-qt
Diff against target: 31 lines (+12/-5)
1 file modified
lib/dbus_object.cpp (+12/-5)
To merge this branch: bzr merge lp:~mzanetti/autopilot-qt/marshalling-fix
Reviewer Review Type Date Requested Status
Juhapekka Piiroinen (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+131428@code.launchpad.net

Commit message

Don't try to marshall signal arguments of type QObject*

Marshalling a pointer through DBus makes no sense as its just an address to protected memory
Marshalling a QObject (without pointer) is not possible because of QObjects no-copy-nature

Removing the argument at least lets the signal itself pass through DBus

Description of the change

Don't try to marshall signal arguments of type QObject*

Marshalling a pointer through DBus makes no sense as its just an address to protected memory
Marshalling a QObject (without pointer) is not possible because of QObjects no-copy-nature

Removing the argument at least lets the signal itself pass through DBus

To post a comment you must log in.
36. By Michael Zanetti

remove leftover qDebug from testing

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Juhapekka Piiroinen (juhapekka-piiroinen) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/dbus_object.cpp'
2--- lib/dbus_object.cpp 2012-10-09 13:31:48 +0000
3+++ lib/dbus_object.cpp 2012-10-25 15:10:24 +0000
4@@ -94,15 +94,22 @@
5 {
6 SignalSpyPtr signal_spy = signal_watchers_[signal];
7 QList<QVariant> signal_emit_list;
8- qDebug() << "Signal emissionss" << *signal_spy;
9+ qDebug() << "Signal emissions" << signal_spy.data()->length() << signal_spy.data();
10 for (int i = 0; i < signal_spy->length(); ++i)
11 {
12- QList<QVariant> signal_emission = signal_spy->at(i);
13- qDebug() << "Packing" << signal_emission << "Into QVariant";
14+ QList<QVariant> signal_emission;
15+ foreach(const QVariant &arg, signal_spy->at(i)) {
16+
17+ // We cannot marshall QObject* or QObject:
18+ // Marshalling a pointer through DBus makes no sense as its just an address to protected memory
19+ // Marshalling a QObject (without pointer) is not possible because of QObjects no-copy-nature
20+ if((int)arg.type() != (int)QMetaType::QObjectStar) {
21+ signal_emission.append(arg);
22+ }
23+ }
24+
25 signal_emit_list.append(QVariant(signal_emission));
26 }
27-
28- qDebug() << "Packing" << signal_emit_list << "into DBus reply.";
29 reply << QVariant(signal_emit_list);
30 }
31 else

Subscribers

People subscribed via source and target branches