summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qversionnumber.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-09-22 15:10:53 -0700
committerMarc Mutz <marc.mutz@kdab.com>2015-07-16 18:33:48 +0000
commite9a7825cf7e5f479f7a04a5800edb752132b1070 (patch)
tree70a68c6e55b3cf40b2521a4c9b0b7b5b28713f14 /src/corelib/tools/qversionnumber.h
parent4e8adb4b7bfcd9892aaea0a7451d0c241be861d6 (diff)
Remove the ref-qualified versions of segments and normalized
They can't be ref-qualified if the QVersionNumber object doesn't actually hold a QVector<int>, as the next commit will make it: for segments(), there might not be a QVector to be moved; for normalized(), the common case will be that there's no gain in ref-qualifying. Change-Id: I4bfb8b8765a502c0de6aed693752217106e575a2 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/tools/qversionnumber.h')
-rw-r--r--src/corelib/tools/qversionnumber.h43
1 files changed, 3 insertions, 40 deletions
diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h
index 449445cac6..050e685f03 100644
--- a/src/corelib/tools/qversionnumber.h
+++ b/src/corelib/tools/qversionnumber.h
@@ -97,44 +97,9 @@ public:
inline int microVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
{ return segmentAt(2); }
-#if defined(Q_COMPILER_REF_QUALIFIERS)
-# if defined(Q_CC_GNU)
- // required due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61941
-# pragma push_macro("Q_REQUIRED_RESULT")
-# undef Q_REQUIRED_RESULT
-# define Q_REQUIRED_RESULT
-# define Q_REQUIRED_RESULT_pushed
-# endif
- inline QVersionNumber normalized() const & Q_REQUIRED_RESULT
- {
- QVector<int> segs(m_segments);
- return normalizedImpl(segs);
- }
-
- inline QVersionNumber normalized() && Q_REQUIRED_RESULT
- {
- return normalizedImpl(m_segments);
- }
-
- inline QVector<int> segments() const & Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return m_segments; }
-
- inline QVector<int> segments() && Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return qMove(m_segments); }
-
-# ifdef Q_REQUIRED_RESULT_pushed
-# pragma pop_macro("Q_REQUIRED_RESULT")
-# endif
-#else
- inline QVersionNumber normalized() const Q_REQUIRED_RESULT
- {
- QVector<int> segs(m_segments);
- return normalizedImpl(segs);
- }
-
- inline QVector<int> segments() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return m_segments; }
-#endif
+ Q_CORE_EXPORT QVersionNumber normalized() const Q_REQUIRED_RESULT;
+
+ Q_CORE_EXPORT QVector<int> segments() const Q_REQUIRED_RESULT;
inline int segmentAt(int index) const Q_DECL_NOTHROW Q_REQUIRED_RESULT
{ return (m_segments.size() > index) ? m_segments.at(index) : 0; }
@@ -152,8 +117,6 @@ public:
Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(const QString &string, int *suffixIndex = 0) Q_REQUIRED_RESULT;
private:
- Q_CORE_EXPORT static QVersionNumber normalizedImpl(QVector<int> &segs) Q_REQUIRED_RESULT;
-
#ifndef QT_NO_DATASTREAM
friend Q_CORE_EXPORT QDataStream& operator>>(QDataStream &in, QVersionNumber &version);
#endif