diff --git a/src/plugins/classview/classviewsymbolinformation.h b/src/plugins/classview/classviewsymbolinformation.h index 988fb0f0b7396ea091058abf96dda9e0766c925a..3c03c3085627bddd92402c120ddd3d6370245c6d 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 b886a2470f6bb614742a72a7e9a180861f31792a..cc028bb002d49c9ba0f5c06d0054dd98ac526ab1 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