mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-30 09:37:53 -04: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:
parent
f7f784c0f4
commit
a3249cae26
5 changed files with 119 additions and 159 deletions
|
@ -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>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue