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*1000));
+ m_text = i18nc("@info:status Free disk space", "%1 free", KIO::convertSize(kBAvailable * 1024));
+ setUpdatesEnabled(false);
setMaximum(kBSize);
setValue(kBUsed);
+ setUpdatesEnabled(true);
+ update();
}
}
-void StatusBarSpaceInfo::slotKDFSDone()
+void StatusBarSpaceInfo::slotDiskFreeSpaceDone()
{
- if( m_foundMountPoint )
+ if (m_foundMountPoint) {
return;
+ }
+
m_gettingSize = false;
- m_text = i18n("Free disk space could not be determined");
- setMinimum(0);
- setMaximum(0);
+ m_text = i18nc("@info:status", "Unknown size");
setValue(0);
+ update();
}
void StatusBarSpaceInfo::refresh()
// KDiskFreeSpace is for local paths only
if (!m_url.isLocalFile()) {
m_text = i18nc("@info:status", "Unknown size");
+ setValue(0);
update();
return;
}
quint64,
quint64,
quint64)));
- connect(job, SIGNAL(done()), this, SLOT(slotKDFSDone()));
+ connect(job, SIGNAL(done()), this, SLOT(slotDiskFreeSpaceDone()));
job->readDF(mp->mountPoint());
{
if (m_gettingSize) {
m_text = i18nc("@info:status", "Getting size...");
- update();
- setMinimum(0);
setMaximum(0);
+ update();
}
}