diff options
author | ck <qt-info@nokia.com> | 2010-07-19 09:37:09 +0200 |
---|---|---|
committer | ck <qt-info@nokia.com> | 2010-07-19 09:37:09 +0200 |
commit | 5871f2bb8181b39357cffa5677a75424151ca494 (patch) | |
tree | 435ddf63f3bfb7c009fb26a88ee68f406a880c1b /src/plugins/classview | |
parent | 2e12b0f07934bdc845a25d9c899998a466e0731c (diff) | |
download | qt-creator-5871f2bb8181b39357cffa5677a75424151ca494.tar.gz |
Fix compilation (workaround for probable gcc bug).
Original version looks fine to me, but fails to compile with e.g.
gcc versions Ubuntu 4.4.3-4ubuntu5 and Debian 4.4.4-6.
Reviewed-by: Kai Koehne
Reviewed-by: kh1
Diffstat (limited to 'src/plugins/classview')
-rw-r--r-- | src/plugins/classview/classviewsymbolinformation.h | 20 | ||||
-rw-r--r-- | src/plugins/classview/classviewsymbollocation.h | 19 |
2 files changed, 19 insertions, 20 deletions
diff --git a/src/plugins/classview/classviewsymbolinformation.h b/src/plugins/classview/classviewsymbolinformation.h index 988fb0f0b7..3c03c30856 100644 --- a/src/plugins/classview/classviewsymbolinformation.h +++ b/src/plugins/classview/classviewsymbolinformation.h @@ -53,6 +53,11 @@ public: inline const QString &type() const { return m_type; } inline int iconType() const { return m_iconType; } inline uint hash() const { return m_hash; } + inline bool operator==(const SymbolInformation &other) const + { + return iconType() == other.iconType() && name() == other.name() + && type() == other.type(); + } /*! \brief Get an icon type sort order. Not pre-calculated - is needed for converting @@ -69,21 +74,16 @@ private: uint m_hash; //!< precalculated hash value - to speed up qHash }; -} // namespace Internal -} // namespace ClassView - -inline bool operator==(const ClassView::Internal::SymbolInformation &a, - const ClassView::Internal::SymbolInformation &b) -{ - return a.iconType() == b.iconType() && a.name() == b.name() && a.type() == b.type(); -} - //! qHash overload for QHash/QSet -inline uint qHash(const ClassView::Internal::SymbolInformation &information) +inline uint qHash(const SymbolInformation &information) { return information.hash(); } + +} // namespace Internal +} // namespace ClassView + Q_DECLARE_METATYPE(ClassView::Internal::SymbolInformation) #endif // CLASSVIEWSYMBOLINFORMATION_H diff --git a/src/plugins/classview/classviewsymbollocation.h b/src/plugins/classview/classviewsymbollocation.h index b886a2470f..cc028bb002 100644 --- a/src/plugins/classview/classviewsymbollocation.h +++ b/src/plugins/classview/classviewsymbollocation.h @@ -54,6 +54,11 @@ public: inline int line() const { return m_line; } inline int column() const { return m_column; } inline int hash() const { return m_hash; } + inline bool operator==(const SymbolLocation &other) const + { + return line() == other.line() && column() == other.column() + && fileName() == other.fileName(); + } private: QString m_fileName; //!< file name @@ -62,21 +67,15 @@ private: int m_hash; //!< precalculated hash value for the object, to speed up qHash }; -} // namespace Internal -} // namespace ClassView - -inline bool operator==(const ClassView::Internal::SymbolLocation &a, - const ClassView::Internal::SymbolLocation &b) -{ - return a.line() == b.line() && a.column() == b.column() && a.fileName() == b.fileName(); -} - //! qHash overload for QHash/QSet -inline uint qHash(const ClassView::Internal::SymbolLocation &location) +inline uint qHash(const SymbolLocation &location) { return location.hash(); } +} // namespace Internal +} // namespace ClassView + Q_DECLARE_METATYPE(ClassView::Internal::SymbolLocation) #endif // CLASSVIEWSYMBOLLOCATION_H |