aboutsummaryrefslogtreecommitdiff
path: root/src/base/QXmppDataForm.cpp
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2022-06-17 18:26:01 +0200
committerLinus Jahn <lnj@kaidan.im>2022-06-18 12:45:19 +0200
commit31ef165cbbf918ba0ddd00f86c6dee257a0b936b (patch)
treee891a37cf70fbc60354d9a9cd69d4e9cb7d34a80 /src/base/QXmppDataForm.cpp
parent675f57b1d7facab15eff303f022c332a8220777e (diff)
Add move constructors and move assignment operators everywhere
This is so std::move() on implicitly-shared types actually moves the content and doesn't call the copy ctor/assignment operator.
Diffstat (limited to 'src/base/QXmppDataForm.cpp')
-rw-r--r--src/base/QXmppDataForm.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/base/QXmppDataForm.cpp b/src/base/QXmppDataForm.cpp
index 2b165aec..9f68046c 100644
--- a/src/base/QXmppDataForm.cpp
+++ b/src/base/QXmppDataForm.cpp
@@ -130,11 +130,13 @@ QXmppDataForm::MediaSource::MediaSource(const QUrl &uri, const QMimeType &conten
/// Default copy-constructor
QXmppDataForm::MediaSource::MediaSource(const QXmppDataForm::MediaSource &) = default;
-
+/// Default move-constructor
+QXmppDataForm::MediaSource::MediaSource(QXmppDataForm::MediaSource &&) = default;
QXmppDataForm::MediaSource::~MediaSource() = default;
-
/// Default assignment operator
QXmppDataForm::MediaSource &QXmppDataForm::MediaSource::operator=(const QXmppDataForm::MediaSource &) = default;
+/// Default move-assignment operator
+QXmppDataForm::MediaSource &QXmppDataForm::MediaSource::operator=(QXmppDataForm::MediaSource &&) = default;
///
/// Returns the media URI as QUrl. This can be i.e. a \c http:// URL or a
@@ -344,12 +346,14 @@ QXmppDataForm::Field::Field(QXmppDataForm::Field::Type type,
/// Constructs a copy of \a other.
QXmppDataForm::Field::Field(const QXmppDataForm::Field &other) = default;
-
+/// Default move constructor.
+QXmppDataForm::Field::Field(QXmppDataForm::Field &&) = default;
/// Destroys the form field.
QXmppDataForm::Field::~Field() = default;
-
/// Assigns \a other to this field.
QXmppDataForm::Field &QXmppDataForm::Field::operator=(const QXmppDataForm::Field &other) = default;
+/// Default move-assignment operator.
+QXmppDataForm::Field &QXmppDataForm::Field::operator=(QXmppDataForm::Field &&) = default;
///
/// Returns the field's description.
@@ -661,12 +665,14 @@ QXmppDataForm::QXmppDataForm(const QXmppDataFormBase &based)
/// Constructs a copy of \a other.
QXmppDataForm::QXmppDataForm(const QXmppDataForm &other) = default;
-
+/// Default move constructor.
+QXmppDataForm::QXmppDataForm(QXmppDataForm &&other) = default;
/// Destroys the form.
QXmppDataForm::~QXmppDataForm() = default;
-
/// Assigns \a other to this form.
QXmppDataForm &QXmppDataForm::operator=(const QXmppDataForm &other) = default;
+/// Default move-assignment operator.
+QXmppDataForm &QXmppDataForm::operator=(QXmppDataForm &&) = default;
///
/// Returns the form's fields.