diff --git a/src/summaryWidget.cpp b/src/summaryWidget.cpp --- a/src/summaryWidget.cpp +++ b/src/summaryWidget.cpp @@ -37,6 +37,7 @@ #include #include #include +#include namespace Filelight { @@ -52,7 +53,7 @@ }; -struct DiskList : QList +struct DiskList : QMap { DiskList(); }; @@ -107,7 +108,7 @@ for (DiskList::ConstIterator it = disks.constBegin(), end = disks.constEnd(); it != end; ++it) { - Disk const &disk = *it; + Disk const &disk = it.value(); if (disk.free == 0 && disk.used == 0) continue; @@ -150,9 +151,7 @@ DiskList::DiskList() { - static const QSet ignoredFsTypes = { "tmpfs", "squashfs" }; - - QStringList partitions; + static const QSet ignoredFsTypes = { "tmpfs", "squashfs", "autofs" }; for (const QStorageInfo &storage : QStorageInfo::mountedVolumes()) { if (!storage.isReady() || ignoredFsTypes.contains(storage.fileSystemType())) { @@ -166,7 +165,8 @@ disk.free = storage.bytesFree(); disk.used = disk.size - disk.free; - *this += disk; + // if something is mounted over same path, last mounted point would be used since only it is currently reachable. + (*this)[disk.mount] = disk; } }