summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/stackframe.cpp
diff options
context:
space:
mode:
authorArvid Ephraim Picciani <arvid.picciani@nokia.com>2010-10-15 11:17:32 +0200
committerArvid Ephraim Picciani <arvid.picciani@nokia.com>2010-10-15 12:05:13 +0200
commit270cd904f809cdfae831819e28e8e459248bb33e (patch)
tree5f7e11e63c7c0849cfd5e18a68cdf4cd3a9ebe4f /src/plugins/debugger/stackframe.cpp
parent728ef58b16fc6f84d87247f8f2ff8e13cf14a52b (diff)
downloadqt-creator-270cd904f809cdfae831819e28e8e459248bb33e.tar.gz
Clean up StackFrame
Reviewed-by: hjk
Diffstat (limited to 'src/plugins/debugger/stackframe.cpp')
-rw-r--r--src/plugins/debugger/stackframe.cpp34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/plugins/debugger/stackframe.cpp b/src/plugins/debugger/stackframe.cpp
index 18062920a8..da62a225d7 100644
--- a/src/plugins/debugger/stackframe.cpp
+++ b/src/plugins/debugger/stackframe.cpp
@@ -28,15 +28,12 @@
**************************************************************************/
#include "stackframe.h"
-#include "stackhandler.h"
#include <QtCore/QFileInfo>
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtCore/QTextStream>
-
-#include <QtGui/QToolTip>
-#include <QtGui/QFontMetrics>
+#include <QtCore/QCoreApplication>
namespace Debugger {
namespace Internal {
@@ -48,12 +45,12 @@ namespace Internal {
////////////////////////////////////////////////////////////////////////
StackFrame::StackFrame()
- : level(0), line(0), address(0)
+ : level(-1), line(-1), address(0)
{}
void StackFrame::clear()
{
- line = level = 0;
+ line = level = -1;
function.clear();
file.clear();
from.clear();
@@ -70,16 +67,16 @@ QString StackFrame::toString() const
{
QString res;
QTextStream str(&res);
- str << StackHandler::tr("Address:") << ' ';
+ str << tr("Address:") << ' ';
str.setIntegerBase(16);
str << address;
str.setIntegerBase(10);
str << ' '
- << StackHandler::tr("Function:") << ' ' << function << ' '
- << StackHandler::tr("File:") << ' ' << file << ' '
- << StackHandler::tr("Line:") << ' ' << line << ' '
- << StackHandler::tr("From:") << ' ' << from << ' '
- << StackHandler::tr("To:") << ' ' << to;
+ << tr("Function:") << ' ' << function << ' '
+ << tr("File:") << ' ' << file << ' '
+ << tr("Line:") << ' ' << line << ' '
+ << tr("From:") << ' ' << from << ' '
+ << tr("To:") << ' ' << to;
return res;
}
@@ -89,17 +86,16 @@ QString StackFrame::toToolTip() const
QString res;
QTextStream str(&res);
str << "<html><body><table>"
- << "<tr><td>" << StackHandler::tr("Address:") << "</td><td>0x";
+ << "<tr><td>" << tr("Address:") << "</td><td>0x";
str.setIntegerBase(16);
str << address;
str.setIntegerBase(10);
str << "</td></tr>"
- << "<tr><td>" << StackHandler::tr("Function:") << "</td><td>" << function << "</td></tr>"
- << "<tr><td>" << StackHandler::tr("File:") << "</td><td width="
- << QFontMetrics(QToolTip::font()).width(filePath) << ">" << filePath << "</td></tr>"
- << "<tr><td>" << StackHandler::tr("Line:") << "</td><td>" << line << "</td></tr>"
- << "<tr><td>" << StackHandler::tr("From:") << "</td><td>" << from << "</td></tr>"
- << "<tr><td>" << StackHandler::tr("To:") << "</td><td>" << to << "</td></tr>"
+ << "<tr><td>" << tr("Function:") << "</td><td>" << function << "</td></tr>"
+ << "<tr><td>" << tr("File:") << "</td><td>" << filePath << "</td></tr>"
+ << "<tr><td>" << tr("Line:") << "</td><td>" << line << "</td></tr>"
+ << "<tr><td>" << tr("From:") << "</td><td>" << from << "</td></tr>"
+ << "<tr><td>" << tr("To:") << "</td><td>" << to << "</td></tr>"
<< "</table></body></html>";
return res;
}