aboutsummaryrefslogtreecommitdiff
path: root/user.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-05-17 11:13:56 +0900
committerGitHub <noreply@github.com>2017-05-17 11:13:56 +0900
commiteabb31a04889a8c8e9825f3d0024c1e8aa2cea54 (patch)
treeb9b46139d636d3599662842ee613476543953e81 /user.cpp
parentb459f1b3e5355b30a51e9d12a35d8aee6a842886 (diff)
parentc25de4e19801c7931ce857c29a7a48be7f5c4dbe (diff)
downloadlibquotient-eabb31a04889a8c8e9825f3d0024c1e8aa2cea54.tar.gz
libquotient-eabb31a04889a8c8e9825f3d0024c1e8aa2cea54.zip
Merge pull request #62 from Fxrh/kitsune-refactoring
Code tweaks and cleanup
Diffstat (limited to 'user.cpp')
-rw-r--r--user.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/user.cpp b/user.cpp
index c5dac921..17714bee 100644
--- a/user.cpp
+++ b/user.cpp
@@ -34,6 +34,12 @@ using namespace QMatrixClient;
class User::Private
{
public:
+ Private(QString userId, Connection* connection)
+ : q(nullptr), userId(std::move(userId)), connection(connection)
+ , defaultIcon(QIcon::fromTheme(QStringLiteral("user-available")))
+ , avatarValid(false) , avatarOngoingRequest(false)
+ { }
+
User* q;
QString userId;
QString name;
@@ -51,14 +57,9 @@ class User::Private
};
User::User(QString userId, Connection* connection)
- : QObject(connection), d(new Private)
+ : QObject(connection), d(new Private(userId, connection))
{
- d->connection = connection;
- d->userId = userId;
- d->avatarValid = false;
- d->avatarOngoingRequest = false;
- d->q = this;
- d->defaultIcon = QIcon::fromTheme(QStringLiteral("user-available"));
+ d->q = this; // Initialization finished
}
User::~User()