forked from qt-creator/qt-creator
QmlJS: Fix potential linking problem.
Don't use plugin from libs/qmljs. Change-Id: Ia345c567cd1f244ab2191017810ef3eeb91fe0e4 Reviewed-on: http://codereview.qt.nokia.com/213 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
This commit is contained in:
@@ -40,7 +40,6 @@
|
|||||||
#include "parser/qmljsast_p.h"
|
#include "parser/qmljsast_p.h"
|
||||||
|
|
||||||
#include <languageutils/fakemetaobject.h>
|
#include <languageutils/fakemetaobject.h>
|
||||||
#include <coreplugin/messagemanager.h>
|
|
||||||
|
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
@@ -1581,10 +1580,9 @@ const Value *Function::invoke(const Activation *activation) const
|
|||||||
QHash<QString, FakeMetaObject::ConstPtr> CppQmlTypesLoader::builtinObjects;
|
QHash<QString, FakeMetaObject::ConstPtr> CppQmlTypesLoader::builtinObjects;
|
||||||
QHash<QString, QList<LanguageUtils::ComponentVersion> > CppQmlTypesLoader::builtinPackages;
|
QHash<QString, QList<LanguageUtils::ComponentVersion> > CppQmlTypesLoader::builtinPackages;
|
||||||
|
|
||||||
void CppQmlTypesLoader::loadQmlTypes(const QFileInfoList &qmlTypeFiles)
|
void CppQmlTypesLoader::loadQmlTypes(const QFileInfoList &qmlTypeFiles, QStringList *errors, QStringList *warnings)
|
||||||
{
|
{
|
||||||
QHash<QString, FakeMetaObject::ConstPtr> newObjects;
|
QHash<QString, FakeMetaObject::ConstPtr> newObjects;
|
||||||
Core::MessageManager *messageManager = Core::MessageManager::instance();
|
|
||||||
|
|
||||||
foreach (const QFileInfo &qmlTypeFile, qmlTypeFiles) {
|
foreach (const QFileInfo &qmlTypeFile, qmlTypeFiles) {
|
||||||
QString error, warning;
|
QString error, warning;
|
||||||
@@ -1601,14 +1599,14 @@ void CppQmlTypesLoader::loadQmlTypes(const QFileInfoList &qmlTypeFiles)
|
|||||||
error = file.errorString();
|
error = file.errorString();
|
||||||
}
|
}
|
||||||
if (!error.isEmpty()) {
|
if (!error.isEmpty()) {
|
||||||
messageManager->printToOutputPane(
|
errors->append(TypeDescriptionReader::tr(
|
||||||
TypeDescriptionReader::tr("Errors while loading qmltypes from %1:\n%2").arg(
|
"Errors while loading qmltypes from %1:\n%2").arg(
|
||||||
qmlTypeFile.absoluteFilePath(), error));
|
qmlTypeFile.absoluteFilePath(), error));
|
||||||
}
|
}
|
||||||
if (!warning.isEmpty()) {
|
if (!warning.isEmpty()) {
|
||||||
messageManager->printToOutputPane(
|
warnings->append(TypeDescriptionReader::tr(
|
||||||
TypeDescriptionReader::tr("Warnings while loading qmltypes from %1:\n%2").arg(
|
"Warnings while loading qmltypes from %1:\n%2").arg(
|
||||||
qmlTypeFile.absoluteFilePath(), warning));
|
qmlTypeFile.absoluteFilePath(), error));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -615,9 +615,10 @@ class QMLJS_EXPORT CppQmlTypesLoader
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** Loads a set of qmltypes files into the builtin objects list
|
/** Loads a set of qmltypes files into the builtin objects list
|
||||||
and prints any errors to the General Messages pane
|
and returns errors and warnings
|
||||||
*/
|
*/
|
||||||
static void loadQmlTypes(const QFileInfoList &qmltypesFiles);
|
static void loadQmlTypes(const QFileInfoList &qmltypesFiles,
|
||||||
|
QStringList *errors, QStringList *warnings);
|
||||||
|
|
||||||
static QHash<QString, LanguageUtils::FakeMetaObject::ConstPtr> builtinObjects;
|
static QHash<QString, LanguageUtils::FakeMetaObject::ConstPtr> builtinObjects;
|
||||||
static QHash<QString, QList<LanguageUtils::ComponentVersion> > builtinPackages;
|
static QHash<QString, QList<LanguageUtils::ComponentVersion> > builtinPackages;
|
||||||
|
@@ -38,6 +38,7 @@
|
|||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/progressmanager/progressmanager.h>
|
#include <coreplugin/progressmanager/progressmanager.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
|
#include <coreplugin/messagemanager.h>
|
||||||
#include <cplusplus/ModelManagerInterface.h>
|
#include <cplusplus/ModelManagerInterface.h>
|
||||||
#include <cplusplus/CppDocument.h>
|
#include <cplusplus/CppDocument.h>
|
||||||
#include <cplusplus/TypeOfExpression.h>
|
#include <cplusplus/TypeOfExpression.h>
|
||||||
@@ -118,7 +119,15 @@ void ModelManager::loadQmlTypeDescriptions(const QString &resourcePath)
|
|||||||
QDir::Files,
|
QDir::Files,
|
||||||
QDir::Name);
|
QDir::Name);
|
||||||
|
|
||||||
Interpreter::CppQmlTypesLoader::loadQmlTypes(qmlTypesFiles);
|
QStringList errors;
|
||||||
|
QStringList warnings;
|
||||||
|
Interpreter::CppQmlTypesLoader::loadQmlTypes(qmlTypesFiles, &errors, &warnings);
|
||||||
|
|
||||||
|
Core::MessageManager *messageManager = Core::MessageManager::instance();
|
||||||
|
foreach (const QString &error, errors)
|
||||||
|
messageManager->printToOutputPane(error);
|
||||||
|
foreach (const QString &warning, warnings)
|
||||||
|
messageManager->printToOutputPane(warning);
|
||||||
|
|
||||||
// disabled for now: Prefer the xml file until the type dumping functionality
|
// disabled for now: Prefer the xml file until the type dumping functionality
|
||||||
// has been moved into Qt.
|
// has been moved into Qt.
|
||||||
|
Reference in New Issue
Block a user