From 13b2fc55704fbc734cd4f9cbae56cfc2ef3ec0ce Mon Sep 17 00:00:00 2001 From: Jakub Stachowski Date: Sat, 7 Jun 2008 15:39:27 +0000 Subject: [PATCH] 1) Make sure that size qprogressbar is really updated after each change 2) Get rid of flicker when after changing partition new size is smaller than used space on old one - in this case setMaximum calls reset() 3) User proper value for comparison when checking if progressbar should be changed BUG: 163343 svn path=/trunk/KDE/kdebase/apps/; revision=818066 --- src/statusbarspaceinfo.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/statusbarspaceinfo.cpp b/src/statusbarspaceinfo.cpp index 555cfb891..c674a387a 100644 --- a/src/statusbarspaceinfo.cpp +++ b/src/statusbarspaceinfo.cpp @@ -66,17 +66,19 @@ void StatusBarSpaceInfo::slotFoundMountPoint(const QString& mountPoint, quint64 kBUsed, quint64 kBAvailable) { - Q_UNUSED(kBSize); Q_UNUSED(mountPoint); m_gettingSize = false; m_foundMountPoint = true; const bool valuesChanged = (kBUsed != static_cast(value())) || - (kBAvailable != static_cast(maximum())); + (kBSize != static_cast(maximum())); if (valuesChanged) { m_text = i18nc("@info:status Free disk space", "%1 free", KIO::convertSize(kBAvailable * 1024)); + setUpdatesEnabled(false); setMaximum(kBSize); setValue(kBUsed); + setUpdatesEnabled(true); + update(); } } @@ -88,9 +90,8 @@ void StatusBarSpaceInfo::slotDiskFreeSpaceDone() m_gettingSize = false; m_text = i18nc("@info:status", "Unknown size"); - setMinimum(0); - setMaximum(0); setValue(0); + update(); } void StatusBarSpaceInfo::refresh() @@ -98,6 +99,7 @@ void StatusBarSpaceInfo::refresh() // KDiskFreeSpace is for local paths only if (!m_url.isLocalFile()) { m_text = i18nc("@info:status", "Unknown size"); + setValue(0); update(); return; } @@ -133,9 +135,8 @@ void StatusBarSpaceInfo::showGettingSizeInfo() { if (m_gettingSize) { m_text = i18nc("@info:status", "Getting size..."); - update(); - setMinimum(0); setMaximum(0); + update(); } } -- 2.47.3