Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | static QDBusError checkIfValid(const QString &service, const QString &path, | - |
10 | const QString &interface, bool isDynamic, bool isPeer) | - |
11 | { | - |
12 | | - |
13 | QDBusError error; | - |
14 | | - |
15 | | - |
16 | | - |
17 | if (!isDynamic) { evaluated: !isDynamic yes Evaluation Count:132 | yes Evaluation Count:132 |
| 132 |
18 | | - |
19 | qt_noop(); | - |
20 | } executed: } Execution Count:132 | 132 |
21 | if (!QDBusUtil::checkBusName(service, (isDynamic && !isPeer) ? QDBusUtil::EmptyNotAllowed : QDBusUtil::EmptyAllowed, &error)) evaluated: !QDBusUtil::checkBusName(service, (isDynamic && !isPeer) ? QDBusUtil::EmptyNotAllowed : QDBusUtil::EmptyAllowed, &error) yes Evaluation Count:7 | yes Evaluation Count:257 |
| 7-257 |
22 | return error; executed: return error; Execution Count:7 | 7 |
23 | if (!QDBusUtil::checkObjectPath(path, isDynamic ? QDBusUtil::EmptyNotAllowed : QDBusUtil::EmptyAllowed, &error)) evaluated: !QDBusUtil::checkObjectPath(path, isDynamic ? QDBusUtil::EmptyNotAllowed : QDBusUtil::EmptyAllowed, &error) yes Evaluation Count:15 | yes Evaluation Count:242 |
| 15-242 |
24 | return error; executed: return error; Execution Count:15 | 15 |
25 | if (!QDBusUtil::checkInterfaceName(interface, QDBusUtil::EmptyAllowed, &error)) partially evaluated: !QDBusUtil::checkInterfaceName(interface, QDBusUtil::EmptyAllowed, &error) no Evaluation Count:0 | yes Evaluation Count:242 |
| 0-242 |
26 | return error; never executed: return error; | 0 |
27 | | - |
28 | | - |
29 | return QDBusError(); executed: return QDBusError(); Execution Count:242 | 242 |
30 | } | - |
31 | | - |
32 | QDBusAbstractInterfacePrivate::QDBusAbstractInterfacePrivate(const QString &serv, | - |
33 | const QString &p, | - |
34 | const QString &iface, | - |
35 | const QDBusConnection& con, | - |
36 | bool isDynamic) | - |
37 | : connection(con), service(serv), path(p), interface(iface), | - |
38 | lastError(checkIfValid(serv, p, iface, isDynamic, (connectionPrivate() && | - |
39 | connectionPrivate()->mode == QDBusConnectionPrivate::PeerMode))), | - |
40 | timeout(-1), | - |
41 | isValid(!lastError.isValid()) | - |
42 | { | - |
43 | if (!isValid) evaluated: !isValid yes Evaluation Count:22 | yes Evaluation Count:242 |
| 22-242 |
44 | return; executed: return; Execution Count:22 | 22 |
45 | | - |
46 | if (!connection.isConnected()) { evaluated: !connection.isConnected() yes Evaluation Count:5 | yes Evaluation Count:237 |
| 5-237 |
47 | lastError = QDBusError(QDBusError::Disconnected, | - |
48 | QLatin1String("Not connected to D-Bus server")); | - |
49 | } else if (!service.isEmpty()) { executed: } Execution Count:5 evaluated: !service.isEmpty() yes Evaluation Count:139 | yes Evaluation Count:98 |
| 5-139 |
50 | currentOwner = connectionPrivate()->getNameOwner(service); | - |
51 | if (currentOwner.isEmpty()) { evaluated: currentOwner.isEmpty() yes Evaluation Count:4 | yes Evaluation Count:135 |
| 4-135 |
52 | lastError = connectionPrivate()->lastError; | - |
53 | } executed: } Execution Count:4 | 4 |
54 | } executed: } Execution Count:139 | 139 |
55 | } | - |
56 | | - |
57 | bool QDBusAbstractInterfacePrivate::canMakeCalls() const | - |
58 | { | - |
59 | | - |
60 | | - |
61 | if (service.isEmpty() && connectionPrivate()->mode != QDBusConnectionPrivate::PeerMode) evaluated: service.isEmpty() yes Evaluation Count:114 | yes Evaluation Count:1019 |
evaluated: connectionPrivate()->mode != QDBusConnectionPrivate::PeerMode yes Evaluation Count:12 | yes Evaluation Count:102 |
| 12-1019 |
62 | return QDBusUtil::checkBusName(service, QDBusUtil::EmptyNotAllowed, &lastError); executed: return QDBusUtil::checkBusName(service, QDBusUtil::EmptyNotAllowed, &lastError); Execution Count:12 | 12 |
63 | if (path.isEmpty()) evaluated: path.isEmpty() yes Evaluation Count:12 | yes Evaluation Count:1109 |
| 12-1109 |
64 | return QDBusUtil::checkObjectPath(path, QDBusUtil::EmptyNotAllowed, &lastError); executed: return QDBusUtil::checkObjectPath(path, QDBusUtil::EmptyNotAllowed, &lastError); Execution Count:12 | 12 |
65 | return true; executed: return true; Execution Count:1109 | 1109 |
66 | } | - |
67 | | - |
68 | void QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp, QVariant &where) const | - |
69 | { | - |
70 | if (!isValid || !canMakeCalls()) { evaluated: !isValid yes Evaluation Count:6 | yes Evaluation Count:25 |
evaluated: !canMakeCalls() yes Evaluation Count:8 | yes Evaluation Count:17 |
| 6-25 |
71 | where.clear(); | - |
72 | return; executed: return; Execution Count:14 | 14 |
73 | } | - |
74 | | - |
75 | | - |
76 | const char *expectedSignature = ""; | - |
77 | if (int(mp.type()) != QMetaType::QVariant) { partially evaluated: int(mp.type()) != QMetaType::QVariant yes Evaluation Count:17 | no Evaluation Count:0 |
| 0-17 |
78 | expectedSignature = QDBusMetaType::typeToSignature(where.userType()); | - |
79 | if (expectedSignature == 0) { partially evaluated: expectedSignature == 0 no Evaluation Count:0 | yes Evaluation Count:17 |
| 0-17 |
80 | QMessageLogger("qdbusabstractinterface.cpp", 131, __PRETTY_FUNCTION__).warning("QDBusAbstractInterface: type %s must be registered with Qt D-Bus before it can be " | - |
81 | "used to read property %s.%s", | - |
82 | mp.typeName(), QString(interface).toLocal8Bit().constData(), mp.name()); | - |
83 | lastError = QDBusError(QDBusError::Failed, | - |
84 | QString::fromLatin1("Unregistered type %1 cannot be handled") | - |
85 | .arg(QLatin1String(mp.typeName()))); | - |
86 | where.clear(); | - |
87 | return; | 0 |
88 | } | - |
89 | } executed: } Execution Count:17 | 17 |
90 | | - |
91 | | - |
92 | QDBusMessage msg = QDBusMessage::createMethodCall(service, path, | - |
93 | QLatin1String("org.freedesktop.DBus.Properties"), | - |
94 | QLatin1String("Get")); | - |
95 | QDBusMessagePrivate::setParametersValidated(msg, true); | - |
96 | msg << interface << QString::fromUtf8(mp.name()); | - |
97 | QDBusMessage reply = connection.call(msg, QDBus::Block, timeout); | - |
98 | | - |
99 | if (reply.type() != QDBusMessage::ReplyMessage) { evaluated: reply.type() != QDBusMessage::ReplyMessage yes Evaluation Count:1 | yes Evaluation Count:16 |
| 1-16 |
100 | lastError = QDBusError(reply); | - |
101 | where.clear(); | - |
102 | return; executed: return; Execution Count:1 | 1 |
103 | } | - |
104 | if (reply.signature() != QLatin1String("v")) { partially evaluated: reply.signature() != QLatin1String("v") no Evaluation Count:0 | yes Evaluation Count:16 |
| 0-16 |
105 | QString errmsg = QLatin1String("Invalid signature `%1' in return from call to " | - |
106 | "org.freedesktop.DBus.Properties"); | - |
107 | lastError = QDBusError(QDBusError::InvalidSignature, errmsg.arg(reply.signature())); | - |
108 | where.clear(); | - |
109 | return; | 0 |
110 | } | - |
111 | | - |
112 | QByteArray foundSignature; | - |
113 | const char *foundType = 0; | - |
114 | QVariant value = qvariant_cast<QDBusVariant>(reply.arguments().at(0)).variant(); | - |
115 | | - |
116 | if (value.userType() == where.userType() || mp.userType() == QMetaType::QVariant evaluated: value.userType() == where.userType() yes Evaluation Count:10 | yes Evaluation Count:6 |
partially evaluated: mp.userType() == QMetaType::QVariant no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-10 |
117 | || (expectedSignature[0] == 'v' && expectedSignature[1] == '\0')) { partially evaluated: expectedSignature[0] == 'v' no Evaluation Count:0 | yes Evaluation Count:6 |
never evaluated: expectedSignature[1] == '\0' | 0-6 |
118 | | - |
119 | where = value; | - |
120 | return; executed: return; Execution Count:10 | 10 |
121 | } | - |
122 | | - |
123 | if (value.userType() == qMetaTypeId<QDBusArgument>()) { partially evaluated: value.userType() == qMetaTypeId<QDBusArgument>() yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
124 | QDBusArgument arg = qvariant_cast<QDBusArgument>(value); | - |
125 | | - |
126 | foundType = "user type"; | - |
127 | foundSignature = arg.currentSignature().toLatin1(); | - |
128 | if (foundSignature == expectedSignature) { partially evaluated: foundSignature == expectedSignature yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
129 | | - |
130 | QDBusMetaType::demarshall(arg, where.userType(), where.data()); | - |
131 | return; executed: return; Execution Count:6 | 6 |
132 | } | - |
133 | } else { | 0 |
134 | foundType = value.typeName(); | - |
135 | foundSignature = QDBusMetaType::typeToSignature(value.userType()); | - |
136 | } | 0 |
137 | | - |
138 | | - |
139 | QString errmsg = QLatin1String("Unexpected `%1' (%2) when retrieving property `%3.%4' " | - |
140 | "(expected type `%5' (%6))"); | - |
141 | lastError = QDBusError(QDBusError::InvalidSignature, | - |
142 | errmsg.arg(QString::fromLatin1(foundType), | - |
143 | QString::fromLatin1(foundSignature), | - |
144 | interface, | - |
145 | QString::fromUtf8(mp.name()), | - |
146 | QString::fromLatin1(mp.typeName()), | - |
147 | QString::fromLatin1(expectedSignature))); | - |
148 | where.clear(); | - |
149 | return; | 0 |
150 | } | - |
151 | | - |
152 | bool QDBusAbstractInterfacePrivate::setProperty(const QMetaProperty &mp, const QVariant &value) | - |
153 | { | - |
154 | if (!isValid || !canMakeCalls()) evaluated: !isValid yes Evaluation Count:6 | yes Evaluation Count:24 |
evaluated: !canMakeCalls() yes Evaluation Count:8 | yes Evaluation Count:16 |
| 6-24 |
155 | return false; executed: return false; Execution Count:14 | 14 |
156 | | - |
157 | | - |
158 | QDBusMessage msg = QDBusMessage::createMethodCall(service, path, | - |
159 | QLatin1String("org.freedesktop.DBus.Properties"), | - |
160 | QLatin1String("Set")); | - |
161 | QDBusMessagePrivate::setParametersValidated(msg, true); | - |
162 | msg << interface << QString::fromUtf8(mp.name()) << QVariant::fromValue(QDBusVariant(value)); | - |
163 | QDBusMessage reply = connection.call(msg, QDBus::Block, timeout); | - |
164 | | - |
165 | if (reply.type() != QDBusMessage::ReplyMessage) { partially evaluated: reply.type() != QDBusMessage::ReplyMessage no Evaluation Count:0 | yes Evaluation Count:16 |
| 0-16 |
166 | lastError = QDBusError(reply); | - |
167 | return false; never executed: return false; | 0 |
168 | } | - |
169 | return true; executed: return true; Execution Count:16 | 16 |
170 | } | - |
171 | | - |
172 | void QDBusAbstractInterfacePrivate::_q_serviceOwnerChanged(const QString &name, | - |
173 | const QString &oldOwner, | - |
174 | const QString &newOwner) | - |
175 | { | - |
176 | (void)oldOwner;; | - |
177 | | - |
178 | if (name == service) { partially evaluated: name == service yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
179 | currentOwner = newOwner; | - |
180 | } executed: } Execution Count:2 | 2 |
181 | } executed: } Execution Count:2 | 2 |
182 | | - |
183 | QDBusAbstractInterfaceBase::QDBusAbstractInterfaceBase(QDBusAbstractInterfacePrivate &d, QObject *parent) | - |
184 | : QObject(d, parent) | - |
185 | { | - |
186 | } executed: } Execution Count:264 | 264 |
187 | | - |
188 | int QDBusAbstractInterfaceBase::qt_metacall(QMetaObject::Call _c, int _id, void **_a) | - |
189 | { | - |
190 | int saved_id = _id; | - |
191 | _id = QObject::qt_metacall(_c, _id, _a); | - |
192 | if (_id < 0) | - |
193 | return _id; | - |
194 | | - |
195 | if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty) { | - |
196 | QMetaProperty mp = metaObject()->property(saved_id); | - |
197 | int &status = *reinterpret_cast<int *>(_a[2]); | - |
198 | QVariant &variant = *reinterpret_cast<QVariant *>(_a[1]); | - |
199 | | - |
200 | if (_c == QMetaObject::WriteProperty) { | - |
201 | status = d_func()->setProperty(mp, variant) ? 1 : 0; | - |
202 | } else { | - |
203 | d_func()->property(mp, variant); | - |
204 | status = variant.isValid() ? 1 : 0; | - |
205 | } | - |
206 | _id = -1; | - |
207 | } | - |
208 | return _id; | - |
209 | } | - |
210 | QDBusAbstractInterface::QDBusAbstractInterface(QDBusAbstractInterfacePrivate &d, QObject *parent) | - |
211 | : QDBusAbstractInterfaceBase(d, parent) | - |
212 | { | - |
213 | | - |
214 | if (d.isValid && evaluated: d.isValid yes Evaluation Count:131 | yes Evaluation Count:1 |
| 1-131 |
215 | d.connection.isConnected() evaluated: d.connection.isConnected() yes Evaluation Count:128 | yes Evaluation Count:3 |
| 3-128 |
216 | && !d.service.isEmpty() evaluated: !d.service.isEmpty() yes Evaluation Count:80 | yes Evaluation Count:48 |
| 48-80 |
217 | && !d.service.startsWith(QLatin1Char(':'))) evaluated: !d.service.startsWith(QLatin1Char(':')) yes Evaluation Count:4 | yes Evaluation Count:76 |
| 4-76 |
218 | d_func()->connection.connect(QLatin1String("org.freedesktop.DBus"), | 4 |
219 | QString(), | 4 |
220 | QLatin1String("org.freedesktop.DBus"), | 4 |
221 | QLatin1String("NameOwnerChanged"), | 4 |
222 | QStringList() << d.service, | 4 |
223 | QString(), | 4 |
224 | this, "1""_q_serviceOwnerChanged(QString,QString,QString)"); executed: d_func()->connection.connect(QLatin1String("org.freedesktop.DBus"), QString(), QLatin1String("org.freedesktop.DBus"), QLatin1String("NameOwnerChanged"), QStringList() << d.service, QString(), this, "1""_q_serviceOwnerChanged(QString,QString,QString)"); Execution Count:4 | 4 |
225 | } executed: } Execution Count:132 | 132 |
226 | | - |
227 | | - |
228 | | - |
229 | | - |
230 | | - |
231 | | - |
232 | QDBusAbstractInterface::QDBusAbstractInterface(const QString &service, const QString &path, | - |
233 | const char *interface, const QDBusConnection &con, | - |
234 | QObject *parent) | - |
235 | : QDBusAbstractInterfaceBase(*new QDBusAbstractInterfacePrivate(service, path, QString::fromLatin1(interface), | - |
236 | con, false), parent) | - |
237 | { | - |
238 | | - |
239 | if (d_func()->isValid && evaluated: d_func()->isValid yes Evaluation Count:111 | yes Evaluation Count:21 |
| 21-111 |
240 | d_func()->connection.isConnected() evaluated: d_func()->connection.isConnected() yes Evaluation Count:109 | yes Evaluation Count:2 |
| 2-109 |
241 | && !service.isEmpty() evaluated: !service.isEmpty() yes Evaluation Count:59 | yes Evaluation Count:50 |
| 50-59 |
242 | && !service.startsWith(QLatin1Char(':'))) evaluated: !service.startsWith(QLatin1Char(':')) yes Evaluation Count:26 | yes Evaluation Count:33 |
| 26-33 |
243 | d_func()->connection.connect(QLatin1String("org.freedesktop.DBus"), | 26 |
244 | QString(), | 26 |
245 | QLatin1String("org.freedesktop.DBus"), | 26 |
246 | QLatin1String("NameOwnerChanged"), | 26 |
247 | QStringList() << service, | 26 |
248 | QString(), | 26 |
249 | this, "1""_q_serviceOwnerChanged(QString,QString,QString)"); executed: d_func()->connection.connect(QLatin1String("org.freedesktop.DBus"), QString(), QLatin1String("org.freedesktop.DBus"), QLatin1String("NameOwnerChanged"), QStringList() << service, QString(), this, "1""_q_serviceOwnerChanged(QString,QString,QString)"); Execution Count:26 | 26 |
250 | } executed: } Execution Count:132 | 132 |
251 | | - |
252 | | - |
253 | | - |
254 | | - |
255 | QDBusAbstractInterface::~QDBusAbstractInterface() | - |
256 | { | - |
257 | } | - |
258 | bool QDBusAbstractInterface::isValid() const | - |
259 | { | - |
260 | return !d_func()->currentOwner.isEmpty(); executed: return !d_func()->currentOwner.isEmpty(); Execution Count:43 | 43 |
261 | } | - |
262 | | - |
263 | | - |
264 | | - |
265 | | - |
266 | QDBusConnection QDBusAbstractInterface::connection() const | - |
267 | { | - |
268 | return d_func()->connection; executed: return d_func()->connection; Execution Count:1 | 1 |
269 | } | - |
270 | | - |
271 | | - |
272 | | - |
273 | | - |
274 | QString QDBusAbstractInterface::service() const | - |
275 | { | - |
276 | return d_func()->service; executed: return d_func()->service; Execution Count:1076 | 1076 |
277 | } | - |
278 | | - |
279 | | - |
280 | | - |
281 | | - |
282 | QString QDBusAbstractInterface::path() const | - |
283 | { | - |
284 | return d_func()->path; executed: return d_func()->path; Execution Count:1076 | 1076 |
285 | } | - |
286 | | - |
287 | | - |
288 | | - |
289 | | - |
290 | QString QDBusAbstractInterface::interface() const | - |
291 | { | - |
292 | return d_func()->interface; executed: return d_func()->interface; Execution Count:1076 | 1076 |
293 | } | - |
294 | | - |
295 | | - |
296 | | - |
297 | | - |
298 | | - |
299 | QDBusError QDBusAbstractInterface::lastError() const | - |
300 | { | - |
301 | return d_func()->lastError; executed: return d_func()->lastError; Execution Count:47 | 47 |
302 | } | - |
303 | | - |
304 | | - |
305 | | - |
306 | | - |
307 | | - |
308 | | - |
309 | | - |
310 | void QDBusAbstractInterface::setTimeout(int timeout) | - |
311 | { | - |
312 | d_func()->timeout = timeout; | - |
313 | } executed: } Execution Count:3 | 3 |
314 | | - |
315 | | - |
316 | | - |
317 | | - |
318 | | - |
319 | | - |
320 | | - |
321 | int QDBusAbstractInterface::timeout() const | - |
322 | { | - |
323 | return d_func()->timeout; never executed: return d_func()->timeout; | 0 |
324 | } | - |
325 | QDBusMessage QDBusAbstractInterface::callWithArgumentList(QDBus::CallMode mode, | - |
326 | const QString& method, | - |
327 | const QList<QVariant>& args) | - |
328 | { | - |
329 | QDBusAbstractInterfacePrivate * const d = d_func(); | - |
330 | | - |
331 | if (!d->isValid || !d->canMakeCalls()) partially evaluated: !d->isValid no Evaluation Count:0 | yes Evaluation Count:1015 |
partially evaluated: !d->canMakeCalls() no Evaluation Count:0 | yes Evaluation Count:1015 |
| 0-1015 |
332 | return QDBusMessage::createError(d->lastError); never executed: return QDBusMessage::createError(d->lastError); | 0 |
333 | | - |
334 | QString m = method; | - |
335 | | - |
336 | int pos = method.indexOf(QLatin1Char('.')); | - |
337 | if (pos != -1) evaluated: pos != -1 yes Evaluation Count:4 | yes Evaluation Count:1011 |
| 4-1011 |
338 | m.truncate(pos); executed: m.truncate(pos); Execution Count:4 | 4 |
339 | | - |
340 | if (mode == QDBus::AutoDetect) { evaluated: mode == QDBus::AutoDetect yes Evaluation Count:805 | yes Evaluation Count:210 |
| 210-805 |
341 | | - |
342 | mode = QDBus::Block; | - |
343 | const QMetaObject *mo = metaObject(); | - |
344 | QByteArray match = m.toLatin1(); | - |
345 | | - |
346 | for (int i = staticMetaObject.methodCount(); i < mo->methodCount(); ++i) { evaluated: i < mo->methodCount() yes Evaluation Count:13395 | yes Evaluation Count:776 |
| 776-13395 |
347 | QMetaMethod mm = mo->method(i); | - |
348 | if (mm.name() == match) { evaluated: mm.name() == match yes Evaluation Count:29 | yes Evaluation Count:13366 |
| 29-13366 |
349 | | - |
350 | | - |
351 | | - |
352 | | - |
353 | QList<QByteArray> tags = QByteArray(mm.tag()).split(' '); | - |
354 | if (tags.contains("Q_NOREPLY")) partially evaluated: tags.contains("Q_NOREPLY") no Evaluation Count:0 | yes Evaluation Count:29 |
| 0-29 |
355 | mode = QDBus::NoBlock; never executed: mode = QDBus::NoBlock; | 0 |
356 | | - |
357 | break; executed: break; Execution Count:29 | 29 |
358 | } | - |
359 | } executed: } Execution Count:13366 | 13366 |
360 | } executed: } Execution Count:805 | 805 |
361 | | - |
362 | | - |
363 | QDBusMessage msg = QDBusMessage::createMethodCall(service(), path(), interface(), m); | - |
364 | QDBusMessagePrivate::setParametersValidated(msg, true); | - |
365 | msg.setArguments(args); | - |
366 | | - |
367 | QDBusMessage reply = d->connection.call(msg, mode, d->timeout); | - |
368 | if (thread() == QThread::currentThread()) evaluated: thread() == QThread::currentThread() yes Evaluation Count:1013 | yes Evaluation Count:2 |
| 2-1013 |
369 | d->lastError = QDBusError(reply); executed: d->lastError = QDBusError(reply); Execution Count:1013 | 1013 |
370 | | - |
371 | | - |
372 | if (reply.arguments().isEmpty()) evaluated: reply.arguments().isEmpty() yes Evaluation Count:90 | yes Evaluation Count:925 |
| 90-925 |
373 | reply << QVariant(); executed: reply << QVariant(); Execution Count:90 | 90 |
374 | | - |
375 | return reply; executed: return reply; Execution Count:1015 | 1015 |
376 | } | - |
377 | QDBusPendingCall QDBusAbstractInterface::asyncCallWithArgumentList(const QString& method, | - |
378 | const QList<QVariant>& args) | - |
379 | { | - |
380 | QDBusAbstractInterfacePrivate * const d = d_func(); | - |
381 | | - |
382 | if (!d->isValid || !d->canMakeCalls()) evaluated: !d->isValid yes Evaluation Count:6 | yes Evaluation Count:63 |
evaluated: !d->canMakeCalls() yes Evaluation Count:8 | yes Evaluation Count:55 |
| 6-63 |
383 | return QDBusPendingCall::fromError(d->lastError); executed: return QDBusPendingCall::fromError(d->lastError); Execution Count:14 | 14 |
384 | | - |
385 | QDBusMessage msg = QDBusMessage::createMethodCall(service(), path(), interface(), method); | - |
386 | QDBusMessagePrivate::setParametersValidated(msg, true); | - |
387 | msg.setArguments(args); | - |
388 | return d->connection.asyncCall(msg, d->timeout); executed: return d->connection.asyncCall(msg, d->timeout); Execution Count:55 | 55 |
389 | } | - |
390 | bool QDBusAbstractInterface::callWithCallback(const QString &method, | - |
391 | const QList<QVariant> &args, | - |
392 | QObject *receiver, | - |
393 | const char *returnMethod, | - |
394 | const char *errorMethod) | - |
395 | { | - |
396 | QDBusAbstractInterfacePrivate * const d = d_func(); | - |
397 | | - |
398 | if (!d->isValid || !d->canMakeCalls()) partially evaluated: !d->isValid no Evaluation Count:0 | yes Evaluation Count:6 |
partially evaluated: !d->canMakeCalls() no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
399 | return false; never executed: return false; | 0 |
400 | | - |
401 | QDBusMessage msg = QDBusMessage::createMethodCall(service(), | - |
402 | path(), | - |
403 | interface(), | - |
404 | method); | - |
405 | QDBusMessagePrivate::setParametersValidated(msg, true); | - |
406 | msg.setArguments(args); | - |
407 | | - |
408 | d->lastError = QDBusError(); | - |
409 | return d->connection.callWithCallback(msg, | 6 |
410 | receiver, | 6 |
411 | returnMethod, | 6 |
412 | errorMethod, | 6 |
413 | d->timeout); executed: return d->connection.callWithCallback(msg, receiver, returnMethod, errorMethod, d->timeout); Execution Count:6 | 6 |
414 | } | - |
415 | bool QDBusAbstractInterface::callWithCallback(const QString &method, | - |
416 | const QList<QVariant> &args, | - |
417 | QObject *receiver, | - |
418 | const char *slot) | - |
419 | { | - |
420 | return callWithCallback(method, args, receiver, slot, 0); executed: return callWithCallback(method, args, receiver, slot, 0); Execution Count:5 | 5 |
421 | } | - |
422 | | - |
423 | | - |
424 | | - |
425 | | - |
426 | | - |
427 | void QDBusAbstractInterface::connectNotify(const QMetaMethod &signal) | - |
428 | { | - |
429 | | - |
430 | QDBusAbstractInterfacePrivate * const d = d_func(); | - |
431 | if (!d->isValid) partially evaluated: !d->isValid no Evaluation Count:0 | yes Evaluation Count:109 |
| 0-109 |
432 | return; | 0 |
433 | | - |
434 | | - |
435 | static const QMetaMethod destroyedSignal = QMetaMethod::fromSignal(&QDBusAbstractInterface::destroyed); | - |
436 | if (signal == destroyedSignal) evaluated: signal == destroyedSignal yes Evaluation Count:55 | yes Evaluation Count:54 |
| 54-55 |
437 | return; executed: return; Execution Count:55 | 55 |
438 | | - |
439 | QDBusConnectionPrivate *conn = d->connectionPrivate(); | - |
440 | if (conn) { partially evaluated: conn yes Evaluation Count:54 | no Evaluation Count:0 |
| 0-54 |
441 | conn->connectRelay(d->service, d->path, d->interface, | - |
442 | this, signal); | - |
443 | } executed: } Execution Count:54 | 54 |
444 | } executed: } Execution Count:54 | 54 |
445 | | - |
446 | | - |
447 | | - |
448 | | - |
449 | | - |
450 | void QDBusAbstractInterface::disconnectNotify(const QMetaMethod &signal) | - |
451 | { | - |
452 | | - |
453 | QDBusAbstractInterfacePrivate * const d = d_func(); | - |
454 | if (!d->isValid) partially evaluated: !d->isValid no Evaluation Count:0 | yes Evaluation Count:33 |
| 0-33 |
455 | return; | 0 |
456 | | - |
457 | QDBusConnectionPrivate *conn = d->connectionPrivate(); | - |
458 | if (conn) partially evaluated: conn yes Evaluation Count:33 | no Evaluation Count:0 |
| 0-33 |
459 | conn->disconnectRelay(d->service, d->path, d->interface, | 33 |
460 | this, signal); executed: conn->disconnectRelay(d->service, d->path, d->interface, this, signal); Execution Count:33 | 33 |
461 | } executed: } Execution Count:33 | 33 |
462 | | - |
463 | | - |
464 | | - |
465 | | - |
466 | | - |
467 | QVariant QDBusAbstractInterface::internalPropGet(const char *propname) const | - |
468 | { | - |
469 | | - |
470 | | - |
471 | | - |
472 | return property(propname); never executed: return property(propname); | 0 |
473 | } | - |
474 | | - |
475 | | - |
476 | | - |
477 | | - |
478 | | - |
479 | void QDBusAbstractInterface::internalPropSet(const char *propname, const QVariant &value) | - |
480 | { | - |
481 | setProperty(propname, value); | - |
482 | } | 0 |
483 | QDBusMessage QDBusAbstractInterface::call(const QString &method, const QVariant &arg1, | - |
484 | const QVariant &arg2, | - |
485 | const QVariant &arg3, | - |
486 | const QVariant &arg4, | - |
487 | const QVariant &arg5, | - |
488 | const QVariant &arg6, | - |
489 | const QVariant &arg7, | - |
490 | const QVariant &arg8) | - |
491 | { | - |
492 | return call(QDBus::AutoDetect, method, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); executed: return call(QDBus::AutoDetect, method, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); Execution Count:58 | 58 |
493 | } | - |
494 | QDBusMessage QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &method, | - |
495 | const QVariant &arg1, | - |
496 | const QVariant &arg2, | - |
497 | const QVariant &arg3, | - |
498 | const QVariant &arg4, | - |
499 | const QVariant &arg5, | - |
500 | const QVariant &arg6, | - |
501 | const QVariant &arg7, | - |
502 | const QVariant &arg8) | - |
503 | { | - |
504 | QList<QVariant> argList; | - |
505 | int count = 0 + arg1.isValid() + arg2.isValid() + arg3.isValid() + arg4.isValid() + | - |
506 | arg5.isValid() + arg6.isValid() + arg7.isValid() + arg8.isValid(); | - |
507 | | - |
508 | switch (count) { | - |
509 | case 8: | - |
510 | argList.prepend(arg8); | - |
511 | case 7: code before this statement never executed: case 7: | 0 |
512 | argList.prepend(arg7); | - |
513 | case 6: code before this statement never executed: case 6: | 0 |
514 | argList.prepend(arg6); | - |
515 | case 5: code before this statement never executed: case 5: | 0 |
516 | argList.prepend(arg5); | - |
517 | case 4: code before this statement never executed: case 4: | 0 |
518 | argList.prepend(arg4); | - |
519 | case 3: code before this statement never executed: case 3: | 0 |
520 | argList.prepend(arg3); | - |
521 | case 2: code before this statement executed: case 2: Execution Count:12 | 12 |
522 | argList.prepend(arg2); | - |
523 | case 1: code before this statement executed: case 1: Execution Count:59 | 59 |
524 | argList.prepend(arg1); | - |
525 | } executed: } Execution Count:101 | 101 |
526 | | - |
527 | return callWithArgumentList(mode, method, argList); executed: return callWithArgumentList(mode, method, argList); Execution Count:232 | 232 |
528 | } | - |
529 | QDBusPendingCall QDBusAbstractInterface::asyncCall(const QString &method, const QVariant &arg1, | - |
530 | const QVariant &arg2, | - |
531 | const QVariant &arg3, | - |
532 | const QVariant &arg4, | - |
533 | const QVariant &arg5, | - |
534 | const QVariant &arg6, | - |
535 | const QVariant &arg7, | - |
536 | const QVariant &arg8) | - |
537 | { | - |
538 | QList<QVariant> argList; | - |
539 | int count = 0 + arg1.isValid() + arg2.isValid() + arg3.isValid() + arg4.isValid() + | - |
540 | arg5.isValid() + arg6.isValid() + arg7.isValid() + arg8.isValid(); | - |
541 | | - |
542 | switch (count) { | - |
543 | case 8: | - |
544 | argList.prepend(arg8); | - |
545 | case 7: code before this statement never executed: case 7: | 0 |
546 | argList.prepend(arg7); | - |
547 | case 6: code before this statement never executed: case 6: | 0 |
548 | argList.prepend(arg6); | - |
549 | case 5: code before this statement never executed: case 5: | 0 |
550 | argList.prepend(arg5); | - |
551 | case 4: code before this statement never executed: case 4: | 0 |
552 | argList.prepend(arg4); | - |
553 | case 3: code before this statement never executed: case 3: | 0 |
554 | argList.prepend(arg3); | - |
555 | case 2: code before this statement never executed: case 2: | 0 |
556 | argList.prepend(arg2); | - |
557 | case 1: code before this statement never executed: case 1: | 0 |
558 | argList.prepend(arg1); | - |
559 | } | 0 |
560 | | - |
561 | return asyncCallWithArgumentList(method, argList); executed: return asyncCallWithArgumentList(method, argList); Execution Count:39 | 39 |
562 | } | - |
563 | | - |
564 | | - |
565 | | - |
566 | | - |
567 | QDBusMessage QDBusAbstractInterface::internalConstCall(QDBus::CallMode mode, | - |
568 | const QString &method, | - |
569 | const QList<QVariant> &args) const | - |
570 | { | - |
571 | | - |
572 | return const_cast<QDBusAbstractInterface*>(this)->callWithArgumentList(mode, method, args); executed: return const_cast<QDBusAbstractInterface*>(this)->callWithArgumentList(mode, method, args); Execution Count:747 | 747 |
573 | } | - |
574 | | - |
575 | | - |
576 | | - |
577 | | - |
578 | | - |
579 | | - |
| | |