Move FilePath's hash methods to the right header

Change-Id: Ie3932daf381bc03f37ae67722dcddc5b2e4823e5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2021-10-19 10:56:15 +02:00
parent 93ae6f4c06
commit 0e5d632e5b
2 changed files with 15 additions and 11 deletions

View File

@@ -201,6 +201,11 @@ private:
using FilePaths = QList<FilePath>; using FilePaths = QList<FilePath>;
inline uint qHash(const Utils::FilePath &a, uint seed = 0)
{
return a.hash(seed);
}
} // namespace Utils } // namespace Utils
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@@ -208,3 +213,13 @@ QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug dbg, const Utils::FilePath &c);
QT_END_NAMESPACE QT_END_NAMESPACE
Q_DECLARE_METATYPE(Utils::FilePath) Q_DECLARE_METATYPE(Utils::FilePath)
namespace std {
template<>
struct QTCREATOR_UTILS_EXPORT hash<Utils::FilePath>
{
using argument_type = Utils::FilePath;
using result_type = size_t;
result_type operator()(const argument_type &fn) const;
};
} // namespace std

View File

@@ -316,16 +316,5 @@ private:
QTCREATOR_UTILS_EXPORT QTextStream &operator<<(QTextStream &s, const FilePath &fn); QTCREATOR_UTILS_EXPORT QTextStream &operator<<(QTextStream &s, const FilePath &fn);
inline uint qHash(const Utils::FilePath &a, uint seed = 0) { return a.hash(seed); }
} // namespace Utils } // namespace Utils
namespace std {
template<> struct QTCREATOR_UTILS_EXPORT hash<Utils::FilePath>
{
using argument_type = Utils::FilePath;
using result_type = size_t;
result_type operator()(const argument_type &fn) const;
};
} // namespace std