| 63 | } |
| 64 | |
| 65 | QVariant RamSearchModel::data(const QModelIndex &index, int role) const |
| 66 | { |
| 67 | MemValueType new_v; |
| 68 | const MemValueType* old_v; |
| 69 | |
| 70 | if (role == Qt::DisplayRole) { |
| 71 | switch(index.column()) { |
| 72 | case 0: |
| 73 | return QString("%1").arg(memscanner.get_address(index.row()), 0, 16); |
| 74 | case 1: |
| 75 | new_v = memscanner.get_current_value(index.row()); |
| 76 | return QString(MemValue::to_string(&new_v, value_type, hex)); |
| 77 | case 2: |
| 78 | old_v = memscanner.get_previous_value(index.row()); |
| 79 | return QString(MemValue::to_string(old_v, value_type, hex)); |
| 80 | default: |
| 81 | return QString(); |
| 82 | } |
| 83 | } |
| 84 | if (role == Qt::BackgroundRole) { |
| 85 | if (compare_type == CompareType::Previous) { |
| 86 | new_v = memscanner.get_current_value(index.row()); |
| 87 | old_v = memscanner.get_previous_value(index.row()); |
| 88 | if (!CompareOperations::check_previous(&new_v, old_v)) |
| 89 | return QBrush(unmatchedColor); |
| 90 | } |
| 91 | else { |
| 92 | new_v = memscanner.get_current_value(index.row()); |
| 93 | if (!CompareOperations::check_value(&new_v)) |
| 94 | return QBrush(unmatchedColor); |
| 95 | } |
| 96 | } |
| 97 | return QVariant(); |
| 98 | } |
| 99 | |
| 100 | int RamSearchModel::predictScanCount(int mem_flags) |
| 101 | { |
nothing calls this directly
no test coverage detected