This simplify the interface by removing a possibly wrong choice
ensures it works also on remote paths.
Change-Id: I01e198958900a91b99dcf2dbb491a593485493ba
Reviewed-by: David Schulz <david.schulz@qt.io>
And implement it for the docker device.
This replaces the previous unused and not really implemented
FilePath::resolveSymLinkTarget.
Change-Id: I9dcb4f8276dbb88b21959276da0d50135742fba0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Essentially a kind of 'touch', to be used in the CMake file API.
Change-Id: Iaae62b441c0006b39d4bef5f06420e798c28c2a5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Sprinkle a few QTC_ASSERT to make sure we are in a known
context.
Cmake's FileApiReader uses this before moving directories
as QFile::rename does not do anything if the target exists.
Change-Id: I555f99e81a9fe7d93ae66145eeebfa9d5880bc51
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Also really check contents if file dates are equal.
Change-Id: I39fca67b3616e931f1ed11d002fccaa232a0d74d
Reviewed-by: David Schulz <david.schulz@qt.io>
QDir::cleanPath(...) doesn't do the right thing on stringified
Utils::FilePaths. Use FilePath functions instead.
Change-Id: Ied66f38dd30a15694bce12ed57d37411bb87f680
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
QDir::cleanPath() should not be used on FilePath::toString'ed
object, it removed the second slash in the :// separator.
Change-Id: I0168d52f6d7caa99f5ccc5d1d93ae2bd783332c5
Reviewed-by: David Schulz <david.schulz@qt.io>
While the original plan was to use more specific functions like
'isReadableFile' to cut down the number of accesses, it is
unrealistic to re-write all occurrences in reasonable time.
So make the basic building blocks accessible, too.
Change-Id: I2586ebd19e1e7ae2c884fd2a4180869421293e3a
Reviewed-by: David Schulz <david.schulz@qt.io>
Combine the test and potential creation in one operation to potentially
reduce the number of remote calls.
Change-Id: I06ffa1256593afec430eb35605ba3b249f1da97c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The PCH header is undefining CALLBACK after loading Windows headers,
but we need to add it back when using Windows headers that need it.
The new definition needs only to be done when the PCH is used,
otherwise it could lead to re-definition warnings.
Amends 7880950eca
Change-Id: Iae57ac4bbbfdd45b5f9b50a2242103bec6eea5bc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
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>
to ProcessArgs and rename the files to commandline.*.
fileutils was a strange place for CommandLine, and this
reduces the dependencies needed for sdktool.
Change-Id: I9d7e8ffe8a3560f5d12934457b086f9446976883
Reviewed-by: hjk <hjk@qt.io>
There's not much interaction between ProcessArgs and QtcProcess
and both .cpp are still quite big, with non-trivial bits.
Change-Id: Id84202f6c34057bf87cc8f27fbb45f78f105e9a5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface
So move these items out of QtcProcess, later potentially to a separate
file pair.
Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Clang 12 has added a template parameter as "CALLBACK",
which conflicts with the Windows "CALLBACK" define.
Change-Id: I773899d103dcb1a852b555a1900b2de4acb6d96f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
The callback will be set from DeviceManager to re-route the
implementation through matching IDevice instances.
Change-Id: Ib210504008b8a3471452448a98378d4902e2cadf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Returning a const reference is different from our usual coding style,
and can lead to crashes when assigning to a const reference, like
const QString &path = filePath.pathAppended("foo").toString();
Make it behave like our other API.
Change-Id: Iab1cf1a944be405227b135c12029f58869893911
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
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>
This adds cmd's executable and arguments one by one to this commandline.
Useful to construct command lines for 'sudo', 'nice', etc.
Change-Id: I76067bc10e269b8e7ff4d945449be3633b321281
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Downloaded files get a quarantine flag on macOS, which prevents loading
them as a plugin in Qt Creator. Remove the quarantine flag when copying
the plugin.
Change-Id: I3edef3ddfbab299be750e728a9fac0536634ba1b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Clang code model can break if CMake project uses precompiled headers.
QtCreator will make a copy of the precompiled header, this way it
will not conflict with the build system one.
Ammends 888ea6bbbb
Fixes: QTCREATORBUG-24945
Fixes: QTCREATORBUG-25213
Change-Id: I149fc416cd047683d095758a024de47c7baf681c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The function took a const reference to a std::function. When passing
some other callable object, this leads to a copy, which is bad if the
callable is supposed to carry along state.
Change-Id: Iedc22644fb0f314b15de0eaaa7c0b2e73dd30f38
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>