Commit 183769e7 authored by hjk's avatar hjk Committed by hjk
Browse files

debugger: grey out Locals&Expressions when not accessible



Change-Id: I61489b9a5bf117be154ed6899beb3f8294247c9e
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent ad5c0edd
......@@ -239,6 +239,7 @@ public slots:
void scheduleResetLocation()
{
m_stackHandler.scheduleResetLocation();
m_watchHandler.scheduleResetLocation();
m_threadsHandler.scheduleResetLocation();
m_disassemblerAgent.scheduleResetLocation();
m_locationTimer.setSingleShot(true);
......@@ -250,6 +251,7 @@ public slots:
m_locationTimer.stop();
m_locationMark.reset();
m_stackHandler.resetLocation();
m_watchHandler.resetLocation();
m_threadsHandler.resetLocation();
m_disassemblerAgent.resetLocation();
}
......
......@@ -155,7 +155,7 @@ Qt::ItemFlags StackHandler::flags(const QModelIndex &index) const
const bool isValid = frame.isUsable()
|| debuggerCore()->boolSetting(OperateByInstruction);
return isValid && m_contentsValid
? QAbstractTableModel::flags(index) : Qt::ItemFlags(0);
? QAbstractTableModel::flags(index) : Qt::ItemFlags();
}
StackFrame StackHandler::currentFrame() const
......
......@@ -790,7 +790,7 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
static const QVariant red(QColor(200, 0, 0));
static const QVariant gray(QColor(140, 140, 140));
switch (idx.column()) {
case 1: return !data.valueEnabled ? gray
case 1: return (!data.valueEnabled || !m_handler->m_contentsValid) ? gray
: data.changed ? red : QVariant();
}
break;
......@@ -907,6 +907,9 @@ bool WatchModel::setData(const QModelIndex &index, const QVariant &value, int ro
Qt::ItemFlags WatchModel::flags(const QModelIndex &idx) const
{
if (!m_handler->m_contentsValid)
return Qt::ItemFlags();
if (!idx.isValid())
return Qt::ItemFlags();
......@@ -1253,6 +1256,9 @@ WatchHandler::WatchHandler(DebuggerEngine *engine)
m_watchers = new WatchModel(this, WatchersWatch);
m_tooltips = new WatchModel(this, TooltipsWatch);
m_contentsValid = false;
m_resetLocationScheduled = false;
connect(debuggerCore()->action(SortStructMembers), SIGNAL(valueChanged(QVariant)),
SLOT(reinsertAllData()));
connect(debuggerCore()->action(ShowStdNamespace), SIGNAL(valueChanged(QVariant)),
......@@ -1275,6 +1281,10 @@ void WatchHandler::endCycle()
m_locals->endCycle();
m_watchers->endCycle();
m_tooltips->endCycle();
m_contentsValid = true;
m_resetLocationScheduled = false;
updateWatchersWindow();
}
......@@ -1858,5 +1868,22 @@ void WatchHandler::editTypeFormats(bool includeLocals, const QByteArray &iname)
setTypeFormats(dlg.typeFormats());
}
void WatchHandler::scheduleResetLocation()
{
m_contentsValid = false;
m_resetLocationScheduled = true;
}
void WatchHandler::resetLocation()
{
if (m_resetLocationScheduled) {
m_resetLocationScheduled = false;
m_return->reset();
m_locals->reset();
m_watchers->reset();
m_tooltips->reset();
}
}
} // namespace Internal
} // namespace Debugger
......@@ -202,6 +202,9 @@ public:
QString editorContents();
void editTypeFormats(bool includeLocals, const QByteArray &iname);
void scheduleResetLocation();
void resetLocation();
private:
friend class WatchModel;
......@@ -234,6 +237,9 @@ private:
DebuggerEngine *m_engine;
int m_watcherCounter;
bool m_contentsValid;
bool m_resetLocationScheduled;
};
} // namespace Internal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment