Commit ba032397 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Concate strings instead of using the QDir API to speed up the linking phase.

Reviewed-by: Christian Kamm
parent afd4e304
......@@ -295,11 +295,10 @@ void Link::importNonFile(Interpreter::ObjectValue *typeEnv, Document::Ptr doc, A
// check the filesystem
const QString packagePath = Bind::toString(import->importUri, QDir::separator());
foreach (const QString &importPath, _importPaths) {
QDir dir(importPath);
if (!dir.cd(packagePath))
continue;
QString libraryPath = importPath;
libraryPath += QDir::separator();
libraryPath += packagePath;
const QString &libraryPath = dir.path();
const LibraryInfo libraryInfo = _snapshot.libraryInfo(libraryPath);
if (!libraryInfo.isValid())
continue;
......@@ -326,7 +325,7 @@ void Link::importNonFile(Interpreter::ObjectValue *typeEnv, Document::Ptr doc, A
continue;
importedTypes.insert(component.typeName);
if (Document::Ptr importedDoc = _snapshot.document(dir.filePath(component.fileName))) {
if (Document::Ptr importedDoc = _snapshot.document(libraryPath + QDir::separator() + component.fileName)) {
if (importedDoc->bind()->rootObjectValue())
namespaceObject->setProperty(component.typeName, importedDoc->bind()->rootObjectValue());
}
......
......@@ -466,7 +466,8 @@ void ModelManager::loadPluginTypes(const QString &libraryPath, const QString &im
void ModelManager::onLoadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri)
{
if (m_runningQmldumps.values().contains(libraryPath))
const QString canonicalLibraryPath = QDir::cleanPath(libraryPath);
if (m_runningQmldumps.values().contains(canonicalLibraryPath))
return;
static QString qmldumpPath;
......@@ -500,7 +501,7 @@ void ModelManager::onLoadPluginTypes(const QString &libraryPath, const QString &
args << importPath;
args << importUri;
process->start(qmldumpPath, args);
m_runningQmldumps.insert(process, libraryPath);
m_runningQmldumps.insert(process, canonicalLibraryPath);
}
void ModelManager::updateImportPaths()
......
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