aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-05-28 08:42:04 +0200
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-05-31 13:25:04 +0200
commita9edfbd19a624aa4e882df2f5e577ba1831914a3 (patch)
treea0e12a2b9c8c6616a614d33a184dab975affa93e /lib/jobs
parentcf4d3d7ed82e62b57a11fbc7f491535a761dc75c (diff)
downloadlibquotient-a9edfbd19a624aa4e882df2f5e577ba1831914a3.tar.gz
libquotient-a9edfbd19a624aa4e882df2f5e577ba1831914a3.zip
BaseJob::rawData: overload for (even) quicker access
No functional changes either.
Diffstat (limited to 'lib/jobs')
-rw-r--r--lib/jobs/basejob.cpp2
-rw-r--r--lib/jobs/basejob.h13
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp
index 100c05f2..e649ea87 100644
--- a/lib/jobs/basejob.cpp
+++ b/lib/jobs/basejob.cpp
@@ -612,6 +612,8 @@ QByteArray BaseJob::rawData(int bytesAtMost) const
: d->rawResponse;
}
+const QByteArray& BaseJob::rawData() const { return d->rawResponse; }
+
QString BaseJob::rawDataSample(int bytesAtMost) const
{
auto data = rawData(bytesAtMost);
diff --git a/lib/jobs/basejob.h b/lib/jobs/basejob.h
index 954b0777..010aca78 100644
--- a/lib/jobs/basejob.h
+++ b/lib/jobs/basejob.h
@@ -157,11 +157,16 @@ public:
/** Short human-friendly message on the job status */
QString statusCaption() const;
- /** Get raw response body as received from the server
- * \param bytesAtMost return this number of leftmost bytes, or -1
- * to return the entire response
+ /*! Get first bytes of the raw response body as received from the server
+ *
+ * \param bytesAtMost the number of leftmost bytes to return
+ *
+ * \sa rawDataSample
*/
- QByteArray rawData(int bytesAtMost = -1) const;
+ QByteArray rawData(int bytesAtMost) const;
+
+ /*! Access the whole response body as received from the server */
+ const QByteArray& rawData() const;
/** Get UI-friendly sample of raw data
*