debugger: don't show the <global> frame in qml stack

This commit is contained in:
hjk
2011-01-19 19:16:34 +01:00
parent 05b77b958d
commit 26296c06ba

View File

@@ -693,6 +693,8 @@ void QmlEngine::messageReceived(const QByteArray &message)
for (int i = 0; i != stackFrames.size(); ++i)
stackFrames[i].level = i + 1;
if (stackFrames.size() && stackFrames.back().function == "<global>")
stackFrames.takeLast();
stackHandler()->setFrames(stackFrames);
watchHandler()->beginCycle();
@@ -735,8 +737,10 @@ void QmlEngine::messageReceived(const QByteArray &message)
logString += QLatin1String(" ") + error;
logMessage(LogReceive, logString);
QString msg =
tr("<p>An Uncaught Exception occured in <i>%1</i>:</p><p>%2</p>")
QString msg = stackFrames.isEmpty()
? tr("<p>An Uncaught Exception occured:</p><p>%2</p>")
.arg(Qt::escape(error))
: tr("<p>An Uncaught Exception occured in <i>%1</i>:</p><p>%2</p>")
.arg(stackFrames.value(0).file, Qt::escape(error));
showMessageBox(QMessageBox::Information, tr("Uncaught Exception"), msg);
} else {