"Fixes" one Q_SKIP and makes the implementation OS-agnostic.
FilePath::osType() actually depends on the host system for not fully
qualified file paths, and that doesn't seem to be the right thing to do
in all cases. The caller may actually have more context to decide
whether this is needed (e.g. in pathchooser.cpp in the context of
"return value from a GUI element, i.e. 'host' implied).
Change-Id: Iff80c17094d2deec79d34d0527223fbcf8294935
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Changing the toString() to prepend system-specific prefixes
to cater for the remote filesystem model handling had unintended
sideeffects.
This here is the first step to split both paths.
Change-Id: I66cdd9a87802408e2ba95c2e29b9d7cce7fe2553
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Don't hardcode a single type of OS (Windows/Non-Windows) via
QDir::rootPath(), actually check both, independent of the host OS.
Most of the new tests are actually failing, as the parsing code uses
the host OS. Mark those tests as "Expexted fail" for now.
Change-Id: Ic907582ad3959ef95b9618826d987d4eab463b49
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
DeviceShell does not support piping commands at the moment.
To continue to support ::bytesAvailable the parsing of the
output from "df" is moved to FileUtils::bytesAvailableFromDFOutput.
Change-Id: Ia229208748aa6c572b99899e6ae042bdd5654f4a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
FilePath::setFromString failed previously for URLs
without a path, e.g. "http://qt.io" as it would add
the scheme and host to its path.
Also added a test for various URLs
Change-Id: I6c22489c0af7154734390aa1e5e12693864210b1
Reviewed-by: hjk <hjk@qt.io>
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>
* Fixed UNC path parsing to correctly split between root and path
* Fixed tst_fileutils to correspond to windows path handling.
Change-Id: I2849738696a39e8282068ab164514f806f2c5fcf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
instead of QTEST_MAIN. Reduces the initialization that is done by the Qt
test applications, and can also reduce interference with normal OS
operations like the current window loosing focus.
Change-Id: If88f289281aa1c8703ac7d4dbe0799d067c16588
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Round 1 - focus on headers.
For classes with initial in range [D-G].
Try to keep the same separators between different kind of headers.
Change-Id: Id42cd7b3743a816f75cecb6b576c0e37cb057473
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
When using the same path for the anchor and the relative path
we end up in an empty path which is conceptually wrong.
Especially when passing such a result directly without further
checking may lead to bad issues.
Return a path containing just the '.' (dot) instead.
Change-Id: I86e1ab91e6610831fc05bd81776d278e9fe10105
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Jochen Becher <jochen_becher@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.
At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.
Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Since we already have a container for file path, line and column move
the parse function there.
Change-Id: I5d0d97d271c5aaeb618e1a303b02cc6514e94e81
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This could or possibly should the target device's file name case
sensitivity into account by diverting to IDevice. However, as this is
expensive and we are in time-critical path here, we go with "good
enough" for now.
The first approximation is "Anything unusual is not case sensitive"
which is better than "Any device equals the host".
Change-Id: Ib3d4a627abebd96a7285a855af66e0c800767767
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This replaces FilePath::m_url by explicit host and scheme members
This removes the unclear duplication of information in m_data and
m_url.path() and avoids syntactic restrictions a real url has on
scheme and host and complex (and potentially lossy) url parsing:
QUrl url;
url.setHost("1234");
assert(url.host() == "0.0.4.210")
The toString/fromString methods now accept strings of the form
scheme://host/path, mimicing the use of urls so far.
Relative remote paths are representable, their toString() output
looks like scheme://./host/path and can be parsed back by fromString().
Change-Id: Id3b52c270b228e23834faa3f44daad8b1718b654
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The new methods allows converting a path to a file or directory into a
path relative to another path to a file or directory.
Change-Id: I8c743d5bced9fec81b05ce94ac2b7bec307d9028
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Keep expected path in line with result when using QFileInfo.
Change-Id: I8d323212d1627b81de01582c368a4e9ffbba734c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.
Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The third column was accidentally removed from one data row in
commit 271794fbc9
Fixes the following fatal error:
QFETCH: Requested testdata 'expectFailMessage' not available, check your _data function.
Change-Id: I4a09df2e044b4dcee1ed2ffc589082a3e2601232
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>