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
@@ -498,6 +498,7 @@ void tst_fileutils::fromString_data()
QTest::newRow("single-colon") << D(":", "", "", ":");
QTest::newRow("single-slash") << D("/", "", "", "/");
QTest::newRow("single-char") << D("a", "", "", "a");
QTest::newRow("relative") << D("./rel", "", "", "./rel");
QTest::newRow("qrc") << D(":/test.txt", "", "", ":/test.txt");
QTest::newRow("qrc-no-slash") << D(":test.txt", "", "", ":test.txt");
@@ -520,6 +521,7 @@ void tst_fileutils::fromString_data()
QTest::newRow("docker-root-url") << D("docker://1234/", "docker", "1234", "/");
QTest::newRow("docker-root-url-special-linux") << D("/__qtc_devices__/docker/1234/", "docker", "1234", "/");
QTest::newRow("docker-root-url-special-win") << D("c:/__qtc_devices__/docker/1234/", "docker", "1234", "/");
QTest::newRow("docker-relative-path") << D("docker://1234/./rel", "docker", "1234", "rel");
QTest::newRow("qtc-dev-linux") << D("/__qtc_devices__", "", "", "/__qtc_devices__");
QTest::newRow("qtc-dev-win") << D("c:/__qtc_devices__", "", "", "c:/__qtc_devices__");