]> cloud.milkyroute.net Git - dolphin.git/commitdiff
remember the maximum size, so that an update is also done for the (rare) case when...
authorPeter Penz <peter.penz19@gmail.com>
Sat, 19 Jul 2008 09:24:46 +0000 (09:24 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 19 Jul 2008 09:24:46 +0000 (09:24 +0000)
(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

src/statusbarspaceinfo.cpp
src/statusbarspaceinfo.h

index 20266e1a0e7e086e978758313714b81e02dfb6ec..059a55094e6f1074a641e2bdb81c10dc621cc388 100644 (file)
@@ -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();
     }
index d6caaa79e974d17ec8567f6c69a1e0c116e7d631..93ea3fe9f3d522662fabb807128c35c380001564 100644 (file)
@@ -61,6 +61,7 @@ private slots:
 private:
     bool m_gettingSize;
     bool m_foundMountPoint;
+    quint64 m_kBSize;
     KUrl m_url;
 };