Utils: Tweak FilePath device handling

This allows using file scheme in certain contexts.
E.g. starting Qt Creator with

 qtcreator file:///tmp/dummy.txt:10

did not work before while just using the scheme-less
absolute path did.

Task-number: QTCREATORBUG-30143
Change-Id: I8f2b728e733792eb92295bff60b27aecb4b3b8ed
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Christian Stenger
2024-01-08 14:54:31 +01:00
parent 58396a5da1
commit e901167952

View File

@@ -657,7 +657,7 @@ FileStreamHandle FilePath::asyncWrite(const QByteArray &data, QObject *context,
bool FilePath::needsDevice() const
{
return m_schemeLen != 0;
return m_schemeLen > 0 && scheme() != u"file";
}
bool FilePath::isSameDevice(const FilePath &other) const