summaryrefslogtreecommitdiffstats
path: root/src/scripttools
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-20 15:43:53 +0200
committerKent Hansen <khansen@trolltech.com>2009-08-20 15:43:53 +0200
commit909512e0f0ab2a11d0c4ecdaef957ad7a5c58292 (patch)
tree34ce238089291c659df170486675588fcaece89c /src/scripttools
parentc171799d5d96360cffe9b8288f18859b5e2d51dd (diff)
provide filename in stack view if we have it
In the JSC back-end it's currently possible that we know the file name, but not the line number (we can't just assume that lineNumber == -1 implies native function).
Diffstat (limited to 'src/scripttools')
-rw-r--r--src/scripttools/debugging/qscriptdebuggerstackmodel.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp b/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp
index 651b062ff8..a6bb78bd72 100644
--- a/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp
@@ -131,11 +131,14 @@ QVariant QScriptDebuggerStackModel::data(const QModelIndex &index, int role) con
name = QString::fromLatin1("<anonymous>");
return name;
} else if (index.column() == 2) {
- if (info.lineNumber() == -1)
- return QString::fromLatin1("<native>");
QString fn = QFileInfo(info.fileName()).fileName();
- if (fn.isEmpty())
- fn = QString::fromLatin1("<anonymous script, id=%0>").arg(info.scriptId());
+ if (fn.isEmpty()) {
+ if (info.functionType() == QScriptContextInfo::ScriptFunction)
+ fn = QString::fromLatin1("<anonymous script, id=%0>").arg(info.scriptId());
+ else
+ fn = QString::fromLatin1("<native>");
+
+ }
return QString::fromLatin1("%0:%1").arg(fn).arg(info.lineNumber());
}
} else if (role == Qt::ToolTipRole) {