Commit Graph

18 Commits

Author SHA1 Message Date
hjk
1fa3255242 Utils: Split off file access interface from IDevice
The file accessing functions form now a class hierarchy by themselves,
the devices return a suitable point.

The previous implementation was mildly confusing by the special handling
of the DesktopDevice, fallbacks and remote cases in the same function
leading to unnecessary boilerplate when adding new functions and
codepaths that sometimes passed the FilePath API twice.

Implemented are a "DesktopDeviceFileAccess" taking care of the
previous !needsDevice() branches and a "UnixDeviceFileAccess"
covering the current docker and RL uses.

As a side-effect this unifies to a large degree the current docker
and RL code paths with were occasionally deviating from each other
while they shouldn't.

Change-Id: I4ff59d4be2a07d13e2ca5e9ace26a84160a87c9d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-10-13 10:38:35 +00:00
Marcus Tillmanns
271c9055f4 FSEngine: Add filePathInfo devicehook in tests
Change-Id: I50b87e213d8c83fa8d126662655681416c1cbe4e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-10-12 09:36:14 +00:00
hjk
b1471fe61f Utils: Combine some of the iterateWithFind overloads
Change-Id: I668447d0049f2e35cd0c76d2c5708779196167ec
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2022-10-12 08:59:32 +00:00
hjk
2e38cb6848 Utils: Add an offset parameter to the content writing FilePath function
Use QFile::seek to implement locally and a dd seek based poor man's
implementation on RL and docker.

Change-Id: I241d1c34c00e991845d132ad8edefa1377ba1311
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-10 16:08:28 +00:00
Marcus Tillmanns
d97b2fd6f4 FSEngine: Add tests for reading/writing
Change-Id: If38d27933727d4af0b24758bdf1a58f5ea78fd1b
Reviewed-by: hjk <hjk@qt.io>
2022-09-23 11:19:35 +00:00
hjk
815f3e87b8 Utils: Don't create FSEngineImpl::m_tempStorage on close()
It's too late, and apparently "close-without-open" is triggered:

QDEBUG: tst_fsengine::testRootPathContainsFakeDir() SOFT ASSERT: "m_tempStorage" in /data/dev/creator/src/libs/utils/fsengine/fsengine_impl.cpp:64
QDEBUG: tst_fsengine::testListDir() SOFT ASSERT: "m_tempStorage" in /data/dev/creator/src/libs/utils/fsengine/fsengine_impl.cpp:64

Change-Id: Ic7100d7abddfffca909b412ea7ea19e295c86729
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-23 05:37:59 +00:00
hjk
85c899de63 Utils: Make root recognition in FilePath::fromString host agnostic
Fixes a few XFAILS and a QSKIP

Change-Id: I012d873097dfa0ea565adc4e9a2b34f6c21db9dc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-19 08:51:20 +00:00
hjk
2f2e266fdf Utils: Make FilePath::toString() output OS-independent again
Change-Id: Ica7c09ea39a38e3425b28c63b6001ad7ad641a4f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-09-19 07:44:26 +00:00
Eike Ziller
e7ddd8a5b7 FilePath: Return optional bytearray from device hooks
For differentiating between "error" and "empty file".

Change-Id: I1806bb7386f5e7db28489f9f7e685648bfc20110
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-09-15 11:28:18 +00:00
Marcus Tillmanns
b573250a8a FSEngine: Disable tests on Windows
Recent changes in FilePath made it incompatible with windows targets
(by design). Therefore we disable the tests here.

Change-Id: I2182c64f36268f5ab6282d149930653a79cc9aa1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-15 07:44:27 +00:00
Eike Ziller
2c51e4bc17 FilePath: Return optional bytearray for file contents
For differentiating between "error" and "empty file".

Change-Id: I2c019ceac625e7be3180afa4d47ae3a24df91c1d
Reviewed-by: hjk <hjk@qt.io>
2022-09-12 11:57:04 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
David Schulz
5f0270ae4a Utils: clean file name before creating fs engine
Change-Id: I9c4c8132ad509820e0388787ab34bf11b3c4465b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-26 07:36:49 +00:00
hjk
11648298c8 Utils: Port some FilePath part accessors to QStringView
Change-Id: Ib5cc262e44c73880b6538eed714365e3d685870a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-22 13:27:56 +00:00
hjk
8945b3832c Utils: Make DeviceFileHooks access a bit more self-contained
Change-Id: Ib13035820021e9eda0585f98885bef9cbd2317a6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-08-04 09:43:04 +00:00
Marcus Tillmanns
783f0e1205 filepath: Move FileUtils:: function out of FilePath.cpp
Change-Id: If78c349b0145b86a76cd033e4dbc30b237ad917b
Reviewed-by: hjk <hjk@qt.io>
2022-08-04 08:01:59 +00:00
Marcus Tillmanns
b2f0f78bdc filepath: Fix windows driver letter handling in fromString()
Change-Id: Ic66e468ed2161bc10136ab31dc29a7358e6d7397
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-08-02 13:59:29 +00:00
Marcus Tillmanns
3462bc67be filesystem: Add QFSEngine for filepaths
Change-Id: Ibd0c88c69863c0877138d8cc45541530c359bd9c
Reviewed-by: hjk <hjk@qt.io>
2022-07-21 13:14:01 +00:00