forked from qt-creator/qt-creator
Utils: Remove FilePath::fromUrl()
Even though the concepts are similar, direct conversion is usually neither desired (lossy) nor needed. Change-Id: Id5c9e69d0597ed867cbda25f3fc4619a9fe90966 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -149,11 +149,6 @@ QFileInfo FilePath::toFileInfo() const
|
||||
return QFileInfo(toFSPathString());
|
||||
}
|
||||
|
||||
FilePath FilePath::fromUrl(const QUrl &url)
|
||||
{
|
||||
return FilePath::fromParts(url.scheme(), url.host(), url.path());
|
||||
}
|
||||
|
||||
FilePath FilePath::fromParts(const QStringView scheme, const QStringView host, const QStringView path)
|
||||
{
|
||||
FilePath result;
|
||||
@@ -920,8 +915,10 @@ FilePath FilePath::fromUtf8(const char *filename, int filenameSize)
|
||||
|
||||
FilePath FilePath::fromVariant(const QVariant &variant)
|
||||
{
|
||||
if (variant.type() == QVariant::Url)
|
||||
return FilePath::fromUrl(variant.toUrl());
|
||||
if (variant.type() == QVariant::Url) {
|
||||
const QUrl url = variant.toUrl();
|
||||
return FilePath::fromParts(url.scheme(), url.host(), url.path());
|
||||
}
|
||||
return FilePath::fromUserInput(variant.toString());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user