From 89ede4b9a170ffd2f3f155f081630edf3f2998ab Mon Sep 17 00:00:00 2001 From: Chris Holland Date: Fri, 12 Jun 2020 16:06:59 -0400 Subject: Refactor capacity by to use async KIO FreeSpaceJob. Based on this kio filepicker patch: https://github.com/KDE/kio/commit/933887dc334f3498505af7a86d25db7faae91019 --- src/panels/places/placesitemlistwidget.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/panels/places/placesitemlistwidget.h') diff --git a/src/panels/places/placesitemlistwidget.h b/src/panels/places/placesitemlistwidget.h index a82616ff3..f33f2f2c8 100644 --- a/src/panels/places/placesitemlistwidget.h +++ b/src/panels/places/placesitemlistwidget.h @@ -9,6 +9,24 @@ #include "kitemviews/kstandarditemlistwidget.h" +#include +#include + +#include + + +// The free space / capacity bar is based on KFilePlacesView. +// https://github.com/KDE/kio/commit/933887dc334f3498505af7a86d25db7faae91019 +struct PlaceFreeSpaceInfo +{ + QDateTime lastUpdated; + KIO::filesize_t used = 0; + KIO::filesize_t size = 0; + qreal usedRatio = 0; + QPointer job; +}; + + /** * @brief Extends KStandardItemListWidget to interpret the hidden * property of the PlacesModel and use the right text color. @@ -31,9 +49,8 @@ protected: void resetCapacityBar(); private: - bool m_isMountPoint; bool m_drawCapacityBar; - qreal m_capacityBarRatio; + PlaceFreeSpaceInfo m_freeSpaceInfo; }; #endif -- cgit v1.3.1