forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.5'
Conflicts: src/plugins/debugger/qml/qmlengine.cpp src/plugins/qtsupport/gettingstartedwelcomepage.cpp Change-Id: I9157b9b9c05564ddeb3c72cec6b59523b8165d76
This commit is contained in:
@@ -1060,9 +1060,15 @@ void QmlEngine::expressionEvaluated(quint32 queryId, const QVariant &result)
|
||||
{
|
||||
if (d->queryIds.contains(queryId)) {
|
||||
d->queryIds.removeOne(queryId);
|
||||
QtMessageLogItem *item = constructLogItemTree(result);
|
||||
QtMessageLogItem *item = constructLogItemTree(qtMessageLogHandler()->root(),
|
||||
result);
|
||||
if (item)
|
||||
qtMessageLogHandler()->appendItem(item);
|
||||
} else {
|
||||
qtMessageLogHandler()->
|
||||
appendItem(new QtMessageLogItem(qtMessageLogHandler()->root(),
|
||||
QtMessageLogHandler::ErrorType,
|
||||
_("Error evaluating expression.")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1133,7 +1139,8 @@ void QmlEngine::appendDebugOutput(QtMsgType type, const QString &message,
|
||||
//This case is not possible
|
||||
return;
|
||||
}
|
||||
QtMessageLogItem *item = new QtMessageLogItem(itemType, message);
|
||||
QtMessageLogItem *item = new QtMessageLogItem(qtMessageLogHandler()->root(),
|
||||
itemType, message);
|
||||
item->file = info.file;
|
||||
item->line = info.line;
|
||||
qtMessageLogHandler()->appendItem(item);
|
||||
@@ -1175,6 +1182,7 @@ bool QmlEngine::evaluateScriptExpression(const QString& expression)
|
||||
qtMessageLogHandler()->
|
||||
appendItem(
|
||||
new QtMessageLogItem(
|
||||
qtMessageLogHandler()->root(),
|
||||
QtMessageLogHandler::ErrorType,
|
||||
_("Error evaluating expression.")));
|
||||
}
|
||||
@@ -1189,8 +1197,9 @@ bool QmlEngine::evaluateScriptExpression(const QString& expression)
|
||||
//Incase of invalid context, show Error message
|
||||
qtMessageLogHandler()->
|
||||
appendItem(new QtMessageLogItem(
|
||||
qtMessageLogHandler()->root(),
|
||||
QtMessageLogHandler::ErrorType,
|
||||
_("Cannot evaluate without"
|
||||
_("Cannot evaluate without "
|
||||
"a valid QML/JS Context.")),
|
||||
qtMessageLogHandler()->rowCount());
|
||||
}
|
||||
@@ -1301,12 +1310,12 @@ bool QmlEngine::canEvaluateScript(const QString &script)
|
||||
}
|
||||
|
||||
QtMessageLogItem *QmlEngine::constructLogItemTree(
|
||||
const QVariant &result, const QString &key)
|
||||
QtMessageLogItem *parent, const QVariant &result, const QString &key)
|
||||
{
|
||||
if (!result.isValid())
|
||||
return 0;
|
||||
|
||||
QtMessageLogItem *item = new QtMessageLogItem();
|
||||
QtMessageLogItem *item = new QtMessageLogItem(parent);
|
||||
if (result.type() == QVariant::Map) {
|
||||
if (key.isEmpty())
|
||||
item->text = _("Object");
|
||||
@@ -1316,9 +1325,10 @@ QtMessageLogItem *QmlEngine::constructLogItemTree(
|
||||
QMapIterator<QString, QVariant> i(result.toMap());
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
QtMessageLogItem *child = constructLogItemTree(i.value(), i.key());
|
||||
QtMessageLogItem *child = constructLogItemTree(item,
|
||||
i.value(), i.key());
|
||||
if (child)
|
||||
item->insertChild(item->childCount(), child);
|
||||
item->insertChild(child);
|
||||
}
|
||||
} else if (result.type() == QVariant::List) {
|
||||
if (key.isEmpty())
|
||||
@@ -1327,10 +1337,10 @@ QtMessageLogItem *QmlEngine::constructLogItemTree(
|
||||
item->text = QString(_("[%1] : List")).arg(key);
|
||||
QVariantList resultList = result.toList();
|
||||
for (int i = 0; i < resultList.count(); i++) {
|
||||
QtMessageLogItem *child = constructLogItemTree(resultList.at(i),
|
||||
QtMessageLogItem *child = constructLogItemTree(item, resultList.at(i),
|
||||
QString::number(i));
|
||||
if (child)
|
||||
item->insertChild(item->childCount(), child);
|
||||
item->insertChild(child);
|
||||
}
|
||||
} else if (result.canConvert(QVariant::String)) {
|
||||
item->text = result.toString();
|
||||
|
||||
Reference in New Issue
Block a user