diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-07-25 12:25:15 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-02-17 16:17:43 +0000 |
commit | de8229f37054b195bab4ca8e8a994832a60ae3a0 (patch) | |
tree | ae8398707089d2e295634fbf0261109f92eac59c /src/corelib/mimetypes/qmimeglobpattern_p.h | |
parent | 773458ad633c68e9111888b71f8971064cf42fd3 (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/qmimeglobpattern_p.h')
-rw-r--r-- | src/corelib/mimetypes/qmimeglobpattern_p.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/mimetypes/qmimeglobpattern_p.h b/src/corelib/mimetypes/qmimeglobpattern_p.h index 0088931b5c..7b4ecd2f6a 100644 --- a/src/corelib/mimetypes/qmimeglobpattern_p.h +++ b/src/corelib/mimetypes/qmimeglobpattern_p.h @@ -88,7 +88,14 @@ public: m_pattern = m_pattern.toLower(); } } - ~QMimeGlobPattern() {} + + void swap(QMimeGlobPattern &other) Q_DECL_NOTHROW + { + qSwap(m_pattern, other.m_pattern); + qSwap(m_mimeType, other.m_mimeType); + qSwap(m_weight, other.m_weight); + qSwap(m_caseSensitivity, other.m_caseSensitivity); + } bool matchFileName(const QString &filename) const; @@ -103,6 +110,7 @@ private: int m_weight; Qt::CaseSensitivity m_caseSensitivity; }; +Q_DECLARE_SHARED(QMimeGlobPattern) class QMimeGlobPatternList : public QList<QMimeGlobPattern> { |