forked from qt-creator/qt-creator
Core: Make UtilsJsExtension::relativeFilePath() work on remote
Task-number: QTCREATORBUG-28355 Change-Id: I67fad186ed31e42688835b38177f3fb7cd59c1d0 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -16,8 +16,9 @@
|
||||
#include <QVariant>
|
||||
#include <QVersionNumber>
|
||||
|
||||
namespace Core {
|
||||
namespace Internal {
|
||||
using namespace Utils;
|
||||
|
||||
namespace Core::Internal {
|
||||
|
||||
QString UtilsJsExtension::qtVersion() const
|
||||
{
|
||||
@@ -83,7 +84,9 @@ QString UtilsJsExtension::absoluteFilePath(const QString &in) const
|
||||
|
||||
QString UtilsJsExtension::relativeFilePath(const QString &path, const QString &base) const
|
||||
{
|
||||
return QDir(base).relativeFilePath(path);
|
||||
const FilePath basePath = FilePath::fromString(base).cleanPath();
|
||||
const FilePath filePath = FilePath::fromString(path).cleanPath();
|
||||
return FilePath::calcRelativePath(filePath.toFSPathString(), basePath.toFSPathString());
|
||||
}
|
||||
|
||||
bool UtilsJsExtension::exists(const QString &in) const
|
||||
@@ -175,5 +178,4 @@ QString UtilsJsExtension::qtQuickVersion(const QString &filePath) const
|
||||
return QLatin1String("2.15");
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Core
|
||||
} // Core::Internal
|
||||
|
||||
Reference in New Issue
Block a user