aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorhjk <[email protected]>2009-04-08 11:37:57 +0200
committerhjk <[email protected]>2009-04-08 16:05:49 +0200
commit7a77f8375938212ac228b03845cbdc55a65066d5 (patch)
tree598e3667272ce9fb541f10a7fbfc0ce960e42ad9 /src
parent1fd6aa1ac15abdadb91ee3e9e9cac9578efdb45c (diff)
debugger: stack view cosmetics
Diffstat (limited to 'src')
-rw-r--r--src/plugins/debugger/stackhandler.cpp27
-rw-r--r--src/plugins/debugger/stackhandler.h4
2 files changed, 17 insertions, 14 deletions
diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp
index a02a80a3523..f3a64b3d1bf 100644
--- a/src/plugins/debugger/stackhandler.cpp
+++ b/src/plugins/debugger/stackhandler.cpp
@@ -53,10 +53,11 @@ bool StackFrame::isUsable() const
////////////////////////////////////////////////////////////////////////
StackHandler::StackHandler(QObject *parent)
- : QAbstractTableModel(parent), m_currentIndex(0)
+ : QAbstractTableModel(parent),
+ m_positionIcon(QIcon(":/gdbdebugger/images/location.svg")),
+ m_emptyIcon(QIcon(":/gdbdebugger/images/empty.svg"))
{
- m_emptyIcon = QIcon(":/gdbdebugger/images/empty.svg");
- m_positionIcon = QIcon(":/gdbdebugger/images/location.svg");
+ m_currentIndex = 0;
m_canExpand = false;
}
@@ -78,7 +79,11 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const
if (index.row() == m_stackFrames.size()) {
if (role == Qt::DisplayRole && index.column() == 0)
- return "<...>";
+ return tr("...");
+ if (role == Qt::DisplayRole && index.column() == 1)
+ return tr("<More>");
+ if (role == Qt::DecorationRole && index.column() == 0)
+ return m_emptyIcon;
return QVariant();
}
@@ -115,15 +120,13 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const
QVariant StackHandler::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
- static const char * const headers[] = {
- QT_TR_NOOP("Level"),
- QT_TR_NOOP("Function"),
- QT_TR_NOOP("File"),
- QT_TR_NOOP("Line"),
- QT_TR_NOOP("Address")
+ switch (section) {
+ case 0: return tr("Level");
+ case 1: return tr("Function");
+ case 2: return tr("File");
+ case 3: return tr("Line");
+ case 4: return tr("Address");
};
- if (section < 5)
- return tr(headers[section]);
}
return QVariant();
}
diff --git a/src/plugins/debugger/stackhandler.h b/src/plugins/debugger/stackhandler.h
index 920436deef2..ba88b15b447 100644
--- a/src/plugins/debugger/stackhandler.h
+++ b/src/plugins/debugger/stackhandler.h
@@ -86,8 +86,8 @@ private:
QList<StackFrame> m_stackFrames;
int m_currentIndex;
- QIcon m_positionIcon;
- QIcon m_emptyIcon;
+ const QVariant m_positionIcon;
+ const QVariant m_emptyIcon;
bool m_canExpand;
};