mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-11 09:09:29 +00:00
BLE Rx/Tx App Cleanup (#1570)
* Showing highest dB first * Including namestring in search * Using replace seems to work better. * bletx cleanup * removing pop * pop is needed on this view. * cleanup switching * reduce to 1 entry list * Setting to use the name of BLE with a toggle checkbox. * Removed &nav reference. * Removing const * Fixed issue with memory being run out when switching from a previous app * Fixed not setting updated progressbar for each new packet.
This commit is contained in:
@@ -103,19 +103,28 @@ void sortEntriesBy(ContainerType& entries, KeySelector keySelector, SortOrder as
|
||||
}
|
||||
|
||||
template <typename ContainerType, typename KeySelector>
|
||||
void removeEntriesWithoutKey(ContainerType& entries, ContainerType& filteredEntries, KeySelector keySelector) {
|
||||
void resetFilteredEntries(ContainerType& entries, KeySelector keySelector) {
|
||||
// Clear the filteredEntries container
|
||||
filteredEntries.clear();
|
||||
|
||||
auto it = entries.begin();
|
||||
while (it != entries.end()) {
|
||||
if (!keySelector(*it)) {
|
||||
filteredEntries.emplace_back(*it); // Add a new entry to filteredEntries
|
||||
if (keySelector(*it)) {
|
||||
entries.erase(it); // Add a new entry to filteredEntries
|
||||
}
|
||||
++it; // Move to the next element, outside of the if block
|
||||
}
|
||||
}
|
||||
|
||||
template <typename ContainerType, typename MemberPtr, typename KeyValue>
|
||||
void setAllMembersToValue(ContainerType& entries, MemberPtr memberPtr, const KeyValue& keyValue) {
|
||||
for (auto& entry : entries) {
|
||||
// Check if the member specified by memberPtr is equal to keyValue
|
||||
if (entry.*memberPtr != keyValue) {
|
||||
// Update the member with keyValue
|
||||
entry.*memberPtr = keyValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace ui {
|
||||
|
||||
using RecentEntriesColumn = std::pair<std::string, size_t>;
|
||||
|
||||
Reference in New Issue
Block a user