┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/statusbarspaceinfo.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-07-19 09:24:46 +0000
committerPeter Penz <[email protected]>2008-07-19 09:24:46 +0000
commit8fc4bc196ac55f30e22113ab44b404e641679301 (patch)
treee89a1b0e179d9088bf74628432013cfaa49c7ab9 /src/statusbarspaceinfo.cpp
parentdc4827579d919034b06063075ef3b22f4a3cbc5e (diff)
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: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=834550
Diffstat (limited to 'src/statusbarspaceinfo.cpp')
-rw-r--r--src/statusbarspaceinfo.cpp7
1 files changed, 5 insertions, 2 deletions
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<quint64>(value()));
+ const bool valuesChanged = (kBUsed != static_cast<quint64>(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();
}