aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIvan Komissarov <ABBAPOH@gmail.com>2019-05-03 19:31:27 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2019-05-06 15:48:32 +0000
commit2eedbb3668f5858e2a29a162b3d33994d4a96972 (patch)
tree11311da66d359d917053d099c60a49d5331e7b2c /src
parentaf05d40c27b0d290ae68220c663b6448aadf4413 (diff)
Add missing move ctors to ProjectData and friends
Change-Id: I6619817f8c87e9f643f7f1b6d2851799de439782 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/lib/corelib/api/projectdata.cpp31
-rw-r--r--src/lib/corelib/api/projectdata.h14
2 files changed, 44 insertions, 1 deletions
diff --git a/src/lib/corelib/api/projectdata.cpp b/src/lib/corelib/api/projectdata.cpp
index 767bd38c0..0cac7553b 100644
--- a/src/lib/corelib/api/projectdata.cpp
+++ b/src/lib/corelib/api/projectdata.cpp
@@ -67,12 +67,16 @@ GroupData::GroupData(const GroupData &other) : d(other.d)
{
}
+GroupData::GroupData(GroupData &&) Q_DECL_NOEXCEPT = default;
+
GroupData &GroupData::operator=(const GroupData &other)
{
d = other.d;
return *this;
}
+GroupData &GroupData::operator=(GroupData &&) Q_DECL_NOEXCEPT = default;
+
GroupData::~GroupData()
{
}
@@ -216,12 +220,16 @@ ArtifactData::ArtifactData(const ArtifactData &other) : d(other.d)
{
}
+ArtifactData::ArtifactData(ArtifactData &&) Q_DECL_NOEXCEPT = default;
+
ArtifactData &ArtifactData::operator=(const ArtifactData &other)
{
d = other.d;
return *this;
}
+ArtifactData &ArtifactData::operator=(ArtifactData &&) Q_DECL_NOEXCEPT = default;
+
ArtifactData::~ArtifactData()
{
}
@@ -325,12 +333,16 @@ InstallData::InstallData(const InstallData &other) : d(other.d)
{
}
+InstallData::InstallData(InstallData &&) Q_DECL_NOEXCEPT = default;
+
InstallData &InstallData::operator=(const InstallData &other)
{
d = other.d;
return *this;
}
+InstallData &InstallData::operator=(InstallData &&) Q_DECL_NOEXCEPT = default;
+
InstallData::~InstallData()
{
}
@@ -412,12 +424,16 @@ ProductData::ProductData(const ProductData &other) : d(other.d)
{
}
+ProductData::ProductData(ProductData &&) Q_DECL_NOEXCEPT = default;
+
ProductData &ProductData::operator=(const ProductData &other)
{
d = other.d;
return *this;
}
+ProductData &ProductData::operator=(ProductData &&) Q_DECL_NOEXCEPT = default;
+
ProductData::~ProductData()
{
}
@@ -685,12 +701,16 @@ ProjectData::ProjectData(const ProjectData &other) : d(other.d)
{
}
+ProjectData::ProjectData(ProjectData &&) Q_DECL_NOEXCEPT = default;
+
ProjectData &ProjectData::operator =(const ProjectData &other)
{
d = other.d;
return *this;
}
+ProjectData &ProjectData::operator=(ProjectData &&) Q_DECL_NOEXCEPT = default;
+
ProjectData::~ProjectData()
{
}
@@ -819,6 +839,11 @@ PropertyMap::PropertyMap(const PropertyMap &other)
{
}
+PropertyMap::PropertyMap(PropertyMap &&other) Q_DECL_NOEXCEPT
+{
+ std::swap(d, other.d);
+}
+
PropertyMap::~PropertyMap()
{
delete d;
@@ -833,6 +858,12 @@ PropertyMap &PropertyMap::operator =(const PropertyMap &other)
return *this;
}
+PropertyMap &PropertyMap::operator =(PropertyMap &&other) Q_DECL_NOEXCEPT
+{
+ std::swap(d, other.d);
+ return *this;
+}
+
/*!
* \brief Returns the names of all properties.
*/
diff --git a/src/lib/corelib/api/projectdata.h b/src/lib/corelib/api/projectdata.h
index 91bcf7d9d..2bb1419d5 100644
--- a/src/lib/corelib/api/projectdata.h
+++ b/src/lib/corelib/api/projectdata.h
@@ -75,9 +75,11 @@ class QBS_EXPORT PropertyMap
public:
PropertyMap();
PropertyMap(const PropertyMap &other);
+ PropertyMap(PropertyMap &&other) Q_DECL_NOEXCEPT;
~PropertyMap();
PropertyMap &operator =(const PropertyMap &other);
+ PropertyMap &operator =(PropertyMap &&other) Q_DECL_NOEXCEPT;
QStringList allProperties() const;
QVariant getProperty(const QString &name) const;
@@ -90,7 +92,7 @@ public:
QString toString() const;
private:
- Internal::PropertyMapPrivate *d;
+ Internal::PropertyMapPrivate *d = nullptr;
};
class InstallData;
@@ -101,7 +103,9 @@ class QBS_EXPORT ArtifactData
public:
ArtifactData();
ArtifactData(const ArtifactData &other);
+ ArtifactData(ArtifactData &&) Q_DECL_NOEXCEPT;
ArtifactData &operator=(const ArtifactData &other);
+ ArtifactData &operator=(ArtifactData &&) Q_DECL_NOEXCEPT;
~ArtifactData();
bool isValid() const;
@@ -124,7 +128,9 @@ class QBS_EXPORT InstallData
public:
InstallData();
InstallData(const InstallData &other);
+ InstallData(InstallData &&) Q_DECL_NOEXCEPT;
InstallData &operator=(const InstallData &other);
+ InstallData &operator=(InstallData &&) Q_DECL_NOEXCEPT;
~InstallData();
bool isValid() const;
@@ -149,7 +155,9 @@ class QBS_EXPORT GroupData
public:
GroupData();
GroupData(const GroupData &other);
+ GroupData(GroupData &&) Q_DECL_NOEXCEPT;
GroupData &operator=(const GroupData &other);
+ GroupData &operator=(GroupData &&) Q_DECL_NOEXCEPT;
~GroupData();
bool isValid() const;
@@ -178,7 +186,9 @@ class QBS_EXPORT ProductData
public:
ProductData();
ProductData(const ProductData &other);
+ ProductData(ProductData &&) Q_DECL_NOEXCEPT;
ProductData &operator=(const ProductData &other);
+ ProductData &operator=(ProductData &&) Q_DECL_NOEXCEPT;
~ProductData();
bool isValid() const;
@@ -218,7 +228,9 @@ class QBS_EXPORT ProjectData
public:
ProjectData();
ProjectData(const ProjectData &other);
+ ProjectData(ProjectData &&) Q_DECL_NOEXCEPT;
ProjectData &operator=(const ProjectData &other);
+ ProjectData &operator=(ProjectData &&) Q_DECL_NOEXCEPT;
~ProjectData();
bool isValid() const;