Changeset View
Changeset View
Standalone View
Standalone View
src/drive/drivesmodifyjob.cpp
Show All 29 Lines | |||||
30 | 30 | | |||
31 | #include <QNetworkRequest> | 31 | #include <QNetworkRequest> | ||
32 | #include <QNetworkReply> | 32 | #include <QNetworkReply> | ||
33 | #include <QUrlQuery> | 33 | #include <QUrlQuery> | ||
34 | 34 | | |||
35 | 35 | | |||
36 | namespace { | 36 | namespace { | ||
37 | static const QString UseDomainAdminAccessAttr = QStringLiteral("useDomainAdminAccess"); | 37 | static const QString UseDomainAdminAccessAttr = QStringLiteral("useDomainAdminAccess"); | ||
38 | static const QString True = QStringLiteral("true"); | | |||
39 | static const QString False = QStringLiteral("false"); | | |||
40 | } | 38 | } | ||
41 | using namespace KGAPI2; | 39 | using namespace KGAPI2; | ||
42 | using namespace KGAPI2::Drive; | 40 | using namespace KGAPI2::Drive; | ||
43 | 41 | | |||
44 | class Q_DECL_HIDDEN DrivesModifyJob::Private | 42 | class Q_DECL_HIDDEN DrivesModifyJob::Private | ||
45 | { | 43 | { | ||
46 | public: | 44 | public: | ||
47 | Private(DrivesModifyJob *parent); | 45 | Private(DrivesModifyJob *parent); | ||
Show All 34 Lines | 78 | if (drives.isEmpty()) { | |||
82 | return; | 80 | return; | ||
83 | } | 81 | } | ||
84 | 82 | | |||
85 | const DrivesPtr drive = drives.takeFirst(); | 83 | const DrivesPtr drive = drives.takeFirst(); | ||
86 | QUrl url = DriveService::fetchDrivesUrl(drive->id()); | 84 | QUrl url = DriveService::fetchDrivesUrl(drive->id()); | ||
87 | 85 | | |||
88 | QUrlQuery query(url); | 86 | QUrlQuery query(url); | ||
89 | if (useDomainAdminAccess != false) { | 87 | if (useDomainAdminAccess != false) { | ||
90 | query.addQueryItem(UseDomainAdminAccessAttr, useDomainAdminAccess ? True : False); | 88 | query.addQueryItem(UseDomainAdminAccessAttr, Utils::bool2Str(useDomainAdminAccess)); | ||
91 | } | 89 | } | ||
92 | url.setQuery(query); | 90 | url.setQuery(query); | ||
93 | 91 | | |||
94 | QNetworkRequest request(url); | 92 | QNetworkRequest request(url); | ||
95 | 93 | | |||
96 | const QByteArray rawData = Drives::toJSON(drive); | 94 | const QByteArray rawData = Drives::toJSON(drive); | ||
97 | q->enqueueRequest(request, rawData, QStringLiteral("application/json")); | 95 | q->enqueueRequest(request, rawData, QStringLiteral("application/json")); | ||
98 | } | 96 | } | ||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |