This is meant to be helpful to piggy-back device information
in situations where the file resides on a remote file system.
The approach taken effectively duplicates the path data of the
url if the url constructor is actually used, but does not rely
on lossless path/fromPath conversions as it leaves the non-url
code paths unaffected in all situations.
The total overhead is deemed acceptable as the common use case
only default-constructs the m_url member which only sets a
pimpl nullptr.
Change-Id: Ie441cb1355ce086507333c31c7356ae5e6d10b96
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
... and start using it. The plan is to replace all appendPath() uses.
Change-Id: I555bcfa742b99b0951b98b0c0e707422c348fadb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
... by a non-mutating .stringAppended, doing the same.
Change-Id: I7adb6cae3415942cc9a80088bd75cda9d577d4a5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
More consistent with the fromString case and avoiding false
conversions QString -> QFileInfo -> FileName in case the
inheritance of QString suddenly disappears.
Change-Id: Ib14646ab1a660fd45dd1ea6862a0b5faa52ad0e3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Believe it or not, they exist :)
Git for Windows installs all its exectables as hardlinks for instance.
Logic copied from qfilesystemengine_{win,unix}.cpp in Qt.
This amends commit 118f713eb4.
Change-Id: Iafc64be4b2150378c7f9676fda0e01a43cd8b7cf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Overloaded functions are ugly to use in algorithms like transform().
Change-Id: Ia4f191e1cd9a21ceb99dec23a8f4fd1ce5f24182
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The PIDLIST_ABSOLUTE item returned by SHParseDisplayName has to be freed
again by ILFree according to the documentation of ITEMIDLIST structure.
Change-Id: I29eb7576600287cdc8380e81a83ce2af79e13e33
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
In case isRoot() returns false, but cleanPath fails to find the parent
directory, return an empty string.
For example: QDir::cleanPath("D:/..") returns "D:/.." on Windows.
I'm not aware of any concrete case when this can happen, but let's be
cautious.
Change-Id: I0f4af5f5c11bb768d99d90290a4a1a6a1bda7c27
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Many issues, mostly in headers, were not addressed in
e38410b76c
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default
Change-Id: I320a51726db881e582b898948d53735ebb06887a
Reviewed-by: hjk <hjk@qt.io>
It breaks cross-compilation on linux/mingw.
This reverts commit 1c014ed3d9.
Change-Id: I3e8183ec318541a4393ad242eefbdeaa78b7be44
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Although Windows is case insensitive, and lower case always works, Clang
complains:
Lexical or Preprocessor Issue: warning: non-portable path to file
'<FooBar.h>'; specified path differs in case from file name on disk
Change-Id: I8f94e9fb62f6afec8aa6b9d08a7c78f6ba8a4435
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
As exercised by the test directories as Utils::FileName are actually
supported. The resulting fileName() is empty.
Change-Id: Ie20ac58c1d0f416d711c8cc3281054c0d70c449e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Fixes warnings
"Empty filename passed to function"
(introduced by qtbase 0dee566e98f5ff4f224e596de1c04de4f9685df4)
emitted when running Qt Creator against 5.10.
The warnings originate from Kit::icon().
Change-Id: I501914195b8e4d340fd02362b215ffc6e3dc99d4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Interesting for command line tools that want to pull this in but not
QtGui (e.g. sdktool)
Change-Id: Ic2f5c1f3126869cc38bf672345750d7d966560fd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Left over after moving functionality to dragsupport.cpp/.h
Change-Id: I909be9eb42fb96989e9469278b416e25f3ac7f62
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Remove temporary files left after fail.
Set error string for locked file.
Task-number: QTCREATORBUG-15449
Change-Id: Ibc8b01a4ea47870c29493a69718db929070ac13f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This patch adds the missing include statements for QRegExp.
Change-Id: Ibb03b929940adb84ae190b5090cb6b88653cc14c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Do not try to save files with reserved names on windows. Doing so triggers
an assert in Qt.
Provide a nice warning instead.
Task-number: QTCREATORBUG-16984
Change-Id: I12be704f0aec0ab19b7f9f7023e9d28087dc30b1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Testcase: trying to use an existing build dir which was
made for /d/foo where /d is a symlink to $HOME/d.
To help understanding the problem, the error message now prints
both source dirs, the one found in the builddir and the one we expected.
Change-Id: I9a24fbd6ef3cf8108c5edba0d2a5b99ecdea0e89
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
The functionality in that class is covered by initializers and
Utils::unique, so there is no need to keep a custom class.
This way FileNameList plays way nicer with utils/algorithm.h.
Change-Id: I8eeae6aca0558ecd998920c4fdfc5ea56bf75501
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
On a case insensitive file system, we want to e.g.
open 'foo.H' when switching between header and source from 'foo.cpp'
if that is how the file appears on the file system.
Since there doesn't seem to be a way to normalize the full path without
resolving symlinks, do it for each path component in turn.
Also add a header for the mac specific utility functions.
Task-number: QTCREATORBUG-13507
Change-Id: I6cf51fed698d12ac56fa1ec051da1b893bb0b065
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Extend drop support with variant values. A drop may be a file drop or a
value drop or both.
Rename Utils::FileDropSupport to Utils::DropSupport and add methods to
add not only files but any QVariant value to the mime data. Project
explorer adds dragged nodes (which will be needed for future ModelEditor
plugin).
Change-Id: I799542c60fdecb3e64af0d3ba47b6caa9adbcfd7
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
... by keying on Utils::FileName
Task-number: QTCREATORBUG-12390
Change-Id: Ia98afb5a9160a7fd9225a2f9e02539ff3c35ae86
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>