| Line | Source Code | Coverage |
|---|
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | static void qIterAppend(DBusMessageIter *it, QByteArray *ba, int type, const void *arg) | - |
| 9 | { | - |
| 10 | if (ba) evaluated: ba| yes Evaluation Count:76 | yes Evaluation Count:1610 |
| 76-1610 |
| 11 | *ba += char(type); executed: *ba += char(type);Execution Count:76 | 76 |
| 12 | else | - |
| 13 | q_dbus_message_iter_append_basic(it, type, arg); executed: q_dbus_message_iter_append_basic(it, type, arg);Execution Count:1610 | 1610 |
| 14 | } | - |
| 15 | | - |
| 16 | QDBusMarshaller::~QDBusMarshaller() | - |
| 17 | { | - |
| 18 | close(); | - |
| 19 | } executed: }Execution Count:2157 | 2157 |
| 20 | | - |
| 21 | inline QString QDBusMarshaller::currentSignature() | - |
| 22 | { | - |
| 23 | if (message) | 0 |
| 24 | return QString::fromUtf8(q_dbus_message_get_signature(message)); never executed: return QString::fromUtf8(q_dbus_message_get_signature(message)); | 0 |
| 25 | return QString(); never executed: return QString(); | 0 |
| 26 | } | - |
| 27 | | - |
| 28 | inline void QDBusMarshaller::append(uchar arg) | - |
| 29 | { | - |
| 30 | qIterAppend(&iterator, ba, ((int) 'y'), &arg); | - |
| 31 | } | 0 |
| 32 | | - |
| 33 | inline void QDBusMarshaller::append(bool arg) | - |
| 34 | { | - |
| 35 | dbus_bool_t cast = arg; | - |
| 36 | qIterAppend(&iterator, ba, ((int) 'b'), &cast); | - |
| 37 | } | 0 |
| 38 | | - |
| 39 | inline void QDBusMarshaller::append(short arg) | - |
| 40 | { | - |
| 41 | qIterAppend(&iterator, ba, ((int) 'n'), &arg); | - |
| 42 | } | 0 |
| 43 | | - |
| 44 | inline void QDBusMarshaller::append(ushort arg) | - |
| 45 | { | - |
| 46 | qIterAppend(&iterator, ba, ((int) 'q'), &arg); | - |
| 47 | } | 0 |
| 48 | | - |
| 49 | inline void QDBusMarshaller::append(int arg) | - |
| 50 | { | - |
| 51 | qIterAppend(&iterator, ba, ((int) 'i'), &arg); | - |
| 52 | } executed: }Execution Count:120 | 120 |
| 53 | | - |
| 54 | inline void QDBusMarshaller::append(uint arg) | - |
| 55 | { | - |
| 56 | qIterAppend(&iterator, ba, ((int) 'u'), &arg); | - |
| 57 | } | 0 |
| 58 | | - |
| 59 | inline void QDBusMarshaller::append(qlonglong arg) | - |
| 60 | { | - |
| 61 | qIterAppend(&iterator, ba, ((int) 'x'), &arg); | - |
| 62 | } executed: }Execution Count:6 | 6 |
| 63 | | - |
| 64 | inline void QDBusMarshaller::append(qulonglong arg) | - |
| 65 | { | - |
| 66 | qIterAppend(&iterator, ba, ((int) 't'), &arg); | - |
| 67 | } | 0 |
| 68 | | - |
| 69 | inline void QDBusMarshaller::append(double arg) | - |
| 70 | { | - |
| 71 | qIterAppend(&iterator, ba, ((int) 'd'), &arg); | - |
| 72 | } executed: }Execution Count:12 | 12 |
| 73 | | - |
| 74 | void QDBusMarshaller::append(const QString &arg) | - |
| 75 | { | - |
| 76 | QByteArray data = arg.toUtf8(); | - |
| 77 | const char *cdata = data.constData(); | - |
| 78 | qIterAppend(&iterator, ba, ((int) 's'), &cdata); | - |
| 79 | } executed: }Execution Count:1367 | 1367 |
| 80 | | - |
| 81 | inline void QDBusMarshaller::append(const QDBusObjectPath &arg) | - |
| 82 | { | - |
| 83 | QByteArray data = arg.path().toUtf8(); | - |
| 84 | if (!ba && data.isEmpty()) { evaluated: !ba| yes Evaluation Count:2 | yes Evaluation Count:2 |
partially evaluated: data.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
| 85 | error(QLatin1String("Invalid object path passed in arguments")); | - |
| 86 | } else { | 0 |
| 87 | const char *cdata = data.constData(); | - |
| 88 | qIterAppend(&iterator, ba, ((int) 'o'), &cdata); | - |
| 89 | } executed: }Execution Count:4 | 4 |
| 90 | } | - |
| 91 | | - |
| 92 | inline void QDBusMarshaller::append(const QDBusSignature &arg) | - |
| 93 | { | - |
| 94 | QByteArray data = arg.signature().toUtf8(); | - |
| 95 | if (!ba && data.isEmpty()) { never evaluated: data.isEmpty() | 0 |
| 96 | error(QLatin1String("Invalid signature passed in arguments")); | - |
| 97 | } else { | 0 |
| 98 | const char *cdata = data.constData(); | - |
| 99 | qIterAppend(&iterator, ba, ((int) 'g'), &cdata); | - |
| 100 | } | 0 |
| 101 | } | - |
| 102 | | - |
| 103 | inline void QDBusMarshaller::append(const QDBusUnixFileDescriptor &arg) | - |
| 104 | { | - |
| 105 | int fd = arg.fileDescriptor(); | - |
| 106 | if (!ba && fd == -1) { never evaluated: fd == -1 | 0 |
| 107 | error(QLatin1String("Invalid file descriptor passed in arguments")); | - |
| 108 | } else { | 0 |
| 109 | qIterAppend(&iterator, ba, int('h'), &fd); | - |
| 110 | } | 0 |
| 111 | } | - |
| 112 | | - |
| 113 | inline void QDBusMarshaller::append(const QByteArray &arg) | - |
| 114 | { | - |
| 115 | if (ba) { evaluated: ba| yes Evaluation Count:3 | yes Evaluation Count:6 |
| 3-6 |
| 116 | *ba += "a" "y"; | - |
| 117 | return; executed: return;Execution Count:3 | 3 |
| 118 | } | - |
| 119 | | - |
| 120 | const char* cdata = arg.constData(); | - |
| 121 | DBusMessageIter subiterator; | - |
| 122 | q_dbus_message_iter_open_container(&iterator, ((int) 'a'), "y", | - |
| 123 | &subiterator); | - |
| 124 | q_dbus_message_iter_append_fixed_array(&subiterator, ((int) 'y'), &cdata, arg.length()); | - |
| 125 | q_dbus_message_iter_close_container(&iterator, &subiterator); | - |
| 126 | } executed: }Execution Count:6 | 6 |
| 127 | | - |
| 128 | inline bool QDBusMarshaller::append(const QDBusVariant &arg) | - |
| 129 | { | - |
| 130 | if (ba) { partially evaluated: ba| no Evaluation Count:0 | yes Evaluation Count:187 |
| 0-187 |
| 131 | *ba += "v"; | - |
| 132 | return true; never executed: return true; | 0 |
| 133 | } | - |
| 134 | | - |
| 135 | const QVariant &value = arg.variant(); | - |
| 136 | int id = value.userType(); | - |
| 137 | if (id == QVariant::Invalid) { partially evaluated: id == QVariant::Invalid| no Evaluation Count:0 | yes Evaluation Count:187 |
| 0-187 |
| 138 | QMessageLogger("qdbusmarshaller.cpp", 181, __PRETTY_FUNCTION__).warning("QDBusMarshaller: cannot add a null QDBusVariant"); | - |
| 139 | error(QLatin1String("Variant containing QVariant::Invalid passed in arguments")); | - |
| 140 | return false; never executed: return false; | 0 |
| 141 | } | - |
| 142 | | - |
| 143 | QByteArray tmpSignature; | - |
| 144 | const char *signature = 0; | - |
| 145 | if (id == QDBusMetaTypeId::argument()) { partially evaluated: id == QDBusMetaTypeId::argument()| no Evaluation Count:0 | yes Evaluation Count:187 |
| 0-187 |
| 146 | | - |
| 147 | tmpSignature = | - |
| 148 | qvariant_cast<QDBusArgument>(value).currentSignature().toLatin1(); | - |
| 149 | signature = tmpSignature.constData(); | - |
| 150 | } else { | 0 |
| 151 | | - |
| 152 | signature = QDBusMetaType::typeToSignature(id); | - |
| 153 | } executed: }Execution Count:187 | 187 |
| 154 | if (!signature) { partially evaluated: !signature| no Evaluation Count:0 | yes Evaluation Count:187 |
| 0-187 |
| 155 | QMessageLogger("qdbusmarshaller.cpp", 198, __PRETTY_FUNCTION__).warning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. " | - |
| 156 | "Use qDBusRegisterMetaType to register it", | - |
| 157 | QMetaType::typeName(id), id); | - |
| 158 | error(QString::fromLatin1("Unregistered type %1 passed in arguments") | - |
| 159 | .arg(QLatin1String(QMetaType::typeName(id)))); | - |
| 160 | return false; never executed: return false; | 0 |
| 161 | } | - |
| 162 | | - |
| 163 | QDBusMarshaller sub(capabilities); | - |
| 164 | open(sub, ((int) 'v'), signature); | - |
| 165 | bool isOk = sub.appendVariantInternal(value); | - |
| 166 | | - |
| 167 | | - |
| 168 | return isOk; executed: return isOk;Execution Count:187 | 187 |
| 169 | } | - |
| 170 | | - |
| 171 | inline void QDBusMarshaller::append(const QStringList &arg) | - |
| 172 | { | - |
| 173 | if (ba) { evaluated: ba| yes Evaluation Count:4 | yes Evaluation Count:2 |
| 2-4 |
| 174 | *ba += "a" "s"; | - |
| 175 | return; executed: return;Execution Count:4 | 4 |
| 176 | } | - |
| 177 | | - |
| 178 | QDBusMarshaller sub(capabilities); | - |
| 179 | open(sub, ((int) 'a'), "s"); | - |
| 180 | QStringList::ConstIterator it = arg.constBegin(); | - |
| 181 | QStringList::ConstIterator end = arg.constEnd(); | - |
| 182 | for ( ; it != end; ++it) evaluated: it != end| yes Evaluation Count:4 | yes Evaluation Count:2 |
| 2-4 |
| 183 | sub.append(*it); executed: sub.append(*it);Execution Count:4 | 4 |
| 184 | | - |
| 185 | } executed: }Execution Count:2 | 2 |
| 186 | | - |
| 187 | inline QDBusMarshaller *QDBusMarshaller::beginStructure() | - |
| 188 | { | - |
| 189 | return beginCommon(((int) 'r'), 0); executed: return beginCommon(((int) 'r'), 0);Execution Count:65 | 65 |
| 190 | } | - |
| 191 | | - |
| 192 | inline QDBusMarshaller *QDBusMarshaller::beginArray(int id) | - |
| 193 | { | - |
| 194 | const char *signature = QDBusMetaType::typeToSignature( QVariant::Type(id) ); | - |
| 195 | if (!signature) { partially evaluated: !signature| no Evaluation Count:0 | yes Evaluation Count:32 |
| 0-32 |
| 196 | QMessageLogger("qdbusmarshaller.cpp", 239, __PRETTY_FUNCTION__).warning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. " | - |
| 197 | "Use qDBusRegisterMetaType to register it", | - |
| 198 | QMetaType::typeName(id), id); | - |
| 199 | error(QString::fromLatin1("Unregistered type %1 passed in arguments") | - |
| 200 | .arg(QLatin1String(QMetaType::typeName(id)))); | - |
| 201 | return this; never executed: return this; | 0 |
| 202 | } | - |
| 203 | | - |
| 204 | return beginCommon(((int) 'a'), signature); executed: return beginCommon(((int) 'a'), signature);Execution Count:32 | 32 |
| 205 | } | - |
| 206 | | - |
| 207 | inline QDBusMarshaller *QDBusMarshaller::beginMap(int kid, int vid) | - |
| 208 | { | - |
| 209 | const char *ksignature = QDBusMetaType::typeToSignature( QVariant::Type(kid) ); | - |
| 210 | if (!ksignature) { partially evaluated: !ksignature| no Evaluation Count:0 | yes Evaluation Count:34 |
| 0-34 |
| 211 | QMessageLogger("qdbusmarshaller.cpp", 254, __PRETTY_FUNCTION__).warning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. " | - |
| 212 | "Use qDBusRegisterMetaType to register it", | - |
| 213 | QMetaType::typeName(kid), kid); | - |
| 214 | error(QString::fromLatin1("Unregistered type %1 passed in arguments") | - |
| 215 | .arg(QLatin1String(QMetaType::typeName(kid)))); | - |
| 216 | return this; never executed: return this; | 0 |
| 217 | } | - |
| 218 | if (ksignature[1] != 0 || !QDBusUtil::isValidBasicType(*ksignature)) { partially evaluated: ksignature[1] != 0| no Evaluation Count:0 | yes Evaluation Count:34 |
partially evaluated: !QDBusUtil::isValidBasicType(*ksignature)| no Evaluation Count:0 | yes Evaluation Count:34 |
| 0-34 |
| 219 | QMessageLogger("qdbusmarshaller.cpp", 262, __PRETTY_FUNCTION__).warning("QDBusMarshaller: type '%s' (%d) cannot be used as the key type in a D-BUS map.", | - |
| 220 | QMetaType::typeName(kid), kid); | - |
| 221 | error(QString::fromLatin1("Type %1 passed in arguments cannot be used as a key in a map") | - |
| 222 | .arg(QLatin1String(QMetaType::typeName(kid)))); | - |
| 223 | return this; never executed: return this; | 0 |
| 224 | } | - |
| 225 | | - |
| 226 | const char *vsignature = QDBusMetaType::typeToSignature( QVariant::Type(vid) ); | - |
| 227 | if (!vsignature) { partially evaluated: !vsignature| no Evaluation Count:0 | yes Evaluation Count:34 |
| 0-34 |
| 228 | const char *typeName = QMetaType::typeName(vid); | - |
| 229 | QMessageLogger("qdbusmarshaller.cpp", 272, __PRETTY_FUNCTION__).warning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. " | - |
| 230 | "Use qDBusRegisterMetaType to register it", | - |
| 231 | typeName, vid); | - |
| 232 | error(QString::fromLatin1("Unregistered type %1 passed in arguments") | - |
| 233 | .arg(QLatin1String(typeName))); | - |
| 234 | return this; never executed: return this; | 0 |
| 235 | } | - |
| 236 | | - |
| 237 | QByteArray signature; | - |
| 238 | signature = "{"; | - |
| 239 | signature += ksignature; | - |
| 240 | signature += vsignature; | - |
| 241 | signature += "}"; | - |
| 242 | return beginCommon(((int) 'a'), signature); executed: return beginCommon(((int) 'a'), signature);Execution Count:34 | 34 |
| 243 | } | - |
| 244 | | - |
| 245 | inline QDBusMarshaller *QDBusMarshaller::beginMapEntry() | - |
| 246 | { | - |
| 247 | return beginCommon(((int) 'e'), 0); executed: return beginCommon(((int) 'e'), 0);Execution Count:54 | 54 |
| 248 | } | - |
| 249 | | - |
| 250 | void QDBusMarshaller::open(QDBusMarshaller &sub, int code, const char *signature) | - |
| 251 | { | - |
| 252 | sub.parent = this; | - |
| 253 | sub.ba = ba; | - |
| 254 | sub.ok = true; | - |
| 255 | sub.capabilities = capabilities; | - |
| 256 | | - |
| 257 | if (ba) evaluated: ba| yes Evaluation Count:65 | yes Evaluation Count:309 |
| 65-309 |
| 258 | switch (code) { | - |
| 259 | case ((int) 'a'): | - |
| 260 | *ba += char(code); | - |
| 261 | *ba += signature; | - |
| 262 | | - |
| 263 | | - |
| 264 | case ((int) 'e'): code before this statement executed: case ((int) 'e'):Execution Count:32 | 32 |
| 265 | sub.closeCode = 0; | - |
| 266 | break; executed: break;Execution Count:32 | 32 |
| 267 | | - |
| 268 | case ((int) 'r'): | - |
| 269 | *ba += ((int) '('); | - |
| 270 | sub.closeCode = ((int) ')'); | - |
| 271 | break; executed: break;Execution Count:33 | 33 |
| 272 | } | 0 |
| 273 | else | - |
| 274 | q_dbus_message_iter_open_container(&iterator, code, signature, &sub.iterator); executed: q_dbus_message_iter_open_container(&iterator, code, signature, &sub.iterator);Execution Count:309 | 309 |
| 275 | } | - |
| 276 | | - |
| 277 | QDBusMarshaller *QDBusMarshaller::beginCommon(int code, const char *signature) | - |
| 278 | { | - |
| 279 | QDBusMarshaller *d = new QDBusMarshaller(capabilities); | - |
| 280 | open(*d, code, signature); | - |
| 281 | return d; executed: return d;Execution Count:185 | 185 |
| 282 | } | - |
| 283 | | - |
| 284 | inline QDBusMarshaller *QDBusMarshaller::endStructure() | - |
| 285 | { return endCommon(); } executed: return endCommon();Execution Count:65 | 65 |
| 286 | | - |
| 287 | inline QDBusMarshaller *QDBusMarshaller::endArray() | - |
| 288 | { return endCommon(); } executed: return endCommon();Execution Count:32 | 32 |
| 289 | | - |
| 290 | inline QDBusMarshaller *QDBusMarshaller::endMap() | - |
| 291 | { return endCommon(); } executed: return endCommon();Execution Count:34 | 34 |
| 292 | | - |
| 293 | inline QDBusMarshaller *QDBusMarshaller::endMapEntry() | - |
| 294 | { return endCommon(); } executed: return endCommon();Execution Count:54 | 54 |
| 295 | | - |
| 296 | QDBusMarshaller *QDBusMarshaller::endCommon() | - |
| 297 | { | - |
| 298 | QDBusMarshaller *retval = parent; | - |
| 299 | delete this; | - |
| 300 | return retval; executed: return retval;Execution Count:185 | 185 |
| 301 | } | - |
| 302 | | - |
| 303 | void QDBusMarshaller::close() | - |
| 304 | { | - |
| 305 | if (ba) { evaluated: ba| yes Evaluation Count:126 | yes Evaluation Count:2031 |
| 126-2031 |
| 306 | if (closeCode) evaluated: closeCode| yes Evaluation Count:33 | yes Evaluation Count:93 |
| 33-93 |
| 307 | *ba += closeCode; executed: *ba += closeCode;Execution Count:33 | 33 |
| 308 | } else if (parent) { executed: }Execution Count:126 evaluated: parent| yes Evaluation Count:309 | yes Evaluation Count:1722 |
| 126-1722 |
| 309 | q_dbus_message_iter_close_container(&parent->iterator, &iterator); | - |
| 310 | } executed: }Execution Count:309 | 309 |
| 311 | } | - |
| 312 | | - |
| 313 | void QDBusMarshaller::error(const QString &msg) | - |
| 314 | { | - |
| 315 | ok = false; | - |
| 316 | if (parent) | 0 |
| 317 | parent->error(msg); never executed: parent->error(msg); | 0 |
| 318 | else | - |
| 319 | errorString = msg; never executed: errorString = msg; | 0 |
| 320 | } | - |
| 321 | | - |
| 322 | bool QDBusMarshaller::appendVariantInternal(const QVariant &arg) | - |
| 323 | { | - |
| 324 | int id = arg.userType(); | - |
| 325 | if (id == QVariant::Invalid) { partially evaluated: id == QVariant::Invalid| no Evaluation Count:0 | yes Evaluation Count:1617 |
| 0-1617 |
| 326 | QMessageLogger("qdbusmarshaller.cpp", 369, __PRETTY_FUNCTION__).warning("QDBusMarshaller: cannot add an invalid QVariant"); | - |
| 327 | error(QLatin1String("Variant containing QVariant::Invalid passed in arguments")); | - |
| 328 | return false; never executed: return false; | 0 |
| 329 | } | - |
| 330 | | - |
| 331 | | - |
| 332 | if (id == QDBusMetaTypeId::argument()) { evaluated: id == QDBusMetaTypeId::argument()| yes Evaluation Count:2 | yes Evaluation Count:1615 |
| 2-1615 |
| 333 | QDBusArgument dbusargument = qvariant_cast<QDBusArgument>(arg); | - |
| 334 | QDBusArgumentPrivate *d = QDBusArgumentPrivate::d(dbusargument); | - |
| 335 | if (!d->message) partially evaluated: !d->message| no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
| 336 | return false; never executed: return false; | 0 |
| 337 | | - |
| 338 | QDBusDemarshaller demarshaller(capabilities); | - |
| 339 | demarshaller.message = q_dbus_message_ref(d->message); | - |
| 340 | | - |
| 341 | if (d->direction == Demarshalling) { partially evaluated: d->direction == Demarshalling| yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
| 342 | | - |
| 343 | demarshaller.iterator = static_cast<QDBusDemarshaller *>(d)->iterator; | - |
| 344 | } else { executed: }Execution Count:2 | 2 |
| 345 | | - |
| 346 | if (!q_dbus_message_iter_init(demarshaller.message, &demarshaller.iterator)) never evaluated: !q_dbus_message_iter_init(demarshaller.message, &demarshaller.iterator) | 0 |
| 347 | return false; never executed: return false; | 0 |
| 348 | } | 0 |
| 349 | | - |
| 350 | return appendCrossMarshalling(&demarshaller); executed: return appendCrossMarshalling(&demarshaller);Execution Count:2 | 2 |
| 351 | } | - |
| 352 | | - |
| 353 | const char *signature = QDBusMetaType::typeToSignature( QVariant::Type(id) ); | - |
| 354 | if (!signature) { partially evaluated: !signature| no Evaluation Count:0 | yes Evaluation Count:1615 |
| 0-1615 |
| 355 | QMessageLogger("qdbusmarshaller.cpp", 398, __PRETTY_FUNCTION__).warning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. " | - |
| 356 | "Use qDBusRegisterMetaType to register it", | - |
| 357 | QMetaType::typeName(id), id); | - |
| 358 | error(QString::fromLatin1("Unregistered type %1 passed in arguments") | - |
| 359 | .arg(QLatin1String(QMetaType::typeName(id)))); | - |
| 360 | return false; never executed: return false; | 0 |
| 361 | } | - |
| 362 | | - |
| 363 | switch (*signature) { | - |
| 364 | | - |
| 365 | case ((int) 'y'): | - |
| 366 | case ((int) 'n'): | - |
| 367 | case ((int) 'q'): | - |
| 368 | case ((int) 'i'): | - |
| 369 | case ((int) 'u'): | - |
| 370 | case ((int) 'x'): | - |
| 371 | case ((int) 't'): | - |
| 372 | case ((int) 'd'): | - |
| 373 | qIterAppend(&iterator, ba, *signature, arg.constData()); | - |
| 374 | return true; executed: return true;Execution Count:177 | 177 |
| 375 | case ((int) 'b'): | - |
| 376 | append( arg.toBool() ); | - |
| 377 | return true; never executed: return true; | 0 |
| 378 | case ((int) 's'): | - |
| 379 | append( arg.toString() ); | - |
| 380 | return true; executed: return true;Execution Count:1237 | 1237 |
| 381 | case ((int) 'o'): | - |
| 382 | append( qvariant_cast<QDBusObjectPath>(arg) ); | - |
| 383 | return true; never executed: return true; | 0 |
| 384 | case ((int) 'g'): | - |
| 385 | append( qvariant_cast<QDBusSignature>(arg) ); | - |
| 386 | return true; never executed: return true; | 0 |
| 387 | | - |
| 388 | | - |
| 389 | case ((int) 'v'): | - |
| 390 | | - |
| 391 | return append( qvariant_cast<QDBusVariant>(arg) ); executed: return append( qvariant_cast<QDBusVariant>(arg) );Execution Count:139 | 139 |
| 392 | | - |
| 393 | case ((int) 'a'): | - |
| 394 | | - |
| 395 | | - |
| 396 | switch (arg.type()) { | - |
| 397 | case QVariant::StringList: | - |
| 398 | append( arg.toStringList() ); | - |
| 399 | return true; executed: return true;Execution Count:2 | 2 |
| 400 | | - |
| 401 | case QVariant::ByteArray: | - |
| 402 | append( arg.toByteArray() ); | - |
| 403 | return true; executed: return true;Execution Count:6 | 6 |
| 404 | | - |
| 405 | default: | - |
| 406 | ; | - |
| 407 | } executed: }Execution Count:34 | 34 |
| 408 | | - |
| 409 | | - |
| 410 | case ((int) 'r'): | - |
| 411 | case ((int) '('): | - |
| 412 | return appendRegisteredType( arg ); executed: return appendRegisteredType( arg );Execution Count:54 | 54 |
| 413 | | - |
| 414 | case ((int) 'e'): | - |
| 415 | case ((int) '{'): | - |
| 416 | QMessageLogger("qdbusmarshaller.cpp", 489, __PRETTY_FUNCTION__).fatal("QDBusMarshaller::appendVariantInternal got a DICT_ENTRY!"); | - |
| 417 | return false; never executed: return false; | 0 |
| 418 | | - |
| 419 | case int('h'): | - |
| 420 | if (capabilities & QDBusConnection::UnixFileDescriptorPassing || ba) { never evaluated: capabilities & QDBusConnection::UnixFileDescriptorPassing | 0 |
| 421 | append(qvariant_cast<QDBusUnixFileDescriptor>(arg)); | - |
| 422 | return true; never executed: return true; | 0 |
| 423 | } | - |
| 424 | | - |
| 425 | | - |
| 426 | default: code before this statement never executed: default: | 0 |
| 427 | QMessageLogger("qdbusmarshaller.cpp", 500, __PRETTY_FUNCTION__).warning("QDBusMarshaller::appendVariantInternal: Found unknown D-BUS type '%s'", | - |
| 428 | signature); | - |
| 429 | return false; never executed: return false; | 0 |
| 430 | } | - |
| 431 | | - |
| 432 | return true; never executed: return true; | 0 |
| 433 | } | - |
| 434 | | - |
| 435 | bool QDBusMarshaller::appendRegisteredType(const QVariant &arg) | - |
| 436 | { | - |
| 437 | ref.ref(); | - |
| 438 | QDBusArgument self(QDBusArgumentPrivate::create(this)); | - |
| 439 | return QDBusMetaType::marshall(self, arg.userType(), arg.constData()); executed: return QDBusMetaType::marshall(self, arg.userType(), arg.constData());Execution Count:54 | 54 |
| 440 | } | - |
| 441 | | - |
| 442 | bool QDBusMarshaller::appendCrossMarshalling(QDBusDemarshaller *demarshaller) | - |
| 443 | { | - |
| 444 | int code = q_dbus_message_iter_get_arg_type(&demarshaller->iterator); | - |
| 445 | if (QDBusUtil::isValidBasicType(code)) { partially evaluated: QDBusUtil::isValidBasicType(code)| no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
| 446 | | - |
| 447 | | - |
| 448 | | - |
| 449 | | - |
| 450 | qlonglong value; | - |
| 451 | q_dbus_message_iter_get_basic(&demarshaller->iterator, &value); | - |
| 452 | q_dbus_message_iter_next(&demarshaller->iterator); | - |
| 453 | q_dbus_message_iter_append_basic(&iterator, code, &value); | - |
| 454 | return true; never executed: return true; | 0 |
| 455 | } | - |
| 456 | | - |
| 457 | if (code == ((int) 'a')) { partially evaluated: code == ((int) 'a')| yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
| 458 | int element = q_dbus_message_iter_get_element_type(&demarshaller->iterator); | - |
| 459 | if (QDBusUtil::isValidFixedType(element) && element != int('h')) { partially evaluated: QDBusUtil::isValidFixedType(element)| yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: element != int('h')| yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
| 460 | | - |
| 461 | | - |
| 462 | DBusMessageIter sub; | - |
| 463 | q_dbus_message_iter_recurse(&demarshaller->iterator, &sub); | - |
| 464 | q_dbus_message_iter_next(&demarshaller->iterator); | - |
| 465 | int len; | - |
| 466 | void* data; | - |
| 467 | q_dbus_message_iter_get_fixed_array(&sub,&data,&len); | - |
| 468 | | - |
| 469 | char signature[2] = { char(element), 0 }; | - |
| 470 | q_dbus_message_iter_open_container(&iterator, ((int) 'a'), signature, &sub); | - |
| 471 | q_dbus_message_iter_append_fixed_array(&sub, element, &data, len); | - |
| 472 | q_dbus_message_iter_close_container(&iterator, &sub); | - |
| 473 | | - |
| 474 | return true; executed: return true;Execution Count:2 | 2 |
| 475 | } | - |
| 476 | } | 0 |
| 477 | | - |
| 478 | | - |
| 479 | QDBusDemarshaller *drecursed = demarshaller->beginCommon(); | - |
| 480 | | - |
| 481 | QDBusMarshaller mrecursed(capabilities); | - |
| 482 | QByteArray subSignature; | - |
| 483 | const char *sig = 0; | - |
| 484 | if (code == ((int) 'v') || code == ((int) 'a')) { never evaluated: code == ((int) 'v') never evaluated: code == ((int) 'a') | 0 |
| 485 | subSignature = drecursed->currentSignature().toLatin1(); | - |
| 486 | if (!subSignature.isEmpty()) never evaluated: !subSignature.isEmpty() | 0 |
| 487 | sig = subSignature.constData(); never executed: sig = subSignature.constData(); | 0 |
| 488 | } | 0 |
| 489 | open(mrecursed, code, sig); | - |
| 490 | | - |
| 491 | while (!drecursed->atEnd()) { never evaluated: !drecursed->atEnd() | 0 |
| 492 | if (!mrecursed.appendCrossMarshalling(drecursed)) { never evaluated: !mrecursed.appendCrossMarshalling(drecursed) | 0 |
| 493 | delete drecursed; | - |
| 494 | return false; never executed: return false; | 0 |
| 495 | } | - |
| 496 | } | 0 |
| 497 | | - |
| 498 | delete drecursed; | - |
| 499 | return true; never executed: return true; | 0 |
| 500 | } | - |
| 501 | | - |
| 502 | | - |
| 503 | | - |
| | |