qdbusinterface.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/dbus/qdbusinterface.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10static void copyArgument(void *to, int id, const QVariant &arg)-
11{-
12 if (id == arg.userType()
id == arg.userType()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
) {
4-12
13 switch (id) {-
14 case
never executed: case QVariant::Bool:
QVariant::Bool:
never executed: case QVariant::Bool:
0
15 *reinterpret_cast<bool *>(to) = arg.toBool();-
16 return;
never executed: return;
0
17-
18 case
never executed: case QMetaType::UChar:
QMetaType::UChar:
never executed: case QMetaType::UChar:
0
19 *reinterpret_cast<uchar *>(to) = arg.value<uchar>();-
20 return;
never executed: return;
0
21-
22 case
never executed: case QMetaType::Short:
QMetaType::Short:
never executed: case QMetaType::Short:
0
23 *reinterpret_cast<short *>(to) = arg.value<short>();-
24 return;
never executed: return;
0
25-
26 case
never executed: case QMetaType::UShort:
QMetaType::UShort:
never executed: case QMetaType::UShort:
0
27 *reinterpret_cast<ushort *>(to) = arg.value<ushort>();-
28 return;
never executed: return;
0
29-
30 case
never executed: case QVariant::Int:
QVariant::Int:
never executed: case QVariant::Int:
0
31 *reinterpret_cast<int *>(to) = arg.toInt();-
32 return;
never executed: return;
0
33-
34 case
never executed: case QVariant::UInt:
QVariant::UInt:
never executed: case QVariant::UInt:
0
35 *reinterpret_cast<uint *>(to) = arg.toUInt();-
36 return;
never executed: return;
0
37-
38 case
never executed: case QVariant::LongLong:
QVariant::LongLong:
never executed: case QVariant::LongLong:
0
39 *reinterpret_cast<qlonglong *>(to) = arg.toLongLong();-
40 return;
never executed: return;
0
41-
42 case
never executed: case QVariant::ULongLong:
QVariant::ULongLong:
never executed: case QVariant::ULongLong:
0
43 *reinterpret_cast<qulonglong *>(to) = arg.toULongLong();-
44 return;
never executed: return;
0
45-
46 case
never executed: case QVariant::Double:
QVariant::Double:
never executed: case QVariant::Double:
0
47 *reinterpret_cast<double *>(to) = arg.toDouble();-
48 return;
never executed: return;
0
49-
50 case
never executed: case QVariant::String:
QVariant::String:
never executed: case QVariant::String:
0
51 *reinterpret_cast<QString *>(to) = arg.toString();-
52 return;
never executed: return;
0
53-
54 case
never executed: case QVariant::ByteArray:
QVariant::ByteArray:
never executed: case QVariant::ByteArray:
0
55 *reinterpret_cast<QByteArray *>(to) = arg.toByteArray();-
56 return;
never executed: return;
0
57-
58 case
never executed: case QVariant::StringList:
QVariant::StringList:
never executed: case QVariant::StringList:
0
59 *reinterpret_cast<QStringList *>(to) = arg.toStringList();-
60 return;
never executed: return;
0
61 }-
62-
63 if (id == QDBusMetaTypeId::variant()
id == QDBusMet...eId::variant()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
) {
0-12
64 *reinterpret_cast<QDBusVariant *>(to) = arg.value<QDBusVariant>();-
65 return;
executed 12 times by 1 test: return;
Executed by:
  • tst_qdbusinterface - unknown status
12
66 } else if (id == QDBusMetaTypeId::objectpath()
id == QDBusMet...::objectpath()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
67 *reinterpret_cast<QDBusObjectPath *>(to) = arg.value<QDBusObjectPath>();-
68 return;
never executed: return;
0
69 } else if (id == QDBusMetaTypeId::signature()
id == QDBusMet...d::signature()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
70 *reinterpret_cast<QDBusSignature *>(to) = arg.value<QDBusSignature>();-
71 return;
never executed: return;
0
72 }-
73-
74-
75-
76 QMessageLogger(__FILE__, 120, __PRETTY_FUNCTION__).fatal("Found a decoded basic type in a D-Bus reply that shouldn't be there");-
77 }
never executed: end of block
0
78-
79-
80 if (arg.userType() != QDBusMetaTypeId::argument()
arg.userType()...Id::argument()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
) {
0-4
81-
82-
83 return;
never executed: return;
0
84 }-
85-
86-
87 const char *userSignature = QDBusMetaType::typeToSignature(id);-
88 if (!userSignature
!userSignatureDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
|| !*userSignature
!*userSignatureDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
) {
0-4
89-
90-
91 return;
never executed: return;
0
92 }-
93-
94-
95 QDBusArgument dbarg = arg.value<QDBusArgument>();-
96 if (dbarg.currentSignature() != QLatin1String(userSignature)
dbarg.currentS...userSignature)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
) {
0-4
97-
98-
99 return;
never executed: return;
0
100 }-
101-
102-
103 QDBusMetaType::demarshall(dbarg, id, to);-
104}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qdbusinterface - unknown status
4
105-
106QDBusInterfacePrivate::QDBusInterfacePrivate(const QString &serv, const QString &p,-
107 const QString &iface, const QDBusConnection &con)-
108 : QDBusAbstractInterfacePrivate(serv, p, iface, con, true), metaObject(0)-
109{-
110-
111 if (connection.isConnected()
connection.isConnected()Description
TRUEevaluated 131 times by 12 tests
Evaluated by:
  • tst_QSystemTrayIcon
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
) {
4-131
112 metaObject = connectionPrivate()->findMetaObject(service, path, interface, lastError);-
113-
114 if (!metaObject
!metaObjectDescription
TRUEevaluated 41 times by 3 tests
Evaluated by:
  • tst_QSystemTrayIcon
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
FALSEevaluated 90 times by 11 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
) {
41-90
115-
116-
117-
118-
119 if (!lastError.isValid()
!lastError.isValid()Description
TRUEnever evaluated
FALSEevaluated 41 times by 3 tests
Evaluated by:
  • tst_QSystemTrayIcon
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
)
0-41
120 lastError = QDBusError(QDBusError::InternalError, QLatin1String("Unknown error"));
never executed: lastError = QDBusError(QDBusError::InternalError, QLatin1String("Unknown error"));
0
121 }
executed 41 times by 3 tests: end of block
Executed by:
  • tst_QSystemTrayIcon
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
41
122 }
executed 131 times by 12 tests: end of block
Executed by:
  • tst_QSystemTrayIcon
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
131
123}
executed 135 times by 12 tests: end of block
Executed by:
  • tst_QSystemTrayIcon
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
135
124-
125QDBusInterfacePrivate::~QDBusInterfacePrivate()-
126{-
127 if (metaObject
metaObjectDescription
TRUEevaluated 90 times by 11 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
FALSEevaluated 45 times by 5 tests
Evaluated by:
  • tst_QSystemTrayIcon
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
&& !metaObject->cached
!metaObject->cachedDescription
TRUEevaluated 42 times by 7 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
FALSEevaluated 48 times by 6 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
)
42-90
128 delete metaObject;
executed 42 times by 7 tests: delete metaObject;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
42
129}
executed 135 times by 12 tests: end of block
Executed by:
  • tst_QSystemTrayIcon
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
135
130QDBusInterface::QDBusInterface(const QString &service, const QString &path, const QString &interface,-
131 const QDBusConnection &connection, QObject *parent)-
132 : QDBusAbstractInterface(*new QDBusInterfacePrivate(service, path, interface, connection),-
133 parent)-
134{-
135}
executed 135 times by 12 tests: end of block
Executed by:
  • tst_QSystemTrayIcon
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
135
136-
137-
138-
139-
140QDBusInterface::~QDBusInterface()-
141{-
142-
143}-
144-
145-
146-
147-
148-
149const QMetaObject *QDBusInterface::metaObject() const-
150{-
151 return d_func()->metaObject ? d_func()->metaObject : &QDBusAbstractInterface::staticMetaObject;-
152}-
153-
154-
155-
156-
157-
158void *QDBusInterface::qt_metacast(const char *_clname)-
159{-
160 if (!_clname) return 0;-
161 if (!strcmp(_clname, "QDBusInterface"))-
162 return static_cast<void*>(const_cast<QDBusInterface*>(this));-
163 if (d_func()->interface.toLatin1() == _clname)-
164 return static_cast<void*>(const_cast<QDBusInterface*>(this));-
165 return QDBusAbstractInterface::qt_metacast(_clname);-
166}-
167-
168-
169-
170-
171-
172int QDBusInterface::qt_metacall(QMetaObject::Call _c, int _id, void **_a)-
173{-
174 _id = QDBusAbstractInterface::qt_metacall(_c, _id, _a);-
175 if (_id < 0 || !d_func()->isValid || !d_func()->metaObject)-
176 return _id;-
177 return d_func()->metacall(_c, _id, _a);-
178}-
179-
180int QDBusInterfacePrivate::metacall(QMetaObject::Call c, int id, void **argv)-
181{-
182 QDBusInterface * const q = q_func();-
183-
184 if (c == QMetaObject::InvokeMetaMethod
c == QMetaObje...vokeMetaMethodDescription
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
FALSEnever evaluated
) {
0-28
185 int offset = metaObject->methodOffset();-
186 QMetaMethod mm = metaObject->method(id + offset);-
187-
188 if (mm.methodType() == QMetaMethod::Signal
mm.methodType(...Method::SignalDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
) {
12-16
189-
190 QMetaObject::activate(q, metaObject, id, argv);-
191-
192 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
else if (mm.methodType() == QMetaMethod::Slot
mm.methodType(...taMethod::SlotDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
|| mm.methodType() == QMetaMethod::Method
mm.methodType(...Method::MethodDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-16
193-
194-
195 QString methodName = QString::fromLatin1(mm.name());-
196 const int *inputTypes = metaObject->inputTypesForMethod(id);-
197 int inputTypesCount = *inputTypes;-
198-
199-
200 QVariantList args;-
201 args.reserve(inputTypesCount);-
202 int i = 1;-
203 for ( ; i <= inputTypesCount
i <= inputTypesCountDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
; ++i)
16-20
204 args << QVariant(inputTypes[i], argv[i]);
executed 20 times by 1 test: args << QVariant(inputTypes[i], argv[i]);
Executed by:
  • tst_qdbusinterface - unknown status
20
205-
206-
207 QDBusMessage reply = q->callWithArgumentList(QDBus::Block, methodName, args);-
208-
209 if (reply.type() == QDBusMessage::ReplyMessage
reply.type() =...::ReplyMessageDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
) {
0-16
210-
211 args = reply.arguments();-
212 QVariantList::ConstIterator it = args.constBegin();-
213 const int *outputTypes = metaObject->outputTypesForMethod(id);-
214 int outputTypesCount = *outputTypes++;-
215-
216 if (mm.returnType() != QMetaType::UnknownType
mm.returnType(...e::UnknownTypeDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
&& mm.returnType() != QMetaType::Void
mm.returnType(...MetaType::VoidDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
) {
0-16
217-
218 if (argv[0]
argv[0]Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
&& it != args.constEnd()
it != args.constEnd()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
)
0-12
219 copyArgument(argv[0], *outputTypes++, *it);
executed 12 times by 1 test: copyArgument(argv[0], *outputTypes++, *it);
Executed by:
  • tst_qdbusinterface - unknown status
12
220-
221-
222 --outputTypesCount;-
223 ++it;-
224 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qdbusinterface - unknown status
16
225-
226 for (int j = 0; j < outputTypesCount
j < outputTypesCountDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
&& it != args.constEnd()
it != args.constEnd()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
; ++i, ++j, ++it) {
0-16
227 copyArgument(argv[i], outputTypes[j], *it);-
228 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qdbusinterface - unknown status
4
229 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qdbusinterface - unknown status
16
230-
231-
232 lastError = QDBusError(reply);-
233 return
executed 16 times by 1 test: return -1;
Executed by:
  • tst_qdbusinterface - unknown status
-1;
executed 16 times by 1 test: return -1;
Executed by:
  • tst_qdbusinterface - unknown status
16
234 }-
235 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
12
236 return
executed 12 times by 2 tests: return id;
Executed by:
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
id;
executed 12 times by 2 tests: return id;
Executed by:
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
12
237}-
238-
239-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9