| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/dbus/qdbusserver.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | QDBusServer::QDBusServer(const QString &address, QObject *parent) | - | ||||||||||||
| 6 | : QObject(parent), d(0) | - | ||||||||||||
| 7 | { | - | ||||||||||||
| 8 | if (address.isEmpty()
| 0 | ||||||||||||
| 9 | return; never executed: return; | 0 | ||||||||||||
| 10 | - | |||||||||||||
| 11 | if (!qdbus_loadLibDBus()
| 0 | ||||||||||||
| 12 | return; never executed: return; | 0 | ||||||||||||
| 13 | - | |||||||||||||
| 14 | QDBusConnectionManager::instance()->serverRequested(address, this); | - | ||||||||||||
| 15 | QObject::connect(d, qFlagLocation("2""newServerConnection(QDBusConnectionPrivate*)" "\0" __FILE__ ":" "72"), | - | ||||||||||||
| 16 | this, qFlagLocation("1""_q_newConnection(QDBusConnectionPrivate*)" "\0" __FILE__ ":" "73"), Qt::QueuedConnection); | - | ||||||||||||
| 17 | } never executed: end of block | 0 | ||||||||||||
| 18 | - | |||||||||||||
| 19 | - | |||||||||||||
| 20 | - | |||||||||||||
| 21 | - | |||||||||||||
| 22 | - | |||||||||||||
| 23 | - | |||||||||||||
| 24 | QDBusServer::QDBusServer(QObject *parent) | - | ||||||||||||
| 25 | : QObject(parent) | - | ||||||||||||
| 26 | { | - | ||||||||||||
| 27 | - | |||||||||||||
| 28 | - | |||||||||||||
| 29 | const QString address = ([]() -> QString { enum { Size = sizeof(u"" "unix:tmpdir=/tmp")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "unix:tmpdir=/tmp" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 20 times by 6 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 20 times by 6 tests: }());return qstring_literal_temp;Executed by:
| 20 | ||||||||||||
| 30 | - | |||||||||||||
| 31 | - | |||||||||||||
| 32 | - | |||||||||||||
| 33 | - | |||||||||||||
| 34 | if (!qdbus_loadLibDBus()
| 0-20 | ||||||||||||
| 35 | d = 0; | - | ||||||||||||
| 36 | return; never executed: return; | 0 | ||||||||||||
| 37 | } | - | ||||||||||||
| 38 | - | |||||||||||||
| 39 | QDBusConnectionManager::instance()->serverRequested(address, this); | - | ||||||||||||
| 40 | QObject::connect(d, qFlagLocation("2""newServerConnection(QDBusConnectionPrivate*)" "\0" __FILE__ ":" "97"), | - | ||||||||||||
| 41 | this, qFlagLocation("1""_q_newConnection(QDBusConnectionPrivate*)" "\0" __FILE__ ":" "98"), Qt::QueuedConnection); | - | ||||||||||||
| 42 | } executed 20 times by 6 tests: end of blockExecuted by:
| 20 | ||||||||||||
| 43 | - | |||||||||||||
| 44 | - | |||||||||||||
| 45 | - | |||||||||||||
| 46 | - | |||||||||||||
| 47 | QDBusServer::~QDBusServer() | - | ||||||||||||
| 48 | { | - | ||||||||||||
| 49 | QWriteLocker locker(&d->lock); | - | ||||||||||||
| 50 | if (QDBusConnectionManager::instance()
| 0-20 | ||||||||||||
| 51 | QMutexLocker locker(&QDBusConnectionManager::instance()->mutex); | - | ||||||||||||
| 52 | for (const QString &name : qAsConst(d->serverConnectionNames)) | - | ||||||||||||
| 53 | QDBusConnectionManager::instance()->removeConnection(name); executed 158 times by 6 tests: QDBusConnectionManager::instance()->removeConnection(name);Executed by:
| 158 | ||||||||||||
| 54 | d->serverConnectionNames.clear(); | - | ||||||||||||
| 55 | } executed 20 times by 6 tests: end of blockExecuted by:
| 20 | ||||||||||||
| 56 | d->serverObject = nullptr; | - | ||||||||||||
| 57 | d->ref.store(0); | - | ||||||||||||
| 58 | d->deleteLater(); | - | ||||||||||||
| 59 | } executed 20 times by 6 tests: end of blockExecuted by:
| 20 | ||||||||||||
| 60 | - | |||||||||||||
| 61 | - | |||||||||||||
| 62 | - | |||||||||||||
| 63 | - | |||||||||||||
| 64 | - | |||||||||||||
| 65 | - | |||||||||||||
| 66 | bool QDBusServer::isConnected() const | - | ||||||||||||
| 67 | { | - | ||||||||||||
| 68 | return executed 37 times by 5 tests: d && d->server && q_dbus_server_get_is_connected(d->server);return d && d->server && q_dbus_server_get_is_connected(d->server);Executed by:
executed 37 times by 5 tests: return d && d->server && q_dbus_server_get_is_connected(d->server);Executed by:
| 37 | ||||||||||||
| 69 | } | - | ||||||||||||
| 70 | - | |||||||||||||
| 71 | - | |||||||||||||
| 72 | - | |||||||||||||
| 73 | - | |||||||||||||
| 74 | - | |||||||||||||
| 75 | - | |||||||||||||
| 76 | QDBusError QDBusServer::lastError() const | - | ||||||||||||
| 77 | { | - | ||||||||||||
| 78 | return never executed: d ? d->lastError : QDBusError(QDBusError::Disconnected, QDBusUtil::disconnectedErrorMessage());return d ? d->lastError : QDBusError(QDBusError::Disconnected, QDBusUtil::disconnectedErrorMessage());never executed: return d ? d->lastError : QDBusError(QDBusError::Disconnected, QDBusUtil::disconnectedErrorMessage()); | 0 | ||||||||||||
| 79 | } | - | ||||||||||||
| 80 | - | |||||||||||||
| 81 | - | |||||||||||||
| 82 | - | |||||||||||||
| 83 | - | |||||||||||||
| 84 | QString QDBusServer::address() const | - | ||||||||||||
| 85 | { | - | ||||||||||||
| 86 | QString addr; | - | ||||||||||||
| 87 | if (d
| 0-40 | ||||||||||||
| 88 | char *c = q_dbus_server_get_address(d->server); | - | ||||||||||||
| 89 | addr = QString::fromUtf8(c); | - | ||||||||||||
| 90 | q_dbus_free(c); | - | ||||||||||||
| 91 | } executed 40 times by 6 tests: end of blockExecuted by:
| 40 | ||||||||||||
| 92 | - | |||||||||||||
| 93 | return executed 40 times by 6 tests: addr;return addr;Executed by:
executed 40 times by 6 tests: return addr;Executed by:
| 40 | ||||||||||||
| 94 | } | - | ||||||||||||
| 95 | void QDBusServer::setAnonymousAuthenticationAllowed(bool value) | - | ||||||||||||
| 96 | { | - | ||||||||||||
| 97 | d->anonymousAuthenticationAllowed = value; | - | ||||||||||||
| 98 | } never executed: end of block | 0 | ||||||||||||
| 99 | bool QDBusServer::isAnonymousAuthenticationAllowed() const | - | ||||||||||||
| 100 | { | - | ||||||||||||
| 101 | return never executed: d->anonymousAuthenticationAllowed;return d->anonymousAuthenticationAllowed;never executed: return d->anonymousAuthenticationAllowed; | 0 | ||||||||||||
| 102 | } | - | ||||||||||||
| 103 | - | |||||||||||||
| 104 | - | |||||||||||||
| Switch to Source code | Preprocessed file |