qdbusabstractadaptor.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtDBus module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include "qdbusabstractadaptor.h" -
43#include "qdbusabstractadaptor_p.h" -
44 -
45#include <QtCore/qcoreapplication.h> -
46#include <QtCore/qmetaobject.h> -
47#include <QtCore/qset.h> -
48#include <QtCore/qtimer.h> -
49#include <QtCore/qthread.h> -
50 -
51#include "qdbusconnection.h" -
52 -
53#include "qdbusconnection_p.h" // for qDBusParametersForMethod -
54#include "qdbusmetatype_p.h" -
55 -
56#include <algorithm> -
57 -
58#ifndef QT_NO_DBUS -
59 -
60QT_BEGIN_NAMESPACE -
61 -
62static int cachedRelaySlotMethodIndex = -1; -
63 -
64int QDBusAdaptorConnector::relaySlotMethodIndex() -
65{ -
66 if (cachedRelaySlotMethodIndex == -1) {
evaluated: cachedRelaySlotMethodIndex == -1
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:147
8-147
67 cachedRelaySlotMethodIndex = staticMetaObject.indexOfMethod("relaySlot()");
executed (the execution status of this line is deduced): cachedRelaySlotMethodIndex = staticMetaObject.indexOfMethod("relaySlot()");
-
68 Q_ASSERT(cachedRelaySlotMethodIndex != -1);
executed (the execution status of this line is deduced): qt_noop();
-
69 }
executed: }
Execution Count:8
8
70 return cachedRelaySlotMethodIndex;
executed: return cachedRelaySlotMethodIndex;
Execution Count:155
155
71} -
72 -
73QDBusAdaptorConnector *qDBusFindAdaptorConnector(QObject *obj) -
74{ -
75 if (!obj)
partially evaluated: !obj
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:478
0-478
76 return 0;
never executed: return 0;
0
77 const QObjectList &children = obj->children();
executed (the execution status of this line is deduced): const QObjectList &children = obj->children();
-
78 QObjectList::ConstIterator it = children.constBegin();
executed (the execution status of this line is deduced): QObjectList::ConstIterator it = children.constBegin();
-
79 QObjectList::ConstIterator end = children.constEnd();
executed (the execution status of this line is deduced): QObjectList::ConstIterator end = children.constEnd();
-
80 for ( ; it != end; ++it) {
evaluated: it != end
TRUEFALSE
yes
Evaluation Count:854
yes
Evaluation Count:69
69-854
81 QDBusAdaptorConnector *connector = qobject_cast<QDBusAdaptorConnector *>(*it);
executed (the execution status of this line is deduced): QDBusAdaptorConnector *connector = qobject_cast<QDBusAdaptorConnector *>(*it);
-
82 if (connector) {
evaluated: connector
TRUEFALSE
yes
Evaluation Count:409
yes
Evaluation Count:445
409-445
83 connector->polish();
executed (the execution status of this line is deduced): connector->polish();
-
84 return connector;
executed: return connector;
Execution Count:409
409
85 } -
86 }
executed: }
Execution Count:445
445
87 return 0;
executed: return 0;
Execution Count:69
69
88} -
89 -
90QDBusAdaptorConnector *qDBusFindAdaptorConnector(QDBusAbstractAdaptor *adaptor) -
91{ -
92 return qDBusFindAdaptorConnector(adaptor->parent());
never executed: return qDBusFindAdaptorConnector(adaptor->parent());
0
93} -
94 -
95QDBusAdaptorConnector *qDBusCreateAdaptorConnector(QObject *obj) -
96{ -
97 QDBusAdaptorConnector *connector = qDBusFindAdaptorConnector(obj);
executed (the execution status of this line is deduced): QDBusAdaptorConnector *connector = qDBusFindAdaptorConnector(obj);
-
98 if (connector)
evaluated: connector
TRUEFALSE
yes
Evaluation Count:114
yes
Evaluation Count:69
69-114
99 return connector;
executed: return connector;
Execution Count:114
114
100 return new QDBusAdaptorConnector(obj);
executed: return new QDBusAdaptorConnector(obj);
Execution Count:69
69
101} -
102 -
103QString QDBusAbstractAdaptorPrivate::retrieveIntrospectionXml(QDBusAbstractAdaptor *adaptor) -
104{ -
105 return adaptor->d_func()->xml;
executed: return adaptor->d_func()->xml;
Execution Count:73
73
106} -
107 -
108void QDBusAbstractAdaptorPrivate::saveIntrospectionXml(QDBusAbstractAdaptor *adaptor, -
109 const QString &xml) -
110{ -
111 adaptor->d_func()->xml = xml;
executed (the execution status of this line is deduced): adaptor->d_func()->xml = xml;
-
112}
executed: }
Execution Count:54
54
113 -
114/*! -
115 \class QDBusAbstractAdaptor -
116 \inmodule QtDBus -
117 \since 4.2 -
118 -
119 \brief The QDBusAbstractAdaptor class is the base class of D-Bus adaptor classes. -
120 -
121 The QDBusAbstractAdaptor class is the starting point for all objects intending to provide -
122 interfaces to the external world using D-Bus. This is accomplished by attaching a one or more -
123 classes derived from QDBusAbstractAdaptor to a normal QObject and then registering that QObject -
124 with QDBusConnection::registerObject. QDBusAbstractAdaptor objects are intended to be -
125 light-weight wrappers, mostly just relaying calls into the real object (its parent) and the -
126 signals from it. -
127 -
128 Each QDBusAbstractAdaptor-derived class should define the D-Bus interface it is implementing -
129 using the Q_CLASSINFO macro in the class definition. Note that only one interface can be -
130 exposed in this way. -
131 -
132 QDBusAbstractAdaptor uses the standard QObject mechanism of signals, slots and properties to -
133 determine what signals, methods and properties to export to the bus. Any signal emitted by -
134 QDBusAbstractAdaptor-derived classes will be automatically be relayed through any D-Bus -
135 connections the object is registered on. -
136 -
137 Classes derived from QDBusAbstractAdaptor must be created on the heap using the \a new operator -
138 and must not be deleted by the user (they will be deleted automatically when the object they are -
139 connected to is also deleted). -
140 -
141 \sa {usingadaptors.html}{Using adaptors}, QDBusConnection -
142*/ -
143 -
144/*! -
145 Constructs a QDBusAbstractAdaptor with \a obj as the parent object. -
146*/ -
147QDBusAbstractAdaptor::QDBusAbstractAdaptor(QObject* obj) -
148 : QObject(*new QDBusAbstractAdaptorPrivate, obj) -
149{ -
150 QDBusAdaptorConnector *connector = qDBusCreateAdaptorConnector(obj);
executed (the execution status of this line is deduced): QDBusAdaptorConnector *connector = qDBusCreateAdaptorConnector(obj);
-
151 -
152 connector->waitingForPolish = true;
executed (the execution status of this line is deduced): connector->waitingForPolish = true;
-
153 QMetaObject::invokeMethod(connector, "polish", Qt::QueuedConnection);
executed (the execution status of this line is deduced): QMetaObject::invokeMethod(connector, "polish", Qt::QueuedConnection);
-
154}
executed: }
Execution Count:111
111
155 -
156/*! -
157 Destroys the adaptor. -
158 -
159 \warning Adaptors are destroyed automatically when the real object they refer to is -
160 destroyed. Do not delete the adaptors yourself. -
161*/ -
162QDBusAbstractAdaptor::~QDBusAbstractAdaptor() -
163{ -
164} -
165 -
166/*! -
167 Toggles automatic signal relaying from the real object (see object()). -
168 -
169 Automatic signal relaying consists of signal-to-signal connection of the signals on the parent -
170 that have the exact same method signatue in both classes. -
171 -
172 If \a enable is set to true, connect the signals; if set to false, disconnect all signals. -
173*/ -
174void QDBusAbstractAdaptor::setAutoRelaySignals(bool enable) -
175{ -
176 const QMetaObject *us = metaObject();
executed (the execution status of this line is deduced): const QMetaObject *us = metaObject();
-
177 const QMetaObject *them = parent()->metaObject();
executed (the execution status of this line is deduced): const QMetaObject *them = parent()->metaObject();
-
178 bool connected = false;
executed (the execution status of this line is deduced): bool connected = false;
-
179 for (int idx = staticMetaObject.methodCount(); idx < us->methodCount(); ++idx) {
evaluated: idx < us->methodCount()
TRUEFALSE
yes
Evaluation Count:316
yes
Evaluation Count:62
62-316
180 QMetaMethod mm = us->method(idx);
executed (the execution status of this line is deduced): QMetaMethod mm = us->method(idx);
-
181 -
182 if (mm.methodType() != QMetaMethod::Signal)
evaluated: mm.methodType() != QMetaMethod::Signal
TRUEFALSE
yes
Evaluation Count:182
yes
Evaluation Count:134
134-182
183 continue;
executed: continue;
Execution Count:182
182
184 -
185 // try to connect/disconnect to a signal on the parent that has the same method signature -
186 QByteArray sig = QMetaObject::normalizedSignature(mm.methodSignature().constData());
executed (the execution status of this line is deduced): QByteArray sig = QMetaObject::normalizedSignature(mm.methodSignature().constData());
-
187 if (them->indexOfSignal(sig) == -1)
partially evaluated: them->indexOfSignal(sig) == -1
TRUEFALSE
yes
Evaluation Count:134
no
Evaluation Count:0
0-134
188 continue;
executed: continue;
Execution Count:134
134
189 sig.prepend(QSIGNAL_CODE + '0');
never executed (the execution status of this line is deduced): sig.prepend(2 + '0');
-
190 parent()->disconnect(sig, this, sig);
never executed (the execution status of this line is deduced): parent()->disconnect(sig, this, sig);
-
191 if (enable)
never evaluated: enable
0
192 connected = connect(parent(), sig, sig) || connected;
never executed: connected = connect(parent(), sig, sig) || connected;
never evaluated: connect(parent(), sig, sig)
never evaluated: connected
0
193 }
never executed: }
0
194 d_func()->autoRelaySignals = connected;
executed (the execution status of this line is deduced): d_func()->autoRelaySignals = connected;
-
195}
executed: }
Execution Count:62
62
196 -
197/*! -
198 Returns true if automatic signal relaying from the real object (see object()) is enabled, -
199 otherwiser returns false. -
200 -
201 \sa setAutoRelaySignals() -
202*/ -
203bool QDBusAbstractAdaptor::autoRelaySignals() const -
204{ -
205 return d_func()->autoRelaySignals;
never executed: return d_func()->autoRelaySignals;
0
206} -
207 -
208QDBusAdaptorConnector::QDBusAdaptorConnector(QObject *obj) -
209 : QObject(obj), waitingForPolish(false) -
210{ -
211}
executed: }
Execution Count:69
69
212 -
213QDBusAdaptorConnector::~QDBusAdaptorConnector() -
214{ -
215} -
216 -
217void QDBusAdaptorConnector::addAdaptor(QDBusAbstractAdaptor *adaptor) -
218{ -
219 // find the interface name -
220 const QMetaObject *mo = adaptor->metaObject();
executed (the execution status of this line is deduced): const QMetaObject *mo = adaptor->metaObject();
-
221 int ciid = mo->indexOfClassInfo(QCLASSINFO_DBUS_INTERFACE);
executed (the execution status of this line is deduced): int ciid = mo->indexOfClassInfo("D-Bus Interface");
-
222 if (ciid != -1) {
evaluated: ciid != -1
TRUEFALSE
yes
Evaluation Count:223
yes
Evaluation Count:62
62-223
223 QMetaClassInfo mci = mo->classInfo(ciid);
executed (the execution status of this line is deduced): QMetaClassInfo mci = mo->classInfo(ciid);
-
224 if (*mci.value()) {
partially evaluated: *mci.value()
TRUEFALSE
yes
Evaluation Count:223
no
Evaluation Count:0
0-223
225 // find out if this interface exists first -
226 const char *interface = mci.value();
executed (the execution status of this line is deduced): const char *interface = mci.value();
-
227 AdaptorMap::Iterator it = std::lower_bound(adaptors.begin(), adaptors.end(),
executed (the execution status of this line is deduced): AdaptorMap::Iterator it = std::lower_bound(adaptors.begin(), adaptors.end(),
-
228 QByteArray(interface));
executed (the execution status of this line is deduced): QByteArray(interface));
-
229 if (it != adaptors.end() && qstrcmp(interface, it->interface) == 0) {
evaluated: it != adaptors.end()
TRUEFALSE
yes
Evaluation Count:174
yes
Evaluation Count:49
evaluated: qstrcmp(interface, it->interface) == 0
TRUEFALSE
yes
Evaluation Count:112
yes
Evaluation Count:62
49-174
230 // exists. Replace it (though it's probably the same) -
231 if (it->adaptor != adaptor) {
partially evaluated: it->adaptor != adaptor
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:112
0-112
232 // reconnect the signals -
233 disconnectAllSignals(it->adaptor);
never executed (the execution status of this line is deduced): disconnectAllSignals(it->adaptor);
-
234 connectAllSignals(adaptor);
never executed (the execution status of this line is deduced): connectAllSignals(adaptor);
-
235 }
never executed: }
0
236 it->adaptor = adaptor;
executed (the execution status of this line is deduced): it->adaptor = adaptor;
-
237 } else {
executed: }
Execution Count:112
112
238 // create a new one -
239 AdaptorData entry;
executed (the execution status of this line is deduced): AdaptorData entry;
-
240 entry.interface = interface;
executed (the execution status of this line is deduced): entry.interface = interface;
-
241 entry.adaptor = adaptor;
executed (the execution status of this line is deduced): entry.adaptor = adaptor;
-
242 adaptors << entry;
executed (the execution status of this line is deduced): adaptors << entry;
-
243 -
244 // connect the adaptor's signals to our relaySlot slot -
245 connectAllSignals(adaptor);
executed (the execution status of this line is deduced): connectAllSignals(adaptor);
-
246 }
executed: }
Execution Count:111
111
247 } -
248 }
executed: }
Execution Count:223
223
249}
executed: }
Execution Count:285
285
250 -
251void QDBusAdaptorConnector::disconnectAllSignals(QObject *obj) -
252{ -
253 QMetaObject::disconnect(obj, -1, this, relaySlotMethodIndex());
executed (the execution status of this line is deduced): QMetaObject::disconnect(obj, -1, this, relaySlotMethodIndex());
-
254}
executed: }
Execution Count:22
22
255 -
256void QDBusAdaptorConnector::connectAllSignals(QObject *obj) -
257{ -
258 QMetaObject::connect(obj, -1, this, relaySlotMethodIndex(), Qt::DirectConnection);
executed (the execution status of this line is deduced): QMetaObject::connect(obj, -1, this, relaySlotMethodIndex(), Qt::DirectConnection);
-
259}
executed: }
Execution Count:133
133
260 -
261void QDBusAdaptorConnector::polish() -
262{ -
263 if (!waitingForPolish)
evaluated: !waitingForPolish
TRUEFALSE
yes
Evaluation Count:337
yes
Evaluation Count:111
111-337
264 return; // avoid working multiple times if multiple adaptors were added
executed: return;
Execution Count:337
337
265 -
266 waitingForPolish = false;
executed (the execution status of this line is deduced): waitingForPolish = false;
-
267 const QObjectList &objs = parent()->children();
executed (the execution status of this line is deduced): const QObjectList &objs = parent()->children();
-
268 QObjectList::ConstIterator it = objs.constBegin();
executed (the execution status of this line is deduced): QObjectList::ConstIterator it = objs.constBegin();
-
269 QObjectList::ConstIterator end = objs.constEnd();
executed (the execution status of this line is deduced): QObjectList::ConstIterator end = objs.constEnd();
-
270 for ( ; it != end; ++it) {
evaluated: it != end
TRUEFALSE
yes
Evaluation Count:396
yes
Evaluation Count:111
111-396
271 QDBusAbstractAdaptor *adaptor = qobject_cast<QDBusAbstractAdaptor *>(*it);
executed (the execution status of this line is deduced): QDBusAbstractAdaptor *adaptor = qobject_cast<QDBusAbstractAdaptor *>(*it);
-
272 if (adaptor)
evaluated: adaptor
TRUEFALSE
yes
Evaluation Count:285
yes
Evaluation Count:111
111-285
273 addAdaptor(adaptor);
executed: addAdaptor(adaptor);
Execution Count:285
285
274 }
executed: }
Execution Count:396
396
275 -
276 // sort the adaptor list -
277 qSort(adaptors);
executed (the execution status of this line is deduced): qSort(adaptors);
-
278}
executed: }
Execution Count:111
111
279 -
280void QDBusAdaptorConnector::relaySlot(void **argv) -
281{ -
282 relay(sender(), senderSignalIndex(), argv);
executed (the execution status of this line is deduced): relay(sender(), senderSignalIndex(), argv);
-
283}
executed: }
Execution Count:161
161
284 -
285void QDBusAdaptorConnector::relay(QObject *senderObj, int lastSignalIdx, void **argv) -
286{ -
287 if (lastSignalIdx < QObject::staticMetaObject.methodCount())
evaluated: lastSignalIdx < QObject::staticMetaObject.methodCount()
TRUEFALSE
yes
Evaluation Count:69
yes
Evaluation Count:92
69-92
288 // QObject signal (destroyed(QObject *)) -- ignore -
289 return;
executed: return;
Execution Count:69
69
290 -
291 const QMetaObject *senderMetaObject = senderObj->metaObject();
executed (the execution status of this line is deduced): const QMetaObject *senderMetaObject = senderObj->metaObject();
-
292 QMetaMethod mm = senderMetaObject->method(lastSignalIdx);
executed (the execution status of this line is deduced): QMetaMethod mm = senderMetaObject->method(lastSignalIdx);
-
293 -
294 QObject *realObject = senderObj;
executed (the execution status of this line is deduced): QObject *realObject = senderObj;
-
295 if (qobject_cast<QDBusAbstractAdaptor *>(senderObj))
evaluated: qobject_cast<QDBusAbstractAdaptor *>(senderObj)
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:44
44-48
296 // it's an adaptor, so the real object is in fact its parent -
297 realObject = realObject->parent();
executed: realObject = realObject->parent();
Execution Count:48
48
298 -
299 // break down the parameter list -
300 QVector<int> types;
executed (the execution status of this line is deduced): QVector<int> types;
-
301 int inputCount = qDBusParametersForMethod(mm, types);
executed (the execution status of this line is deduced): int inputCount = qDBusParametersForMethod(mm, types);
-
302 if (inputCount == -1)
partially evaluated: inputCount == -1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:92
0-92
303 // invalid signal signature -
304 // qDBusParametersForMethod has already complained -
305 return;
never executed: return;
0
306 if (inputCount + 1 != types.count() ||
partially evaluated: inputCount + 1 != types.count()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:92
0-92
307 types.at(inputCount) == QDBusMetaTypeId::message()) {
partially evaluated: types.at(inputCount) == QDBusMetaTypeId::message()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:92
0-92
308 // invalid signal signature -
309 // qDBusParametersForMethod has not yet complained about this one -
310 qWarning("QDBusAbstractAdaptor: Cannot relay signal %s::%s",
never executed (the execution status of this line is deduced): QMessageLogger("qdbusabstractadaptor.cpp", 310, __PRETTY_FUNCTION__).warning("QDBusAbstractAdaptor: Cannot relay signal %s::%s",
-
311 senderMetaObject->className(), mm.methodSignature().constData());
never executed (the execution status of this line is deduced): senderMetaObject->className(), mm.methodSignature().constData());
-
312 return;
never executed: return;
0
313 } -
314 -
315 QVariantList args;
executed (the execution status of this line is deduced): QVariantList args;
-
316 for (int i = 1; i < types.count(); ++i)
evaluated: i < types.count()
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:92
48-92
317 args << QVariant(types.at(i), argv[i]);
executed: args << QVariant(types.at(i), argv[i]);
Execution Count:48
48
318 -
319 // now emit the signal with all the information -
320 emit relaySignal(realObject, senderMetaObject, lastSignalIdx, args);
executed (the execution status of this line is deduced): relaySignal(realObject, senderMetaObject, lastSignalIdx, args);
-
321}
executed: }
Execution Count:92
92
322 -
323// our Meta Object -
324// modify carefully: this has been hand-edited! -
325// the relaySlot slot gets called with the void** array -
326 -
327struct qt_meta_stringdata_QDBusAdaptorConnector_t { -
328 QByteArrayData data[10]; -
329 char stringdata[96]; -
330}; -
331#define QT_MOC_LITERAL(idx, ofs, len) \ -
332 Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ -
333 offsetof(qt_meta_stringdata_QDBusAdaptorConnector_t, stringdata) + ofs \ -
334 - idx * sizeof(QByteArrayData) \ -
335 ) -
336static const qt_meta_stringdata_QDBusAdaptorConnector_t qt_meta_stringdata_QDBusAdaptorConnector = { -
337 { -
338QT_MOC_LITERAL(0, 0, 21), -
339QT_MOC_LITERAL(1, 22, 11), -
340QT_MOC_LITERAL(2, 34, 0), -
341QT_MOC_LITERAL(3, 35, 3), -
342QT_MOC_LITERAL(4, 39, 18), -
343QT_MOC_LITERAL(5, 58, 10), -
344QT_MOC_LITERAL(6, 69, 3), -
345QT_MOC_LITERAL(7, 73, 4), -
346QT_MOC_LITERAL(8, 78, 9), -
347QT_MOC_LITERAL(9, 88, 6) -
348 }, -
349 "QDBusAdaptorConnector\0relaySignal\0\0" -
350 "obj\0const QMetaObject*\0metaObject\0sid\0" -
351 "args\0relaySlot\0polish\0" -
352}; -
353#undef QT_MOC_LITERAL -
354 -
355static const uint qt_meta_data_QDBusAdaptorConnector[] = { -
356 -
357 // content: -
358 7, // revision -
359 0, // classname -
360 0, 0, // classinfo -
361 3, 14, // methods -
362 0, 0, // properties -
363 0, 0, // enums/sets -
364 0, 0, // constructors -
365 0, // flags -
366 1, // signalCount -
367 -
368 // signals: name, argc, parameters, tag, flags -
369 1, 4, 29, 2, 0x05, -
370 -
371 // slots: name, argc, parameters, tag, flags -
372 8, 0, 38, 2, 0x0a, -
373 9, 0, 39, 2, 0x0a, -
374 -
375 // signals: parameters -
376 QMetaType::Void, QMetaType::QObjectStar, 0x80000000 | 4, QMetaType::Int, QMetaType::QVariantList, 3, 5, 6, 7, -
377 -
378 // slots: parameters -
379 QMetaType::Void, -
380 QMetaType::Void, -
381 -
382 0 // eod -
383}; -
384 -
385void QDBusAdaptorConnector::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) -
386{ -
387 if (_c == QMetaObject::InvokeMetaMethod) { -
388 Q_ASSERT(staticMetaObject.cast(_o)); -
389 QDBusAdaptorConnector *_t = static_cast<QDBusAdaptorConnector *>(_o); -
390 switch (_id) { -
391 case 0: _t->relaySignal((*reinterpret_cast< QObject*(*)>(_a[1])),(*reinterpret_cast< const QMetaObject*(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])),(*reinterpret_cast< const QVariantList(*)>(_a[4]))); break; -
392 case 1: _t->relaySlot(_a); break; // HAND EDIT: add the _a parameter -
393 case 2: _t->polish(); break; -
394 default: ; -
395 } -
396 } -
397} -
398 -
399const QMetaObject QDBusAdaptorConnector::staticMetaObject = { -
400 { &QObject::staticMetaObject, qt_meta_stringdata_QDBusAdaptorConnector.data, -
401 qt_meta_data_QDBusAdaptorConnector, qt_static_metacall, 0, 0 } -
402}; -
403 -
404const QMetaObject *QDBusAdaptorConnector::metaObject() const -
405{ -
406 return &staticMetaObject; -
407} -
408 -
409void *QDBusAdaptorConnector::qt_metacast(const char *_clname) -
410{ -
411 if (!_clname) return 0; -
412 if (!strcmp(_clname, qt_meta_stringdata_QDBusAdaptorConnector.stringdata)) -
413 return static_cast<void*>(const_cast< QDBusAdaptorConnector*>(this)); -
414 return QObject::qt_metacast(_clname); -
415} -
416 -
417int QDBusAdaptorConnector::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -
418{ -
419 _id = QObject::qt_metacall(_c, _id, _a); -
420 if (_id < 0) -
421 return _id; -
422 if (_c == QMetaObject::InvokeMetaMethod) { -
423 if (_id < 3) -
424 qt_static_metacall(this, _c, _id, _a); -
425 _id -= 3; -
426 } -
427 return _id; -
428} -
429 -
430// SIGNAL 0 -
431void QDBusAdaptorConnector::relaySignal(QObject * _t1, const QMetaObject * _t2, int _t3, const QVariantList & _t4) -
432{ -
433 void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)), const_cast<void*>(reinterpret_cast<const void*>(&_t3)), const_cast<void*>(reinterpret_cast<const void*>(&_t4)) };
executed (the execution status of this line is deduced): void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)), const_cast<void*>(reinterpret_cast<const void*>(&_t3)), const_cast<void*>(reinterpret_cast<const void*>(&_t4)) };
-
434 QMetaObject::activate(this, &staticMetaObject, 0, _a);
executed (the execution status of this line is deduced): QMetaObject::activate(this, &staticMetaObject, 0, _a);
-
435}
executed: }
Execution Count:92
92
436 -
437QT_END_NAMESPACE -
438 -
439#endif // QT_NO_DBUS -
440 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial