diff options
| author | spycrab <spycrab@users.noreply.github.com> | 2018-06-02 21:45:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-02 21:45:02 +0200 |
| commit | ba471c3214a63fcc7b4748632a68f6512714a4a0 (patch) | |
| tree | b348c3c898577100ec9a66bed7a9c50f05132c19 /Source/Core/DiscIO/Filesystem.cpp | |
| parent | 396810c450e739e3d1c0b0f03c416d67e98db5fb (diff) | |
| parent | f6865117e47fb48c58ab53af1297a79b850a345a (diff) | |
Merge pull request #7048 from spycrab/qt_fs_size
Qt/FilesystemWidget: Add size column
Diffstat (limited to 'Source/Core/DiscIO/Filesystem.cpp')
| -rw-r--r-- | Source/Core/DiscIO/Filesystem.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/Filesystem.cpp b/Source/Core/DiscIO/Filesystem.cpp index 9e5336db5d..68a7decb3e 100644 --- a/Source/Core/DiscIO/Filesystem.cpp +++ b/Source/Core/DiscIO/Filesystem.cpp @@ -8,6 +8,19 @@ namespace DiscIO { FileInfo::~FileInfo() = default; +u64 FileInfo::GetTotalSize() const +{ + if (!IsDirectory()) + return GetSize(); + + u64 size = 0; + + for (const auto& entry : *this) + size += entry.GetTotalSize(); + + return size; +} + FileSystem::~FileSystem() = default; -} // namespace +} // namespace DiscIO |
