Commit 8f2532d3 authored by Kai Koehne's avatar Kai Koehne

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: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
parent 215dec23
......@@ -123,7 +123,7 @@ public:
QString fileName = url.toLocalFile();
if (!fileName.isEmpty()) {
if (QFileInfo(fileName).isRelative()) {
fileName.prepend(QDir::separator());
fileName.prepend(QLatin1Char('/'));
fileName.prepend(_doc->path());
}
if (!QFileInfo(fileName).exists())
......
......@@ -2185,7 +2185,7 @@ ImportInfo ImportInfo::moduleImport(QString uri, ComponentVersion version,
info.m_type = ImportType::Library;
info.m_name = uri;
info.m_path = uri;
info.m_path.replace(QLatin1Char('.'), QDir::separator());
info.m_path.replace(QLatin1Char('.'), QLatin1Char('/'));
info.m_version = version;
info.m_as = as;
info.m_ast = ast;
......@@ -2200,7 +2200,7 @@ ImportInfo ImportInfo::pathImport(const QString &docPath, const QString &path,
QFileInfo importFileInfo(path);
if (!importFileInfo.isAbsolute())
importFileInfo = QFileInfo(docPath + QDir::separator() + path);
importFileInfo = QFileInfo(docPath + QLatin1Char('/') + path);
info.m_path = importFileInfo.absoluteFilePath();
if (importFileInfo.isFile()) {
......
......@@ -961,7 +961,7 @@ public:
// Other: non-absolute path
QString name() const;
// LibraryImport: uri with QDir::separator separator
// LibraryImport: uri with '/' separator
// Other: absoluteFilePath
QString path() const;
......
......@@ -551,7 +551,7 @@ void LinkPrivate::loadQmldirComponents(ObjectValue *import, ComponentVersion ver
importedTypes.insert(component.typeName);
if (Document::Ptr importedDoc = snapshot.document(
libraryPath + QDir::separator() + component.fileName)) {
libraryPath + QLatin1Char('/') + component.fileName)) {
if (ObjectValue *v = importedDoc->bind()->rootObjectValue())
import->setMember(component.typeName, v);
}
......
......@@ -138,7 +138,7 @@ static QString makeAbsolute(const QString &path, const QString &base)
{
if (QFileInfo(path).isAbsolute())
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment