aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-03-07 19:29:40 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-03-07 19:29:40 +0900
commita614db0d7103cd52c4b593fddb0ecaf019eac407 (patch)
tree9e941e115ffcf0df5d5907825e958e735664975c
parentce79719dd2f8e3ba320449409ea559fee2f836d6 (diff)
downloadlibquotient-a614db0d7103cd52c4b593fddb0ecaf019eac407.tar.gz
libquotient-a614db0d7103cd52c4b593fddb0ecaf019eac407.zip
User: use std::unique_ptr instead of QScopedPointer
Slightly safer for the case (probably).
-rw-r--r--user.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/user.cpp b/user.cpp
index 54eaf38c..ec32a7a1 100644
--- a/user.cpp
+++ b/user.cpp
@@ -59,7 +59,7 @@ class User::Private
QString mostUsedName;
QString bridged;
- const QScopedPointer<Avatar> mostUsedAvatar { makeAvatar({}) };
+ const std::unique_ptr<Avatar> mostUsedAvatar { makeAvatar({}) };
QMultiHash<QString, const Room*> otherNames;
QHash<QUrl, Avatar*> otherAvatars;
QMultiHash<QUrl, const Room*> avatarsToRooms;
@@ -80,7 +80,7 @@ Avatar* User::Private::makeAvatar(QUrl url)
{
static const QIcon icon
{ QIcon::fromTheme(QStringLiteral("user-available")) };
- return new Avatar(url, icon);
+ return new Avatar(move(url), icon);
}
QString User::Private::nameForRoom(const Room* r, const QString& hint) const
@@ -315,7 +315,7 @@ QString User::bridged() const
const Avatar& User::avatarObject(const Room* room) const
{
return *d->otherAvatars.value(d->avatarUrlForRoom(room),
- d->mostUsedAvatar.data());
+ d->mostUsedAvatar.get());
}
QImage User::avatar(int dimension, const Room* room)