From: Peter Penz Date: Sat, 19 Jul 2008 09:24:46 +0000 (+0000) Subject: remember the maximum size, so that an update is also done for the (rare) case when... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/8fc4bc196ac55f30e22113ab44b404e641679301?ds=inline remember the maximum size, so that an update is also done for the (rare) case when two partitions have a different size but an equal used size (no backport to KDE 4.1 necessary, as there QProgressBar is used instead of KCapacityBar) CCMAIL: ereslibre@kde.org svn path=/trunk/KDE/kdebase/apps/; revision=834550 --- diff --git a/src/statusbarspaceinfo.cpp b/src/statusbarspaceinfo.cpp index 20266e1a0..059a55094 100644 --- a/src/statusbarspaceinfo.cpp +++ b/src/statusbarspaceinfo.cpp @@ -31,7 +31,8 @@ StatusBarSpaceInfo::StatusBarSpaceInfo(QWidget* parent) : KCapacityBar(KCapacityBar::DrawTextInline, parent), m_gettingSize(false), - m_foundMountPoint(false) + m_foundMountPoint(false), + m_kBSize(0) { setMaximumWidth(200); setMinimumWidth(200); // something to fix on kcapacitybar (ereslibre) @@ -62,10 +63,11 @@ void StatusBarSpaceInfo::slotFoundMountPoint(const QString& mountPoint, m_gettingSize = false; m_foundMountPoint = true; - const bool valuesChanged = (kBUsed != static_cast(value())); + const bool valuesChanged = (kBUsed != static_cast(value())) || (kBSize != m_kBSize); if (valuesChanged) { setText(i18nc("@info:status Free disk space", "%1 free", KIO::convertSize(kBAvailable * 1024))); setUpdatesEnabled(false); + m_kBSize = kBSize; setValue((kBUsed * 100) / kBSize); setUpdatesEnabled(true); update(); @@ -124,6 +126,7 @@ void StatusBarSpaceInfo::refresh() void StatusBarSpaceInfo::showGettingSizeInfo() { if (m_gettingSize) { + m_kBSize = 0; setText(i18nc("@info:status", "Getting size...")); update(); } diff --git a/src/statusbarspaceinfo.h b/src/statusbarspaceinfo.h index d6caaa79e..93ea3fe9f 100644 --- a/src/statusbarspaceinfo.h +++ b/src/statusbarspaceinfo.h @@ -61,6 +61,7 @@ private slots: private: bool m_gettingSize; bool m_foundMountPoint; + quint64 m_kBSize; KUrl m_url; };