diff options
| author | spycrab <spycrab@users.noreply.github.com> | 2018-06-02 18:14:42 +0200 |
|---|---|---|
| committer | spycrab <spycrab@users.noreply.github.com> | 2018-06-02 18:59:56 +0200 |
| commit | f6865117e47fb48c58ab53af1297a79b850a345a (patch) | |
| tree | 3bbd307e4b852a40f166b7a9b4279e070f321621 /Source/Core/DiscIO/Filesystem.cpp | |
| parent | f09f83c309e2c4a0e80648dc698cecd4ecba3f8f (diff) | |
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 |
