mirror of
https://github.com/aristocratos/btop.git
synced 2024-05-29 16:50:20 +12:00
show all disks
This commit is contained in:
parent
56119f99a9
commit
ca67526dc1
|
@ -534,7 +534,6 @@ namespace Mem {
|
||||||
found.push_back(mountpoint);
|
found.push_back(mountpoint);
|
||||||
if (not v_contains(last_found, mountpoint))
|
if (not v_contains(last_found, mountpoint))
|
||||||
redraw = true;
|
redraw = true;
|
||||||
last_found = std::move(found);
|
|
||||||
|
|
||||||
if (disks.at(mountpoint).dev.empty())
|
if (disks.at(mountpoint).dev.empty())
|
||||||
disks.at(mountpoint).dev = dev;
|
disks.at(mountpoint).dev = dev;
|
||||||
|
@ -544,6 +543,17 @@ namespace Mem {
|
||||||
disks.at(mountpoint).total = stfs[i].f_iosize;
|
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
|
//? Get disk/partition stats
|
||||||
for (auto &[mountpoint, disk] : disks) {
|
for (auto &[mountpoint, disk] : disks) {
|
||||||
if (std::error_code ec; not fs::exists(mountpoint, ec))
|
if (std::error_code ec; not fs::exists(mountpoint, ec))
|
||||||
|
|
Loading…
Reference in a new issue