summaryrefslogtreecommitdiffstats
path: root/src/scripttools
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-20 13:43:53 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-08-20 13:43:53 (GMT)
commit909512e0f0ab2a11d0c4ecdaef957ad7a5c58292 (patch)
tree34ce238089291c659df170486675588fcaece89c /src/scripttools
parentc171799d5d96360cffe9b8288f18859b5e2d51dd (diff)
downloadQt-909512e0f0ab2a11d0c4ecdaef957ad7a5c58292.zip
Qt-909512e0f0ab2a11d0c4ecdaef957ad7a5c58292.tar.gz
Qt-909512e0f0ab2a11d0c4ecdaef957ad7a5c58292.tar.bz2
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 651b062..a6bb78b 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) {