aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-06-18 21:29:27 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-06-18 21:29:27 +0200
commit5a63f8a18645d612decdcc853335df0682c41d03 (patch)
tree7a56cdede53ff63532c51d65e75ea4905b8873fd /lib/jobs
parent6b355d1aa87072143e09ea5269e8cf465318a64f (diff)
downloadlibquotient-5a63f8a18645d612decdcc853335df0682c41d03.tar.gz
libquotient-5a63f8a18645d612decdcc853335df0682c41d03.zip
Drop make_array(); use std::to_array() where needed
make_array() has been introduced to cover for shortcomings on macOS and Windows. These shortcomings are no more there, so we can just use the standardrlibrary.
Diffstat (limited to 'lib/jobs')
-rw-r--r--lib/jobs/basejob.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp
index fe70911e..da645a2d 100644
--- a/lib/jobs/basejob.cpp
+++ b/lib/jobs/basejob.cpp
@@ -138,9 +138,8 @@ public:
QTimer timer;
QTimer retryTimer;
- static constexpr std::array<const JobTimeoutConfig, 3> errorStrategy {
- { { 90s, 5s }, { 90s, 10s }, { 120s, 30s } }
- };
+ static constexpr auto errorStrategy = std::to_array<const JobTimeoutConfig>(
+ { { 90s, 5s }, { 90s, 10s }, { 120s, 30s } });
int maxRetries = int(errorStrategy.size());
int retriesTaken = 0;
@@ -152,10 +151,8 @@ public:
[[nodiscard]] QString dumpRequest() const
{
- // FIXME: use std::array {} when Apple stdlib gets deduction guides for it
- static const auto verbs =
- make_array(QStringLiteral("GET"), QStringLiteral("PUT"),
- QStringLiteral("POST"), QStringLiteral("DELETE"));
+ static const std::array verbs { "GET"_ls, "PUT"_ls, "POST"_ls,
+ "DELETE"_ls };
const auto verbWord = verbs.at(size_t(verb));
return verbWord % ' '
% (reply ? reply->url().toString(QUrl::RemoveQuery)
@@ -748,11 +745,14 @@ QString BaseJob::statusCaption() const
}
}
-int BaseJob::error() const { return d->status.code; }
+int BaseJob::error() const {
+ return d->status.code; }
-QString BaseJob::errorString() const { return d->status.message; }
+QString BaseJob::errorString() const {
+ return d->status.message; }
-QUrl BaseJob::errorUrl() const { return d->errorUrl; }
+QUrl BaseJob::errorUrl() const {
+ return d->errorUrl; }
void BaseJob::setStatus(Status s)
{