aboutsummaryrefslogtreecommitdiff
path: root/jobs/basejob.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-04-02 22:48:43 +0300
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-04-02 22:48:43 +0300
commitff977a14a26076f9df426437a2049d2aefd1defc (patch)
tree69a5e6b07bdd46b8c3a2f7e1ec7a5351614599d4 /jobs/basejob.cpp
parent2c2fe463a5af4cd6798ed715cc740042c94843eb (diff)
downloadlibquotient-ff977a14a26076f9df426437a2049d2aefd1defc.tar.gz
libquotient-ff977a14a26076f9df426437a2049d2aefd1defc.zip
Renamed JobHttpType to more fitting HttpVerb; removed Job from enum values
Diffstat (limited to 'jobs/basejob.cpp')
-rw-r--r--jobs/basejob.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp
index 92361dc4..226290ff 100644
--- a/jobs/basejob.cpp
+++ b/jobs/basejob.cpp
@@ -43,9 +43,9 @@ struct NetworkReplyDeleter : public QScopedPointerDeleteLater
class BaseJob::Private
{
public:
- Private(ConnectionData* c, JobHttpType t, QString endpoint,
+ Private(ConnectionData* c, HttpVerb v, QString endpoint,
const QUrlQuery& q, const Data& data, bool nt)
- : connection(c), type(t), apiEndpoint(endpoint), requestQuery(q)
+ : connection(c), verb(v), apiEndpoint(endpoint), requestQuery(q)
, requestData(data), needsToken(nt)
, reply(nullptr), status(NoError)
{ }
@@ -55,7 +55,7 @@ class BaseJob::Private
ConnectionData* connection;
// Contents for the network request
- JobHttpType type;
+ HttpVerb verb;
QString apiEndpoint;
QUrlQuery requestQuery;
Data requestData;
@@ -76,10 +76,10 @@ inline QDebug operator<<(QDebug dbg, const BaseJob* j)
return dbg << "Job" << j->objectName();
}
-BaseJob::BaseJob(ConnectionData* connection, JobHttpType type, QString name,
+BaseJob::BaseJob(ConnectionData* connection, HttpVerb verb, QString name,
QString endpoint, BaseJob::Query query, BaseJob::Data data,
bool needsToken)
- : d(new Private(connection, type, endpoint, query, data, needsToken))
+ : d(new Private(connection, verb, endpoint, query, data, needsToken))
{
setObjectName(name);
d->timer.setSingleShot(true);
@@ -134,18 +134,18 @@ void BaseJob::Private::sendRequest()
req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
req.setMaximumRedirectsAllowed(10);
#endif
- switch( type )
+ switch( verb )
{
- case JobHttpType::GetJob:
+ case HttpVerb::Get:
reply.reset( connection->nam()->get(req) );
break;
- case JobHttpType::PostJob:
+ case HttpVerb::Post:
reply.reset( connection->nam()->post(req, requestData.serialize()) );
break;
- case JobHttpType::PutJob:
+ case HttpVerb::Put:
reply.reset( connection->nam()->put(req, requestData.serialize()) );
break;
- case JobHttpType::DeleteJob:
+ case HttpVerb::Delete:
reply.reset( connection->nam()->deleteResource(req) );
break;
}