Utils: Use a single QString as data store for FilePath

Plus a few integers to get access to the pieces.

This reduces sizeof(FilePath) from 72 to 32.

Change-Id: I65eb856ad47b6a250c705d8d01893781a21d8e02
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
hjk
2022-09-21 12:59:02 +02:00
parent 604730f14d
commit 23e96dd6fe
4 changed files with 83 additions and 91 deletions

View File

@@ -219,9 +219,10 @@ private:
[[nodiscard]] QString mapToDevicePath() const;
[[nodiscard]] QString encodedHost() const;
QString m_scheme;
QString m_host; // May contain raw slashes.
QString m_path; // Includes the root bits
QString m_data; // Concatenated m_path, m_scheme, m_host
unsigned int m_pathLen = 0;
unsigned short m_schemeLen = 0;
unsigned short m_hostLen = 0;
};
inline size_t qHash(const Utils::FilePath &a, uint seed = 0)