| 5462 | } |
| 5463 | |
| 5464 | void MainWindow::syncMemorySpot(int memoryIndex) |
| 5465 | { |
| 5466 | auto it = m_radioModel.memories().constFind(memoryIndex); |
| 5467 | if (it == m_radioModel.memories().constEnd()) { |
| 5468 | removeMemorySpot(memoryIndex); |
| 5469 | return; |
| 5470 | } |
| 5471 | |
| 5472 | const MemoryEntry& memory = it.value(); |
| 5473 | if (memory.freq <= 0.0) { |
| 5474 | removeMemorySpot(memoryIndex); |
| 5475 | return; |
| 5476 | } |
| 5477 | |
| 5478 | QMap<QString, QString> kvs; |
| 5479 | kvs["callsign"] = memorySpotLabel(memory).replace(' ', QChar(0x7f)); |
| 5480 | kvs["rx_freq"] = QString::number(memory.freq, 'f', 6); |
| 5481 | kvs["tx_freq"] = QString::number(memory.freq, 'f', 6); |
| 5482 | kvs["source"] = "Memory"; |
| 5483 | kvs["mode"] = memory.mode; |
| 5484 | kvs["color"] = "#FFFFC857"; |
| 5485 | const QString comment = memorySpotComment(memory); |
| 5486 | if (!comment.isEmpty()) |
| 5487 | kvs["comment"] = QString(comment).replace(' ', QChar(0x7f)); |
| 5488 | |
| 5489 | m_radioModel.spotModel().applySpotStatus(memorySpotId(memoryIndex), kvs); |
| 5490 | } |
| 5491 | |
| 5492 | void MainWindow::removeMemorySpot(int memoryIndex) |
| 5493 | { |
nothing calls this directly
no test coverage detected