mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-05 16:19:10 +00:00
Allow to display UDS_RECURSIVE_SIZE in status bar
Summary: Useful for trash:/ in particular Test Plan: {F8233980} Reviewers: #dolphin, dfaure, elvisangelaccio, ngraham Reviewed By: #dolphin, ngraham Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D28794
This commit is contained in:
parent
fa3f3a475d
commit
ac234a9c55
|
@ -8,7 +8,7 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
|
||||||
project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
|
project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
|
||||||
|
|
||||||
set(QT_MIN_VERSION "5.11.0")
|
set(QT_MIN_VERSION "5.11.0")
|
||||||
set(KF5_MIN_VERSION "5.69.0")
|
set(KF5_MIN_VERSION "5.70.0")
|
||||||
|
|
||||||
# ECM setup
|
# ECM setup
|
||||||
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
|
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
|
||||||
|
|
|
@ -1493,15 +1493,29 @@ void DolphinView::calculateItemCount(int& fileCount,
|
||||||
KIO::filesize_t& totalFileSize) const
|
KIO::filesize_t& totalFileSize) const
|
||||||
{
|
{
|
||||||
const int itemCount = m_model->count();
|
const int itemCount = m_model->count();
|
||||||
|
|
||||||
|
bool countFileSize = true;
|
||||||
|
|
||||||
|
// In case we have a precomputed value
|
||||||
|
const auto job = KIO::stat(m_model->rootItem().url());
|
||||||
|
job->exec();
|
||||||
|
const auto entry = job->statResult();
|
||||||
|
if (entry.contains(KIO::UDSEntry::UDS_RECURSIVE_SIZE)) {
|
||||||
|
totalFileSize = static_cast<KIO::filesize_t>(entry.numberValue(KIO::UDSEntry::UDS_RECURSIVE_SIZE));
|
||||||
|
countFileSize = false;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < itemCount; ++i) {
|
for (int i = 0; i < itemCount; ++i) {
|
||||||
const KFileItem item = m_model->fileItem(i);
|
const KFileItem item = m_model->fileItem(i);
|
||||||
if (item.isDir()) {
|
if (item.isDir()) {
|
||||||
++folderCount;
|
++folderCount;
|
||||||
} else {
|
} else {
|
||||||
++fileCount;
|
++fileCount;
|
||||||
|
if (countFileSize) {
|
||||||
totalFileSize += item.size();
|
totalFileSize += item.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DolphinView::slotTwoClicksRenamingTimerTimeout()
|
void DolphinView::slotTwoClicksRenamingTimerTimeout()
|
||||||
|
|
Loading…
Reference in a new issue