| 855 | } |
| 856 | |
| 857 | void MemoryDialog::onAdd() |
| 858 | { |
| 859 | const auto slices = m_model->slices(); |
| 860 | if (slices.isEmpty()) |
| 861 | return; |
| 862 | |
| 863 | SliceModel* active = nullptr; |
| 864 | for (auto* candidate : slices) { |
| 865 | if (candidate && candidate->isActive()) { |
| 866 | active = candidate; |
| 867 | break; |
| 868 | } |
| 869 | } |
| 870 | if (!active) |
| 871 | active = slices.first(); |
| 872 | if (!active) |
| 873 | return; |
| 874 | |
| 875 | createMemoryFromSlice(m_model, active, QString(), this, |
| 876 | [this](int code, const QString&, int memoryIndex) { |
| 877 | if (code != 0 || memoryIndex < 0) |
| 878 | return; |
| 879 | |
| 880 | m_pendingEditMemoryIndex = memoryIndex; |
| 881 | m_pendingEditRetries = 3; |
| 882 | populateTable(); |
| 883 | }); |
| 884 | } |
| 885 | |
| 886 | void MemoryDialog::onExport() |
| 887 | { |
nothing calls this directly
no test coverage detected