diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-03-07 19:29:40 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-03-07 19:29:40 +0900 |
commit | a614db0d7103cd52c4b593fddb0ecaf019eac407 (patch) | |
tree | 9e941e115ffcf0df5d5907825e958e735664975c | |
parent | ce79719dd2f8e3ba320449409ea559fee2f836d6 (diff) | |
download | libquotient-a614db0d7103cd52c4b593fddb0ecaf019eac407.tar.gz libquotient-a614db0d7103cd52c4b593fddb0ecaf019eac407.zip |
User: use std::unique_ptr instead of QScopedPointer
Slightly safer for the case (probably).
-rw-r--r-- | user.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |