diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-12 00:34:27 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-12 00:34:27 (GMT) |
commit | 0eb289bada4edb57de83d690c904a9c77c23caa2 (patch) | |
tree | 599d64d5f824ac4378eb2dccced97aede4f0e151 /src/declarative/qml | |
parent | bf68ae221cc5b14612b638c6a162d8c5d0e3cf2c (diff) | |
download | Qt-0eb289bada4edb57de83d690c904a9c77c23caa2.zip Qt-0eb289bada4edb57de83d690c904a9c77c23caa2.tar.gz Qt-0eb289bada4edb57de83d690c904a9c77c23caa2.tar.bz2 |
Revert "Better reporting of extension plugin loading errors."
This reverts commit e0dcdbd2984299665b9b784b201289219b9978d3.
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index e459d0f..a3a43e6 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1486,17 +1486,13 @@ public: QSet<QString> qmlDirFilesForWhichPluginsHaveBeenLoaded; - QDeclarativeDirComponents importExtension(const QString &absoluteFilePath, const QString &uri, QDeclarativeEngine *engine, QString *errorString) { + QDeclarativeDirComponents importExtension(const QString &absoluteFilePath, const QString &uri, QDeclarativeEngine *engine) { QFile file(absoluteFilePath); QString filecontent; if (file.open(QFile::ReadOnly)) { filecontent = QString::fromUtf8(file.readAll()); if (qmlImportTrace()) qDebug() << "QDeclarativeEngine::add: loaded" << absoluteFilePath; - } else { - if (errorString) - *errorString = QDeclarativeEngine::tr("module \"%1\" definition \"%2\" not readable").arg(uri).arg(absoluteFilePath); - return QDeclarativeDirComponents(); } QDir dir = QFileInfo(file).dir(); @@ -1516,15 +1512,7 @@ public: plugin.name); if (!resolvedFilePath.isEmpty()) { - if (!engine->importPlugin(resolvedFilePath, uri)) { - if (errorString) - *errorString = QDeclarativeEngine::tr("plugin \"%1\" cannot be loaded for module \"%2\"").arg(resolvedFilePath).arg(uri); - return QDeclarativeDirComponents(); - } - } else { - if (errorString) - *errorString = QDeclarativeEngine::tr("module \"%1\" plugin \"%2\" not found").arg(uri).arg(plugin.name); - return QDeclarativeDirComponents(); + engine->importPlugin(resolvedFilePath, uri); } } } @@ -1589,9 +1577,7 @@ public: url = QUrl::fromLocalFile(fi.absolutePath()).toString(); uri = resolvedUri(dir, engine); - qmldircomponents = importExtension(absoluteFilePath, uri, engine, errorString); - if (qmldircomponents.isEmpty()) // error (or empty) - return false; + qmldircomponents = importExtension(absoluteFilePath, uri, engine); break; } } @@ -1622,14 +1608,12 @@ public: return false; // local import dirs must exist } uri = resolvedUri(toLocalFileOrQrc(base.resolved(QUrl(uri))), engine); + qmldircomponents = importExtension(localFileOrQrc, + uri, + engine); + if (uri.endsWith(QLatin1Char('/'))) uri.chop(1); - if (QFile::exists(localFileOrQrc)) { - qmldircomponents = importExtension(localFileOrQrc, - uri,engine,errorString); - if (qmldircomponents.isEmpty()) // error (or empty) - return false; - } } else { if (prefix.isEmpty()) { // directory must at least exist for valid import |