┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/statusbarspaceinfo.cpp
diff options
context:
space:
mode:
authorJakub Stachowski <[email protected]>2008-06-07 15:39:27 +0000
committerJakub Stachowski <[email protected]>2008-06-07 15:39:27 +0000
commit13b2fc55704fbc734cd4f9cbae56cfc2ef3ec0ce (patch)
tree75119d8974f770a0c0886f7ade4fe6cf3da31709 /src/statusbarspaceinfo.cpp
parent4a91b1c563145ad75776890cdd113d429202e0e2 (diff)
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
Diffstat (limited to 'src/statusbarspaceinfo.cpp')
-rw-r--r--src/statusbarspaceinfo.cpp13
1 files 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<quint64>(value())) ||
- (kBAvailable != static_cast<quint64>(maximum()));
+ (kBSize != static_cast<quint64>(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();
}
}