Changeset View
Changeset View
Standalone View
Standalone View
src/upnp/upnpcontrolcontentdirectory.cpp
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU Library General Public License | 14 | * You should have received a copy of the GNU Library General Public License | ||
15 | * along with this library; see the file COPYING.LIB. If not, write to | 15 | * along with this library; see the file COPYING.LIB. If not, write to | ||
16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "upnpcontrolcontentdirectory.h" | 20 | #include "upnpcontrolcontentdirectory.h" | ||
21 | 21 | | |||
22 | #include "upnpLogging.h" | ||||
23 | | ||||
22 | #include "upnpcontrolabstractservicereply.h" | 24 | #include "upnpcontrolabstractservicereply.h" | ||
23 | 25 | | |||
24 | #include <KDSoapClient/KDSoapPendingCall.h> | 26 | #include <KDSoapClient/KDSoapPendingCall.h> | ||
25 | #include <KDSoapClient/KDSoapPendingCallWatcher.h> | 27 | #include <KDSoapClient/KDSoapPendingCallWatcher.h> | ||
26 | 28 | | |||
27 | #include <QDebug> | 29 | #include <QLoggingCategory> | ||
28 | 30 | | |||
29 | class UpnpControlContentDirectoryPrivate | 31 | class UpnpControlContentDirectoryPrivate | ||
30 | { | 32 | { | ||
31 | public: | 33 | public: | ||
32 | 34 | | |||
33 | QString mSearchCapabilities; | 35 | QString mSearchCapabilities; | ||
34 | 36 | | |||
35 | QString mTransferIDs; | 37 | QString mTransferIDs; | ||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 120 | { | |||
123 | QString searchCaps; | 125 | QString searchCaps; | ||
124 | 126 | | |||
125 | for (KDSoapValue oneValue : allValues) { | 127 | for (KDSoapValue oneValue : allValues) { | ||
126 | if (oneValue.name() == QStringLiteral("SearchCaps")) { | 128 | if (oneValue.name() == QStringLiteral("SearchCaps")) { | ||
127 | searchCaps = oneValue.value().toString(); | 129 | searchCaps = oneValue.value().toString(); | ||
128 | } | 130 | } | ||
129 | } | 131 | } | ||
130 | 132 | | |||
131 | qDebug() << "SearchCaps:" << searchCaps; | 133 | qCDebug(orgKdeElisaUpnp()) << "SearchCaps:" << searchCaps; | ||
132 | 134 | | |||
133 | //Q_EMIT getSearchCapabilitiesFinished(searchCaps, !self->returnMessage().isFault()); | 135 | //Q_EMIT getSearchCapabilitiesFinished(searchCaps, !self->returnMessage().isFault()); | ||
134 | } | 136 | } | ||
135 | 137 | | |||
136 | void UpnpControlContentDirectory::finishedGetSortCapabilitiesCall(KDSoapPendingCallWatcher *self) | 138 | void UpnpControlContentDirectory::finishedGetSortCapabilitiesCall(KDSoapPendingCallWatcher *self) | ||
137 | { | 139 | { | ||
138 | self->deleteLater(); | 140 | self->deleteLater(); | ||
139 | 141 | | |||
140 | auto answer = self->returnMessage(); | 142 | auto answer = self->returnMessage(); | ||
141 | auto allValues = answer.childValues(); | 143 | auto allValues = answer.childValues(); | ||
142 | QString sortCaps; | 144 | QString sortCaps; | ||
143 | 145 | | |||
144 | for (KDSoapValue oneValue : allValues) { | 146 | for (KDSoapValue oneValue : allValues) { | ||
145 | if (oneValue.name() == QStringLiteral("SortCaps")) { | 147 | if (oneValue.name() == QStringLiteral("SortCaps")) { | ||
146 | sortCaps = oneValue.value().toString(); | 148 | sortCaps = oneValue.value().toString(); | ||
147 | } | 149 | } | ||
148 | } | 150 | } | ||
149 | 151 | | |||
150 | qDebug() << "SortCaps:" << sortCaps; | 152 | qCDebug(orgKdeElisaUpnp()) << "SortCaps:" << sortCaps; | ||
151 | 153 | | |||
152 | //Q_EMIT getSortCapabilitiesFinished(sortCaps, !self->returnMessage().isFault()); | 154 | //Q_EMIT getSortCapabilitiesFinished(sortCaps, !self->returnMessage().isFault()); | ||
153 | } | 155 | } | ||
154 | 156 | | |||
155 | void UpnpControlContentDirectory::finishedGetSystemUpdateIDCall(KDSoapPendingCallWatcher *self) | 157 | void UpnpControlContentDirectory::finishedGetSystemUpdateIDCall(KDSoapPendingCallWatcher *self) | ||
156 | { | 158 | { | ||
157 | self->deleteLater(); | 159 | self->deleteLater(); | ||
158 | 160 | | |||
159 | auto answer = self->returnMessage(); | 161 | auto answer = self->returnMessage(); | ||
160 | auto allValues = answer.childValues(); | 162 | auto allValues = answer.childValues(); | ||
161 | 163 | | |||
162 | for (KDSoapValue oneValue : allValues) { | 164 | for (KDSoapValue oneValue : allValues) { | ||
163 | if (oneValue.name() == QStringLiteral("Id")) { | 165 | if (oneValue.name() == QStringLiteral("Id")) { | ||
164 | d->mSystemUpdateID = oneValue.value().toInt(); | 166 | d->mSystemUpdateID = oneValue.value().toInt(); | ||
165 | } | 167 | } | ||
166 | } | 168 | } | ||
167 | 169 | | |||
168 | qDebug() << "Id:" << d->mSystemUpdateID; | 170 | qCDebug(orgKdeElisaUpnp()) << "Id:" << d->mSystemUpdateID; | ||
169 | 171 | | |||
170 | //Q_EMIT getSystemUpdateIDFinished(d->mSystemUpdateID, !self->returnMessage().isFault()); | 172 | //Q_EMIT getSystemUpdateIDFinished(d->mSystemUpdateID, !self->returnMessage().isFault()); | ||
171 | } | 173 | } | ||
172 | 174 | | |||
173 | void UpnpControlContentDirectory::finishedSearchCall(KDSoapPendingCallWatcher *self) | 175 | void UpnpControlContentDirectory::finishedSearchCall(KDSoapPendingCallWatcher *self) | ||
174 | { | 176 | { | ||
175 | qDebug() << "UpnpControlContentDirectory::finishedSearchCall"; | 177 | qCDebug(orgKdeElisaUpnp()) << "UpnpControlContentDirectory::finishedSearchCall"; | ||
176 | self->deleteLater(); | 178 | self->deleteLater(); | ||
177 | 179 | | |||
178 | auto answer = self->returnMessage(); | 180 | auto answer = self->returnMessage(); | ||
179 | auto allValues = answer.childValues(); | 181 | auto allValues = answer.childValues(); | ||
180 | QString result; | 182 | QString result; | ||
181 | int numberReturned = 0; | 183 | int numberReturned = 0; | ||
182 | int totalMatches = 0; | 184 | int totalMatches = 0; | ||
183 | 185 | | |||
184 | for (KDSoapValue oneValue : allValues) { | 186 | for (KDSoapValue oneValue : allValues) { | ||
185 | if (oneValue.name() == QStringLiteral("Result")) { | 187 | if (oneValue.name() == QStringLiteral("Result")) { | ||
186 | result = oneValue.value().toString(); | 188 | result = oneValue.value().toString(); | ||
187 | } | 189 | } | ||
188 | if (oneValue.name() == QStringLiteral("NumberReturned")) { | 190 | if (oneValue.name() == QStringLiteral("NumberReturned")) { | ||
189 | numberReturned = oneValue.value().toInt(); | 191 | numberReturned = oneValue.value().toInt(); | ||
190 | } | 192 | } | ||
191 | if (oneValue.name() == QStringLiteral("TotalMatches")) { | 193 | if (oneValue.name() == QStringLiteral("TotalMatches")) { | ||
192 | totalMatches = oneValue.value().toInt(); | 194 | totalMatches = oneValue.value().toInt(); | ||
193 | } | 195 | } | ||
194 | if (oneValue.name() == QStringLiteral("UpdateID")) { | 196 | if (oneValue.name() == QStringLiteral("UpdateID")) { | ||
195 | d->mSystemUpdateID = oneValue.value().toInt(); | 197 | d->mSystemUpdateID = oneValue.value().toInt(); | ||
196 | } | 198 | } | ||
197 | } | 199 | } | ||
198 | 200 | | |||
199 | //qDebug() << "Result:" << result; | 201 | //qCDebug(orgKdeElisaUpnp()) << "Result:" << result; | ||
200 | qDebug() << "NumberReturned:" << numberReturned; | 202 | qCDebug(orgKdeElisaUpnp()) << "NumberReturned:" << numberReturned; | ||
201 | qDebug() << "TotalMatches:" << totalMatches; | 203 | qCDebug(orgKdeElisaUpnp()) << "TotalMatches:" << totalMatches; | ||
202 | qDebug() << "UpdateID:" << d->mSystemUpdateID; | 204 | qCDebug(orgKdeElisaUpnp()) << "UpdateID:" << d->mSystemUpdateID; | ||
203 | 205 | | |||
204 | //Q_EMIT searchFinished(result, numberReturned, totalMatches, d->mSystemUpdateID, !self->returnMessage().isFault()); | 206 | //Q_EMIT searchFinished(result, numberReturned, totalMatches, d->mSystemUpdateID, !self->returnMessage().isFault()); | ||
205 | } | 207 | } | ||
206 | 208 | | |||
207 | void UpnpControlContentDirectory::finishedBrowseCall(KDSoapPendingCallWatcher *self) | 209 | void UpnpControlContentDirectory::finishedBrowseCall(KDSoapPendingCallWatcher *self) | ||
208 | { | 210 | { | ||
209 | self->deleteLater(); | 211 | self->deleteLater(); | ||
210 | 212 | | |||
Show All 13 Lines | 219 | for (KDSoapValue oneValue : allValues) { | |||
224 | if (oneValue.name() == QStringLiteral("TotalMatches")) { | 226 | if (oneValue.name() == QStringLiteral("TotalMatches")) { | ||
225 | totalMatches = oneValue.value().toInt(); | 227 | totalMatches = oneValue.value().toInt(); | ||
226 | } | 228 | } | ||
227 | if (oneValue.name() == QStringLiteral("UpdateID")) { | 229 | if (oneValue.name() == QStringLiteral("UpdateID")) { | ||
228 | d->mSystemUpdateID = oneValue.value().toInt(); | 230 | d->mSystemUpdateID = oneValue.value().toInt(); | ||
229 | } | 231 | } | ||
230 | } | 232 | } | ||
231 | 233 | | |||
232 | //qDebug() << "Result:" << result; | 234 | //qCDebug(orgKdeElisaUpnp()) << "Result:" << result; | ||
233 | //qDebug() << "NumberReturned:" << numberReturned; | 235 | //qCDebug(orgKdeElisaUpnp()) << "NumberReturned:" << numberReturned; | ||
234 | //qDebug() << "TotalMatches:" << totalMatches; | 236 | //qCDebug(orgKdeElisaUpnp()) << "TotalMatches:" << totalMatches; | ||
235 | //qDebug() << "UpdateID:" << d->mSystemUpdateID; | 237 | //qCDebug(orgKdeElisaUpnp()) << "UpdateID:" << d->mSystemUpdateID; | ||
236 | 238 | | |||
237 | //Q_EMIT browseFinished(result, numberReturned, totalMatches, d->mSystemUpdateID, !self->returnMessage().isFault()); | 239 | //Q_EMIT browseFinished(result, numberReturned, totalMatches, d->mSystemUpdateID, !self->returnMessage().isFault()); | ||
238 | } | 240 | } | ||
239 | #endif | 241 | #endif | ||
240 | 242 | | |||
241 | void UpnpControlContentDirectory::parseServiceDescription(QIODevice *serviceDescriptionContent) | 243 | void UpnpControlContentDirectory::parseServiceDescription(QIODevice *serviceDescriptionContent) | ||
242 | { | 244 | { | ||
243 | UpnpControlAbstractService::parseServiceDescription(serviceDescriptionContent); | 245 | UpnpControlAbstractService::parseServiceDescription(serviceDescriptionContent); | ||
Show All 22 Lines |