Commit ba0323974914166150a40878b14405659a7a5329
- Diff rendering mode:
- inline
- side by side
src/libs/qmljs/qmljslink.cpp
(4 / 5)
|   | |||
| 295 | 295 | // check the filesystem | |
| 296 | 296 | const QString packagePath = Bind::toString(import->importUri, QDir::separator()); | |
| 297 | 297 | foreach (const QString &importPath, _importPaths) { | |
| 298 | QDir dir(importPath); | ||
| 299 | if (!dir.cd(packagePath)) | ||
| 300 | continue; | ||
| 298 | QString libraryPath = importPath; | ||
| 299 | libraryPath += QDir::separator(); | ||
| 300 | libraryPath += packagePath; | ||
| 301 | 301 | ||
| 302 | const QString &libraryPath = dir.path(); | ||
| 303 | 302 | const LibraryInfo libraryInfo = _snapshot.libraryInfo(libraryPath); | |
| 304 | 303 | if (!libraryInfo.isValid()) | |
| 305 | 304 | continue; | |
| … | … | ||
| 325 | 325 | continue; | |
| 326 | 326 | ||
| 327 | 327 | importedTypes.insert(component.typeName); | |
| 328 | if (Document::Ptr importedDoc = _snapshot.document(dir.filePath(component.fileName))) { | ||
| 328 | if (Document::Ptr importedDoc = _snapshot.document(libraryPath + QDir::separator() + component.fileName)) { | ||
| 329 | 329 | if (importedDoc->bind()->rootObjectValue()) | |
| 330 | 330 | namespaceObject->setProperty(component.typeName, importedDoc->bind()->rootObjectValue()); | |
| 331 | 331 | } |
|   | |||
| 466 | 466 | ||
| 467 | 467 | void ModelManager::onLoadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri) | |
| 468 | 468 | { | |
| 469 | if (m_runningQmldumps.values().contains(libraryPath)) | ||
| 469 | const QString canonicalLibraryPath = QDir::cleanPath(libraryPath); | ||
| 470 | if (m_runningQmldumps.values().contains(canonicalLibraryPath)) | ||
| 470 | 471 | return; | |
| 471 | 472 | ||
| 472 | 473 | static QString qmldumpPath; | |
| … | … | ||
| 501 | 501 | args << importPath; | |
| 502 | 502 | args << importUri; | |
| 503 | 503 | process->start(qmldumpPath, args); | |
| 504 | m_runningQmldumps.insert(process, libraryPath); | ||
| 504 | m_runningQmldumps.insert(process, canonicalLibraryPath); | ||
| 505 | 505 | } | |
| 506 | 506 | ||
| 507 | 507 | void ModelManager::updateImportPaths() |

