| 629 | |
| 630 | |
| 631 | void DebugRegistersWidget::paste() |
| 632 | { |
| 633 | QModelIndexList sel = selectionModel()->selectedIndexes(); |
| 634 | if (sel.empty()) |
| 635 | return; |
| 636 | |
| 637 | if (sel[0].column() != DebugRegistersListModel::ValueColumn) |
| 638 | return; |
| 639 | |
| 640 | auto sourceIndex = m_filter->mapToSource(sel[0]); |
| 641 | if (!sourceIndex.isValid()) |
| 642 | return; |
| 643 | |
| 644 | auto reg = m_model->getRow(sourceIndex.row()); |
| 645 | |
| 646 | QClipboard* clipboard = QGuiApplication::clipboard(); |
| 647 | auto text = clipboard->text(); |
| 648 | |
| 649 | uint64_t newValue = 0; |
| 650 | std::string errorString; |
| 651 | if (!BinaryView::ParseExpression( |
| 652 | m_controller->GetLiveView(), text.toStdString(), newValue, reg.value(), errorString)) |
| 653 | return; |
| 654 | |
| 655 | if (newValue == reg.value()) |
| 656 | return; |
| 657 | |
| 658 | if (!m_controller->SetRegisterValue(reg.name(), newValue)) |
| 659 | return; |
| 660 | } |
| 661 | |
| 662 | |
| 663 | bool DebugRegistersWidget::selectionNotEmpty() |
nothing calls this directly
no test coverage detected