aboutsummaryrefslogtreecommitdiffstats
path: root/src/kvilib/irc/KviIrcUserEntry.cpp
diff options
context:
space:
mode:
authorGravatar staticfox2016-04-18 04:12:48 -0400
committerGravatar staticfox2016-04-18 04:12:48 -0400
commit6e9a9ded1bed40af8460e1e212ba1fa9bf7f1f71 (patch)
tree044f0bd8d5168802628d689b1a7c23111a661851 /src/kvilib/irc/KviIrcUserEntry.cpp
parentgeneral: Fix a lot of things (diff)
downloadKVIrc-6e9a9ded1bed40af8460e1e212ba1fa9bf7f1f71.tar.gz
KVIrc-6e9a9ded1bed40af8460e1e212ba1fa9bf7f1f71.tar.bz2
KVIrc-6e9a9ded1bed40af8460e1e212ba1fa9bf7f1f71.zip
KviIrcUserEntry: Make setAvatar accept unique_ptr
Diffstat (limited to 'src/kvilib/irc/KviIrcUserEntry.cpp')
-rw-r--r--src/kvilib/irc/KviIrcUserEntry.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/kvilib/irc/KviIrcUserEntry.cpp b/src/kvilib/irc/KviIrcUserEntry.cpp
index 6e98268ce..e380ee176 100644
--- a/src/kvilib/irc/KviIrcUserEntry.cpp
+++ b/src/kvilib/irc/KviIrcUserEntry.cpp
@@ -93,12 +93,18 @@ void KviIrcUserEntry::setRealName(const QString & szReal)
}
}
+void KviIrcUserEntry::setAvatar(std::unique_ptr<KviAvatar> upAvatar)
+{
+ m_upAvatar = std::move(upAvatar);
+}
+
+// Overload function for backwards compatibility
void KviIrcUserEntry::setAvatar(KviAvatar * pAvatar)
{
- m_pAvatar.reset(pAvatar);
+ m_upAvatar.reset(pAvatar);
}
-KviAvatar * KviIrcUserEntry::forgetAvatar()
+std::unique_ptr<KviAvatar> KviIrcUserEntry::forgetAvatar()
{
- return m_pAvatar.release();
+ return std::move(m_upAvatar);
}