More cleanups.
This commit is contained in:
parent
0305435edd
commit
8b8131baec
@ -36,7 +36,9 @@ QVariant BreakPointModel::data(const QModelIndex& index, int role) const
|
|||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
{
|
{
|
||||||
if (index.column() == 0) {
|
switch (index.column()) {
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
std::map<Pica::DebugContext::Event, QString> map;
|
std::map<Pica::DebugContext::Event, QString> map;
|
||||||
map.insert({Pica::DebugContext::Event::CommandLoaded, tr("Pica command loaded")});
|
map.insert({Pica::DebugContext::Event::CommandLoaded, tr("Pica command loaded")});
|
||||||
map.insert({Pica::DebugContext::Event::CommandProcessed, tr("Pica command processed")});
|
map.insert({Pica::DebugContext::Event::CommandProcessed, tr("Pica command processed")});
|
||||||
@ -46,8 +48,13 @@ QVariant BreakPointModel::data(const QModelIndex& index, int role) const
|
|||||||
_dbg_assert_(GUI, map.size() == static_cast<size_t>(Pica::DebugContext::Event::NumEvents));
|
_dbg_assert_(GUI, map.size() == static_cast<size_t>(Pica::DebugContext::Event::NumEvents));
|
||||||
|
|
||||||
return map[event];
|
return map[event];
|
||||||
} else if (index.column() == 1) {
|
}
|
||||||
|
|
||||||
|
case 1:
|
||||||
return data(index, Role_IsEnabled).toBool() ? tr("Enabled") : tr("Disabled");
|
return data(index, Role_IsEnabled).toBool() ? tr("Enabled") : tr("Disabled");
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -177,14 +177,14 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const {
|
|||||||
if (role == Qt::DisplayRole) {
|
if (role == Qt::DisplayRole) {
|
||||||
QString content;
|
QString content;
|
||||||
if (index.column() == 0) {
|
if (index.column() == 0) {
|
||||||
content = QString::fromLatin1(Pica::Regs::GetCommandName(cmd.cmd_id).c_str());
|
QString content = QString::fromLatin1(Pica::Regs::GetCommandName(cmd.cmd_id).c_str());
|
||||||
content.append(" ");
|
content.append(" ");
|
||||||
|
return content;
|
||||||
} else if (index.column() == 1) {
|
} else if (index.column() == 1) {
|
||||||
content.append(QString("%1 ").arg(cmd.hex, 8, 16, QLatin1Char('0')));
|
QString content = QString("%1 ").arg(cmd.hex, 8, 16, QLatin1Char('0'));
|
||||||
content.append(QString("%1 ").arg(val, 8, 16, QLatin1Char('0')));
|
content.append(QString("%1 ").arg(val, 8, 16, QLatin1Char('0')));
|
||||||
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
return QVariant(content);
|
|
||||||
} else if (role == CommandIdRole) {
|
} else if (role == CommandIdRole) {
|
||||||
return QVariant::fromValue<int>(cmd.cmd_id.Value());
|
return QVariant::fromValue<int>(cmd.cmd_id.Value());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user