aboutsummaryrefslogtreecommitdiff
path: root/jobs/passwordlogin.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-05-07 20:02:34 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-05-09 05:28:55 +0900
commit5038ae0a0099c2a5c6ffdd08734b597d92edac70 (patch)
tree71cd52d90d566fb1b3671806b6e3b57da73f43bf /jobs/passwordlogin.cpp
parent098a3855650c16f08df1e24139cd0cbac9b112c2 (diff)
downloadlibquotient-5038ae0a0099c2a5c6ffdd08734b597d92edac70.tar.gz
libquotient-5038ae0a0099c2a5c6ffdd08734b597d92edac70.zip
Code cleanup and tweaking (partially driven by clang-tidy)
Mainly it's about const-ification (in particular, passing const-refs instead of values) and deleting unneeded declarations/#includes. Since the changes alter the external interface, this is submitted as a PR for peer review. One of unneeded declarations/definitions is a virtual destructor in BaseJob descendants. Since a job object should be deleted through QObject::deleteLater() anyway (and it's the only correct way of disposing of the object), all deletions will call the stack of destructors through virtual QObject::~QObject(). Therefore even BaseJob could get on with a non-virtual destructor but for the sake of clarity BaseJob::~BaseJob() is still declared virtual.
Diffstat (limited to 'jobs/passwordlogin.cpp')
-rw-r--r--jobs/passwordlogin.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/jobs/passwordlogin.cpp b/jobs/passwordlogin.cpp
index 2f34e86a..081e19bc 100644
--- a/jobs/passwordlogin.cpp
+++ b/jobs/passwordlogin.cpp
@@ -18,10 +18,6 @@
#include "passwordlogin.h"
-#include <QtNetwork/QNetworkReply>
-
-#include "../connectiondata.h"
-
using namespace QMatrixClient;
class PasswordLogin::Private
@@ -32,7 +28,7 @@ class PasswordLogin::Private
QString returned_token;
};
-PasswordLogin::PasswordLogin(ConnectionData* connection, QString user, QString password)
+PasswordLogin::PasswordLogin(const ConnectionData* connection, QString user, QString password)
: BaseJob(connection, HttpVerb::Post, "PasswordLogin"
, "_matrix/client/r0/login"
, Query()