KD SOAP API Documentation  2.2
KDSoapJob.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Soap project.
4 **
5 ** SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
11 #include "KDSoapJob.h"
12 #include "KDSoapMessage.h"
13 
14 class KDSoapJob::Private
15 {
16 public:
20  bool isAutoDelete;
21 };
22 
23 KDSoapJob::KDSoapJob(QObject *parent)
24  : QObject(parent)
25  , d(new Private)
26 {
27  d->isAutoDelete = true;
28 }
29 
31 {
32  delete d;
33 }
34 
36 {
37  return d->requestHeaders;
38 }
39 
41 {
42  d->requestHeaders = headers;
43 }
44 
46 {
47  QMetaObject::invokeMethod(this, "doStart", Qt::QueuedConnection);
48 }
49 
50 void KDSoapJob::setAutoDelete(bool enable)
51 {
52  d->isAutoDelete = enable;
53 }
54 
55 void KDSoapJob::emitFinished(const KDSoapMessage &reply, const KDSoapHeaders &replyHeaders)
56 {
57  d->reply = reply;
58  d->replyHeaders = replyHeaders;
59  emit finished(this);
60  if (d->isAutoDelete) {
61  deleteLater();
62  }
63 }
64 
66 {
67  return d->reply;
68 }
69 
71 {
72  return d->replyHeaders;
73 }
74 
75 bool KDSoapJob::isFault() const
76 {
77  return d->reply.isFault();
78 }
79 
80 QString KDSoapJob::faultAsString() const
81 {
82  if (d->reply.isFault()) {
83  return d->reply.faultAsString();
84  } else {
85  return QString();
86  }
87 }
88 
89 #include "moc_KDSoapJob.cpp"
void start()
Definition: KDSoapJob.cpp:45
KDSoapHeaders replyHeaders() const
Definition: KDSoapJob.cpp:70
KDSoapMessage reply() const
Definition: KDSoapJob.cpp:65
bool isFault() const
Definition: KDSoapJob.cpp:75
KDSoapHeaders requestHeaders() const
Definition: KDSoapJob.cpp:35
KDSoapJob(QObject *parent=nullptr)
Definition: KDSoapJob.cpp:23
void emitFinished(const KDSoapMessage &reply, const KDSoapHeaders &replyHeaders)
Definition: KDSoapJob.cpp:55
void setRequestHeaders(const KDSoapHeaders &headers)
Definition: KDSoapJob.cpp:40
void setAutoDelete(bool enable)
Definition: KDSoapJob.cpp:50
void finished(KDSoapJob *job)
QString faultAsString() const
Definition: KDSoapJob.cpp:80

© 2010-2024 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-soap/
Generated by doxygen 1.9.1