QmlProfiler: Move qHash and operator== for QmlEventType

It makes more sense to have them in the same location as the actual
type.

Change-Id: Ia27970173d14cfe361d4fc007cb461f788350b21
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-06-07 12:48:57 +02:00
parent e10bc709bc
commit 69832a22d3
3 changed files with 29 additions and 16 deletions

View File

@@ -28,6 +28,7 @@
#include "qmlprofiler_global.h"
#include <QString>
#include <QHash>
namespace QmlProfiler {
@@ -75,6 +76,14 @@ inline bool operator!=(const QmlEventLocation &location1, const QmlEventLocation
return !(location1 == location2);
}
inline uint qHash(const QmlEventLocation &location)
{
return qHash(location.filename())
^ ((location.line() & 0xfff) // 12 bits of line number
| ((location.column() << 16) & 0xff0000)); // 8 bits of column
}
QDataStream &operator>>(QDataStream &stream, QmlEventLocation &location);
QDataStream &operator<<(QDataStream &stream, const QmlEventLocation &location);