qdbusconnectioninterface.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7const char *QDBusConnectionInterface::staticInterfaceName() -
8{ return "org.freedesktop.DBus"; }
never executed: return "org.freedesktop.DBus";
0
9 -
10 -
11 -
12 -
13QDBusConnectionInterface::QDBusConnectionInterface(const QDBusConnection &connection, -
14 QObject *parent) -
15 : QDBusAbstractInterface(QLatin1String("org.freedesktop.DBus"), -
16 QLatin1String("/org/freedesktop/DBus"), -
17 "org.freedesktop.DBus", connection, parent) -
18{ -
19 connect(this, "2""NameAcquired(QString)", this, "2""serviceRegistered(QString)"); -
20 connect(this, "2""NameLost(QString)", this, "2""serviceUnregistered(QString)"); -
21 connect(this, "2""NameOwnerChanged(QString,QString,QString)", -
22 this, "2""serviceOwnerChanged(QString,QString,QString)"); -
23}
executed: }
Execution Count:25
25
24 -
25 -
26 -
27 -
28QDBusConnectionInterface::~QDBusConnectionInterface() -
29{ -
30} -
31 -
32 -
33 -
34 -
35 -
36 -
37QDBusReply<QString> QDBusConnectionInterface::serviceOwner(const QString &name) const -
38{ -
39 return internalConstCall(QDBus::AutoDetect, QLatin1String("GetNameOwner"), QList<QVariant>() << name);
never executed: return internalConstCall(QDBus::AutoDetect, QLatin1String("GetNameOwner"), QList<QVariant>() << name);
0
40} -
41 -
42 -
43 -
44 -
45 -
46 -
47 -
48QDBusReply<QStringList> QDBusConnectionInterface::registeredServiceNames() const -
49{ -
50 return internalConstCall(QDBus::AutoDetect, QLatin1String("ListNames"));
executed: return internalConstCall(QDBus::AutoDetect, QLatin1String("ListNames"));
Execution Count:3
3
51} -
52 -
53 -
54 -
55 -
56 -
57QDBusReply<bool> QDBusConnectionInterface::isServiceRegistered(const QString &serviceName) const -
58{ -
59 return internalConstCall(QDBus::AutoDetect, QLatin1String("NameHasOwner"), 744
60 QList<QVariant>() << serviceName);
executed: return internalConstCall(QDBus::AutoDetect, QLatin1String("NameHasOwner"), QList<QVariant>() << serviceName);
Execution Count:744
744
61} -
62 -
63 -
64 -
65 -
66 -
67QDBusReply<uint> QDBusConnectionInterface::servicePid(const QString &serviceName) const -
68{ -
69 return internalConstCall(QDBus::AutoDetect, QLatin1String("GetConnectionUnixProcessID"), 0
70 QList<QVariant>() << serviceName);
never executed: return internalConstCall(QDBus::AutoDetect, QLatin1String("GetConnectionUnixProcessID"), QList<QVariant>() << serviceName);
0
71} -
72 -
73 -
74 -
75 -
76 -
77QDBusReply<uint> QDBusConnectionInterface::serviceUid(const QString &serviceName) const -
78{ -
79 return internalConstCall(QDBus::AutoDetect, QLatin1String("GetConnectionUnixUser"), 0
80 QList<QVariant>() << serviceName);
never executed: return internalConstCall(QDBus::AutoDetect, QLatin1String("GetConnectionUnixUser"), QList<QVariant>() << serviceName);
0
81} -
82 -
83 -
84 -
85 -
86QDBusReply<void> QDBusConnectionInterface::startService(const QString &name) -
87{ -
88 return call(QLatin1String("StartServiceByName"), name, uint(0));
never executed: return call(QLatin1String("StartServiceByName"), name, uint(0));
0
89} -
90QDBusReply<QDBusConnectionInterface::RegisterServiceReply> -
91QDBusConnectionInterface::registerService(const QString &serviceName, -
92 ServiceQueueOptions qoption, -
93 ServiceReplacementOptions roption) -
94{ -
95 -
96 uint flags = 0; -
97 switch (qoption) { -
98 case DontQueueService: -
99 flags = 0x4; -
100 break;
executed: break;
Execution Count:20
20
101 case QueueService: -
102 flags = 0; -
103 break;
never executed: break;
0
104 case ReplaceExistingService: -
105 flags = 0x4 | 0x2; -
106 break;
never executed: break;
0
107 } -
108 -
109 switch (roption) { -
110 case DontAllowReplacement: -
111 break;
executed: break;
Execution Count:20
20
112 case AllowReplacement: -
113 flags |= 0x1; -
114 break;
never executed: break;
0
115 } -
116 -
117 QDBusMessage reply = call(QLatin1String("RequestName"), serviceName, flags); -
118 -
119 -
120 -
121 if (reply.type() == QDBusMessage::ReplyMessage) {
partially evaluated: reply.type() == QDBusMessage::ReplyMessage
TRUEFALSE
yes
Evaluation Count:20
no
Evaluation Count:0
0-20
122 uint code = 0; -
123 -
124 switch (reply.arguments().at(0).toUInt()) { -
125 case 1: -
126 case 4: -
127 code = uint(ServiceRegistered); -
128 break;
executed: break;
Execution Count:20
20
129 -
130 case 3: -
131 code = uint(ServiceNotRegistered); -
132 break;
never executed: break;
0
133 -
134 case 2: -
135 code = uint(ServiceQueued); -
136 break;
never executed: break;
0
137 } -
138 -
139 reply.setArguments(QVariantList() << code); -
140 }
executed: }
Execution Count:20
20
141 -
142 return reply;
executed: return reply;
Execution Count:20
20
143} -
144QDBusReply<bool> -
145QDBusConnectionInterface::unregisterService(const QString &serviceName) -
146{ -
147 QDBusMessage reply = call(QLatin1String("ReleaseName"), serviceName); -
148 if (reply.type() == QDBusMessage::ReplyMessage) {
partially evaluated: reply.type() == QDBusMessage::ReplyMessage
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
0-8
149 bool success = reply.arguments().at(0).toUInt() == 1; -
150 reply.setArguments(QVariantList() << success); -
151 }
executed: }
Execution Count:8
8
152 return reply;
executed: return reply;
Execution Count:8
8
153} -
154 -
155 -
156 -
157 -
158void QDBusConnectionInterface::connectNotify(const QMetaMethod &signal) -
159{ -
160 -
161 -
162 static const QMetaMethod serviceRegisteredSignal = QMetaMethod::fromSignal(&QDBusConnectionInterface::serviceRegistered); -
163 static const QMetaMethod serviceUnregisteredSignal = QMetaMethod::fromSignal(&QDBusConnectionInterface::serviceUnregistered); -
164 static const QMetaMethod serviceOwnerChangedSignal = QMetaMethod::fromSignal(&QDBusConnectionInterface::serviceOwnerChanged); -
165 static const QMetaMethod NameAcquiredSignal = QMetaMethod::fromSignal(&QDBusConnectionInterface::NameAcquired); -
166 static const QMetaMethod NameLostSignal = QMetaMethod::fromSignal(&QDBusConnectionInterface::NameLost); -
167 static const QMetaMethod NameOwnerChangedSignal = QMetaMethod::fromSignal(&QDBusConnectionInterface::NameOwnerChanged); -
168 if (signal == serviceRegisteredSignal)
partially evaluated: signal == serviceRegisteredSignal
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:78
0-78
169 QDBusAbstractInterface::connectNotify(NameAcquiredSignal);
never executed: QDBusAbstractInterface::connectNotify(NameAcquiredSignal);
0
170 -
171 else if (signal == serviceUnregisteredSignal)
partially evaluated: signal == serviceUnregisteredSignal
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:78
0-78
172 QDBusAbstractInterface::connectNotify(NameLostSignal);
never executed: QDBusAbstractInterface::connectNotify(NameLostSignal);
0
173 -
174 else if (signal == serviceOwnerChangedSignal) {
evaluated: signal == serviceOwnerChangedSignal
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:75
3-75
175 static bool warningPrinted = false; -
176 if (!warningPrinted) {
evaluated: !warningPrinted
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
1-2
177 QMessageLogger("qdbusconnectioninterface.cpp", 351, __PRETTY_FUNCTION__).warning("Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)"); -
178 warningPrinted = true; -
179 }
executed: }
Execution Count:2
2
180 QDBusAbstractInterface::connectNotify(NameOwnerChangedSignal); -
181 }
executed: }
Execution Count:3
3
182} -
183 -
184 -
185 -
186 -
187void QDBusConnectionInterface::disconnectNotify(const QMetaMethod &signal) -
188{ -
189 -
190 -
191 static const QMetaMethod serviceRegisteredSignal = QMetaMethod::fromSignal(&QDBusConnectionInterface::serviceRegistered); -
192 static const QMetaMethod serviceUnregisteredSignal = QMetaMethod::fromSignal(&QDBusConnectionInterface::serviceUnregistered); -
193 static const QMetaMethod serviceOwnerChangedSignal = QMetaMethod::fromSignal(&QDBusConnectionInterface::serviceOwnerChanged); -
194 static const QMetaMethod NameAcquiredSignal = QMetaMethod::fromSignal(&QDBusConnectionInterface::NameAcquired); -
195 static const QMetaMethod NameLostSignal = QMetaMethod::fromSignal(&QDBusConnectionInterface::NameLost); -
196 static const QMetaMethod NameOwnerChangedSignal = QMetaMethod::fromSignal(&QDBusConnectionInterface::NameOwnerChanged); -
197 if (signal == serviceRegisteredSignal)
partially evaluated: signal == serviceRegisteredSignal
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:25
0-25
198 QDBusAbstractInterface::disconnectNotify(NameAcquiredSignal);
never executed: QDBusAbstractInterface::disconnectNotify(NameAcquiredSignal);
0
199 -
200 else if (signal == serviceUnregisteredSignal)
partially evaluated: signal == serviceUnregisteredSignal
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:25
0-25
201 QDBusAbstractInterface::disconnectNotify(NameLostSignal);
never executed: QDBusAbstractInterface::disconnectNotify(NameLostSignal);
0
202 -
203 else if (signal == serviceOwnerChangedSignal)
evaluated: signal == serviceOwnerChangedSignal
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:22
3-22
204 QDBusAbstractInterface::disconnectNotify(NameOwnerChangedSignal);
executed: QDBusAbstractInterface::disconnectNotify(NameOwnerChangedSignal);
Execution Count:3
3
205} -
206 -
207 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial