summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes/qmimemagicrule_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-07-25 12:25:15 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-02-17 16:17:43 +0000
commitde8229f37054b195bab4ca8e8a994832a60ae3a0 (patch)
treeae8398707089d2e295634fbf0261109f92eac59c /src/corelib/mimetypes/qmimemagicrule_p.h
parent773458ad633c68e9111888b71f8971064cf42fd3 (diff)
mimetypes: Declare some types as shared
It's private API, so we can. As a consequence, had to add nothrow member-swap and, in QMimeGlobPattern, remove the user-defined empty destructor to un-inhibit the (nothrow) move special member functions. Change-Id: If5bb72db3c823c7b0e372f9bec99c7242d11839b Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/corelib/mimetypes/qmimemagicrule_p.h')
-rw-r--r--src/corelib/mimetypes/qmimemagicrule_p.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/corelib/mimetypes/qmimemagicrule_p.h b/src/corelib/mimetypes/qmimemagicrule_p.h
index 1a6ca81e11..26f93d96cc 100644
--- a/src/corelib/mimetypes/qmimemagicrule_p.h
+++ b/src/corelib/mimetypes/qmimemagicrule_p.h
@@ -69,6 +69,19 @@ public:
QMimeMagicRule(const QString &typeStr, const QByteArray &value, const QString &offsets,
const QByteArray &mask, QString *errorString);
+ void swap(QMimeMagicRule &other) Q_DECL_NOTHROW
+ {
+ qSwap(m_type, other.m_type);
+ qSwap(m_value, other.m_value);
+ qSwap(m_startPos, other.m_startPos);
+ qSwap(m_endPos, other.m_endPos);
+ qSwap(m_mask, other.m_mask);
+ qSwap(m_pattern, other.m_pattern);
+ qSwap(m_number, other.m_number);
+ qSwap(m_numberMask, other.m_numberMask);
+ qSwap(m_matchFunction, other.m_matchFunction);
+ }
+
bool operator==(const QMimeMagicRule &other) const;
Type type() const { return m_type; }
@@ -108,7 +121,7 @@ private:
template <typename T>
bool matchNumber(const QByteArray &data) const;
};
-Q_DECLARE_TYPEINFO(QMimeMagicRule, Q_MOVABLE_TYPE);
+Q_DECLARE_SHARED(QMimeMagicRule)
QT_END_NAMESPACE