summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJos Dehaes <jos.dehaes@gmail.com>2021-10-06 10:33:55 +0200
committerJos Dehaes <jos.dehaes@gmail.com>2021-10-06 10:33:55 +0200
commit548203e93dfaf3ec9f24086bee08aac85891c4df (patch)
tree3bbac77c06fce482fa7ab4e8e2fb9e099ed24af4
parent0ab2be39857fb3dcdb13b49bc9155f17c7d82a4e (diff)
show all disks
-rw-r--r--src/osx/btop_collect.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/osx/btop_collect.cpp b/src/osx/btop_collect.cpp
index 97c30f9..6724f14 100644
--- a/src/osx/btop_collect.cpp
+++ b/src/osx/btop_collect.cpp
@@ -534,7 +534,6 @@ namespace Mem {
found.push_back(mountpoint);
if (not v_contains(last_found, mountpoint))
redraw = true;
- last_found = std::move(found);
if (disks.at(mountpoint).dev.empty())
disks.at(mountpoint).dev = dev;
@@ -544,6 +543,17 @@ namespace Mem {
disks.at(mountpoint).total = stfs[i].f_iosize;
}
+ //? Remove disks no longer mounted or filtered out
+ if (swap_disk and has_swap) found.push_back("swap");
+ for (auto it = disks.begin(); it != disks.end();) {
+ if (not v_contains(found, it->first))
+ it = disks.erase(it);
+ else
+ it++;
+ }
+ if (found.size() != last_found.size()) redraw = true;
+ last_found = std::move(found);
+
//? Get disk/partition stats
for (auto &[mountpoint, disk] : disks) {
if (std::error_code ec; not fs::exists(mountpoint, ec))