Skip to content
Snippets Groups Projects
Commit 5871f2bb authored by ck's avatar ck
Browse files

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
parent 2e12b0f0
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,11 @@ public: ...@@ -53,6 +53,11 @@ public:
inline const QString &type() const { return m_type; } inline const QString &type() const { return m_type; }
inline int iconType() const { return m_iconType; } inline int iconType() const { return m_iconType; }
inline uint hash() const { return m_hash; } 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 \brief Get an icon type sort order. Not pre-calculated - is needed for converting
...@@ -69,21 +74,16 @@ private: ...@@ -69,21 +74,16 @@ private:
uint m_hash; //!< precalculated hash value - to speed up qHash 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 //! qHash overload for QHash/QSet
inline uint qHash(const ClassView::Internal::SymbolInformation &information) inline uint qHash(const SymbolInformation &information)
{ {
return information.hash(); return information.hash();
} }
} // namespace Internal
} // namespace ClassView
Q_DECLARE_METATYPE(ClassView::Internal::SymbolInformation) Q_DECLARE_METATYPE(ClassView::Internal::SymbolInformation)
#endif // CLASSVIEWSYMBOLINFORMATION_H #endif // CLASSVIEWSYMBOLINFORMATION_H
...@@ -54,6 +54,11 @@ public: ...@@ -54,6 +54,11 @@ public:
inline int line() const { return m_line; } inline int line() const { return m_line; }
inline int column() const { return m_column; } inline int column() const { return m_column; }
inline int hash() const { return m_hash; } 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: private:
QString m_fileName; //!< file name QString m_fileName; //!< file name
...@@ -62,21 +67,15 @@ private: ...@@ -62,21 +67,15 @@ private:
int m_hash; //!< precalculated hash value for the object, to speed up qHash 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 //! qHash overload for QHash/QSet
inline uint qHash(const ClassView::Internal::SymbolLocation &location) inline uint qHash(const SymbolLocation &location)
{ {
return location.hash(); return location.hash();
} }
} // namespace Internal
} // namespace ClassView
Q_DECLARE_METATYPE(ClassView::Internal::SymbolLocation) Q_DECLARE_METATYPE(ClassView::Internal::SymbolLocation)
#endif // CLASSVIEWSYMBOLLOCATION_H #endif // CLASSVIEWSYMBOLLOCATION_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment