From 909512e0f0ab2a11d0c4ecdaef957ad7a5c58292 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 20 Aug 2009 15:43:53 +0200 Subject: 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). --- src/scripttools/debugging/qscriptdebuggerstackmodel.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/scripttools') 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(""); return name; } else if (index.column() == 2) { - if (info.lineNumber() == -1) - return QString::fromLatin1(""); QString fn = QFileInfo(info.fileName()).fileName(); - if (fn.isEmpty()) - fn = QString::fromLatin1("").arg(info.scriptId()); + if (fn.isEmpty()) { + if (info.functionType() == QScriptContextInfo::ScriptFunction) + fn = QString::fromLatin1("").arg(info.scriptId()); + else + fn = QString::fromLatin1(""); + + } return QString::fromLatin1("%0:%1").arg(fn).arg(info.lineNumber()); } } else if (role == Qt::ToolTipRole) { -- cgit v1.2.1