forked from qt-creator/qt-creator
debugger: remove needless indirection
This commit is contained in:
@@ -580,17 +580,6 @@ static inline QString expression(const WatchItem *item)
|
||||
|
||||
QVariant WatchModel::data(const QModelIndex &idx, int role) const
|
||||
{
|
||||
switch (role) {
|
||||
case EngineCapabilitiesRole:
|
||||
return engine()->debuggerCapabilities();
|
||||
|
||||
case EngineActionsEnabledRole:
|
||||
return engine()->debuggerActionsEnabled();
|
||||
|
||||
case EngineStateRole:
|
||||
return QVariant(int(engine()->state()));
|
||||
}
|
||||
|
||||
const WatchItem *item = watchItem(idx);
|
||||
const WatchItem &data = *item;
|
||||
|
||||
|
||||
@@ -334,12 +334,11 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
individualFormatMenu.setEnabled(false);
|
||||
}
|
||||
|
||||
const bool actionsEnabled = modelData(EngineActionsEnabledRole).toBool();
|
||||
const unsigned engineCapabilities = modelData(EngineCapabilitiesRole).toUInt();
|
||||
const bool actionsEnabled = engine->debuggerActionsEnabled();
|
||||
const unsigned engineCapabilities = engine->debuggerCapabilities();
|
||||
const bool canHandleWatches =
|
||||
actionsEnabled && (engineCapabilities & AddWatcherCapability);
|
||||
const DebuggerState state =
|
||||
static_cast<DebuggerState>(modelData(EngineStateRole).toInt());
|
||||
const DebuggerState state = engine->state();
|
||||
|
||||
QMenu menu;
|
||||
QAction *actInsertNewWatchItem = menu.addAction(tr("Insert New Watch Item"));
|
||||
@@ -592,12 +591,6 @@ void WatchWindow::setModelData
|
||||
model()->setData(index, value, role);
|
||||
}
|
||||
|
||||
QVariant WatchWindow::modelData(int role, const QModelIndex &index)
|
||||
{
|
||||
QTC_ASSERT(model(), return QVariant());
|
||||
return model()->data(index, role);
|
||||
}
|
||||
|
||||
void WatchWindow::setWatchpoint(quint64 address)
|
||||
{
|
||||
breakHandler()->setWatchpointByAddress(address);
|
||||
|
||||
@@ -79,7 +79,6 @@ private:
|
||||
|
||||
void setModelData(int role, const QVariant &value = QVariant(),
|
||||
const QModelIndex &index = QModelIndex());
|
||||
QVariant modelData(int role, const QModelIndex &index = QModelIndex());
|
||||
|
||||
bool m_alwaysResizeColumnsToContents;
|
||||
Type m_type;
|
||||
|
||||
Reference in New Issue
Block a user