forked from qt-creator/qt-creator
QmlJS: Don't use QDir::separator() for internal paths
We use forward slashes in all internal paths, even on Windows. Change-Id: Ie0b418c770dad96829dd357fe425616b6d3a5b82 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -123,7 +123,7 @@ public:
|
|||||||
QString fileName = url.toLocalFile();
|
QString fileName = url.toLocalFile();
|
||||||
if (!fileName.isEmpty()) {
|
if (!fileName.isEmpty()) {
|
||||||
if (QFileInfo(fileName).isRelative()) {
|
if (QFileInfo(fileName).isRelative()) {
|
||||||
fileName.prepend(QDir::separator());
|
fileName.prepend(QLatin1Char('/'));
|
||||||
fileName.prepend(_doc->path());
|
fileName.prepend(_doc->path());
|
||||||
}
|
}
|
||||||
if (!QFileInfo(fileName).exists())
|
if (!QFileInfo(fileName).exists())
|
||||||
|
|||||||
@@ -2185,7 +2185,7 @@ ImportInfo ImportInfo::moduleImport(QString uri, ComponentVersion version,
|
|||||||
info.m_type = ImportType::Library;
|
info.m_type = ImportType::Library;
|
||||||
info.m_name = uri;
|
info.m_name = uri;
|
||||||
info.m_path = uri;
|
info.m_path = uri;
|
||||||
info.m_path.replace(QLatin1Char('.'), QDir::separator());
|
info.m_path.replace(QLatin1Char('.'), QLatin1Char('/'));
|
||||||
info.m_version = version;
|
info.m_version = version;
|
||||||
info.m_as = as;
|
info.m_as = as;
|
||||||
info.m_ast = ast;
|
info.m_ast = ast;
|
||||||
@@ -2200,7 +2200,7 @@ ImportInfo ImportInfo::pathImport(const QString &docPath, const QString &path,
|
|||||||
|
|
||||||
QFileInfo importFileInfo(path);
|
QFileInfo importFileInfo(path);
|
||||||
if (!importFileInfo.isAbsolute())
|
if (!importFileInfo.isAbsolute())
|
||||||
importFileInfo = QFileInfo(docPath + QDir::separator() + path);
|
importFileInfo = QFileInfo(docPath + QLatin1Char('/') + path);
|
||||||
info.m_path = importFileInfo.absoluteFilePath();
|
info.m_path = importFileInfo.absoluteFilePath();
|
||||||
|
|
||||||
if (importFileInfo.isFile()) {
|
if (importFileInfo.isFile()) {
|
||||||
|
|||||||
@@ -961,7 +961,7 @@ public:
|
|||||||
// Other: non-absolute path
|
// Other: non-absolute path
|
||||||
QString name() const;
|
QString name() const;
|
||||||
|
|
||||||
// LibraryImport: uri with QDir::separator separator
|
// LibraryImport: uri with '/' separator
|
||||||
// Other: absoluteFilePath
|
// Other: absoluteFilePath
|
||||||
QString path() const;
|
QString path() const;
|
||||||
|
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ void LinkPrivate::loadQmldirComponents(ObjectValue *import, ComponentVersion ver
|
|||||||
|
|
||||||
importedTypes.insert(component.typeName);
|
importedTypes.insert(component.typeName);
|
||||||
if (Document::Ptr importedDoc = snapshot.document(
|
if (Document::Ptr importedDoc = snapshot.document(
|
||||||
libraryPath + QDir::separator() + component.fileName)) {
|
libraryPath + QLatin1Char('/') + component.fileName)) {
|
||||||
if (ObjectValue *v = importedDoc->bind()->rootObjectValue())
|
if (ObjectValue *v = importedDoc->bind()->rootObjectValue())
|
||||||
import->setMember(component.typeName, v);
|
import->setMember(component.typeName, v);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ static QString makeAbsolute(const QString &path, const QString &base)
|
|||||||
{
|
{
|
||||||
if (QFileInfo(path).isAbsolute())
|
if (QFileInfo(path).isAbsolute())
|
||||||
return path;
|
return path;
|
||||||
return QString::fromLatin1("%1%2%3").arg(base, QDir::separator(), path);
|
return QString::fromLatin1("%1/%3").arg(base, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginDumper::onLoadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri, const QString &importVersion)
|
void PluginDumper::onLoadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri, const QString &importVersion)
|
||||||
|
|||||||
Reference in New Issue
Block a user