Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | QDBusServer::QDBusServer(const QString &address, QObject *parent) | - |
6 | : QObject(parent) | - |
7 | { | - |
8 | if (address.isEmpty()) partially evaluated: address.isEmpty() no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
9 | return; | 0 |
10 | | - |
11 | if (!qdbus_loadLibDBus()) { partially evaluated: !qdbus_loadLibDBus() no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
12 | d = 0; | - |
13 | return; | 0 |
14 | } | - |
15 | d = new QDBusConnectionPrivate(this); | - |
16 | | - |
17 | QObject::connect(d, "2""newServerConnection(QDBusConnection)", | - |
18 | this, "2""newConnection(QDBusConnection)"); | - |
19 | | - |
20 | QDBusErrorInternal error; | - |
21 | d->setServer(q_dbus_server_listen(address.toUtf8().constData(), error), error); | - |
22 | } executed: } Execution Count:8 | 8 |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | QDBusServer::QDBusServer(QObject *parent) | - |
29 | : QObject(parent) | - |
30 | { | - |
31 | const QString address = QLatin1String("unix:tmpdir=/tmp"); | - |
32 | | - |
33 | if (!qdbus_loadLibDBus()) { never evaluated: !qdbus_loadLibDBus() | 0 |
34 | d = 0; | - |
35 | return; | 0 |
36 | } | - |
37 | d = new QDBusConnectionPrivate(this); | - |
38 | | - |
39 | QObject::connect(d, "2""newServerConnection(QDBusConnection)", | - |
40 | this, "2""newConnection(QDBusConnection)"); | - |
41 | | - |
42 | QDBusErrorInternal error; | - |
43 | d->setServer(q_dbus_server_listen(address.toUtf8().constData(), error), error); | - |
44 | } | 0 |
45 | | - |
46 | | - |
47 | | - |
48 | | - |
49 | QDBusServer::~QDBusServer() | - |
50 | { | - |
51 | if (QDBusConnectionManager::instance()) { partially evaluated: QDBusConnectionManager::instance() yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
52 | QMutexLocker locker(&QDBusConnectionManager::instance()->mutex); | - |
53 | for (QForeachContainer<__typeof__(d->serverConnectionNames)> _container_(d->serverConnectionNames); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QString &name = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
54 | QDBusConnectionManager::instance()->removeConnection(name); | - |
55 | } executed: } Execution Count:17 | 17 |
56 | d->serverConnectionNames.clear(); | - |
57 | } executed: } Execution Count:8 | 8 |
58 | } executed: } Execution Count:8 | 8 |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | | - |
64 | | - |
65 | bool QDBusServer::isConnected() const | - |
66 | { | - |
67 | return d && d->server && q_dbus_server_get_is_connected(d->server); executed: return d && d->server && q_dbus_server_get_is_connected(d->server); Execution Count:17 | 17 |
68 | } | - |
69 | | - |
70 | | - |
71 | | - |
72 | | - |
73 | | - |
74 | | - |
75 | QDBusError QDBusServer::lastError() const | - |
76 | { | - |
77 | return d->lastError; never executed: return d->lastError; | 0 |
78 | } | - |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | QString QDBusServer::address() const | - |
84 | { | - |
85 | QString addr; | - |
86 | if (d && d->server) { partially evaluated: d yes Evaluation Count:18 | no Evaluation Count:0 |
partially evaluated: d->server yes Evaluation Count:18 | no Evaluation Count:0 |
| 0-18 |
87 | char *c = q_dbus_server_get_address(d->server); | - |
88 | addr = QString::fromUtf8(c); | - |
89 | q_dbus_free(c); | - |
90 | } executed: } Execution Count:18 | 18 |
91 | | - |
92 | return addr; executed: return addr; Execution Count:18 | 18 |
93 | } | - |
94 | | - |
95 | | - |
| | |