Changeset View
Changeset View
Standalone View
Standalone View
src/core/accountinfo/accountinfofetchjob.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | |||||
44 | 44 | | |||
45 | AccountInfoFetchJob::~AccountInfoFetchJob() | 45 | AccountInfoFetchJob::~AccountInfoFetchJob() | ||
46 | { | 46 | { | ||
47 | delete d; | 47 | delete d; | ||
48 | } | 48 | } | ||
49 | 49 | | |||
50 | void AccountInfoFetchJob::start() | 50 | void AccountInfoFetchJob::start() | ||
51 | { | 51 | { | ||
52 | QNetworkRequest request(QUrl(QStringLiteral("https://www.googleapis.com/oauth2/v1/userinfo"))); | 52 | const QUrl url = QUrl(QStringLiteral("https://www.googleapis.com/oauth2/v1/userinfo")); | ||
53 | request.setRawHeader("Authorization", "Bearer " + account()->accessToken().toLatin1()); | 53 | QNetworkRequest request(url); | ||
54 | 54 | | |||
55 | QStringList headers; | 55 | QStringList headers; | ||
56 | const auto rawHeaderList = request.rawHeaderList(); | 56 | const auto rawHeaderList = request.rawHeaderList(); | ||
57 | headers.reserve(rawHeaderList.size()); | 57 | headers.reserve(rawHeaderList.size()); | ||
58 | for (const QByteArray &str : qAsConst(rawHeaderList)) { | 58 | for (const QByteArray &str : qAsConst(rawHeaderList)) { | ||
59 | headers << QLatin1String(str) + QLatin1String(": ") + QLatin1String(request.rawHeader(str)); | 59 | headers << QLatin1String(str) + QLatin1String(": ") + QLatin1String(request.rawHeader(str)); | ||
60 | } | 60 | } | ||
61 | 61 | | |||
Show All 21 Lines |