Commit 50fdd3e1 authored by Méven Car's avatar Méven Car

Use KFileItem::recursiveSize to Display recursize size as total size

Summary:
This allows to display the trash:/ occupied space

CCBUG: 413091

Test Plan: {F8231067}

Reviewers: #dolphin, ngraham, elvisangelaccio, dfaure

Reviewed By: #dolphin, ngraham, elvisangelaccio, dfaure

Subscribers: #baloo

Tags: #baloo

Differential Revision: https://phabricator.kde.org/D28738
parent 3c81db80
......@@ -8,7 +8,7 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
project(baloo-widgets VERSION ${RELEASE_SERVICE_VERSION})
set(QT_MIN_VERSION "5.11.0")
set(KF5_MIN_VERSION "5.60.0")
set(KF5_MIN_VERSION "5.70.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${ECM_MODULE_PATH})
......
......@@ -152,6 +152,7 @@ void FileMetaDataProvider::insertSingleFileBasicData()
if (m_fileItems.count() == 1) {
const KFileItem& item = m_fileItems.first();
KFormat format;
if (item.isDir()) {
bool isSizeUnknown = !item.isLocalFile();
if (!isSizeUnknown) {
......@@ -172,14 +173,16 @@ void FileMetaDataProvider::insertSingleFileBasicData()
}
else if (item.entry().contains(KIO::UDSEntry::UDS_SIZE)) {
isSizeUnknown = false;
KFormat format;
m_data.insert(QStringLiteral("kfileitem#size"), format.formatByteSize(item.size()));
}
if (item.entry().contains(KIO::UDSEntry::UDS_RECURSIVE_SIZE)) {
isSizeUnknown = false;
m_data.insert(QStringLiteral("kfileitem#totalSize"), format.formatByteSize(item.recursiveSize()));
}
if (isSizeUnknown) {
m_data.insert(QStringLiteral("kfileitem#size"), i18nc("unknown file size", "Unknown"));
}
} else {
KFormat format;
m_data.insert(QStringLiteral("kfileitem#size"), format.formatByteSize(item.size()));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment