X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/daf788e858774b4d5e11ac199fecfa0e6896e1bb..13b2fc55704fbc734cd4f9cbae56cfc2ef3ec0ce:/src/statusbarspaceinfo.cpp diff --git a/src/statusbarspaceinfo.cpp b/src/statusbarspaceinfo.cpp index 8ee98a3d0..c674a387a 100644 --- a/src/statusbarspaceinfo.cpp +++ b/src/statusbarspaceinfo.cpp @@ -66,29 +66,32 @@ 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)); + 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() @@ -96,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; } @@ -116,7 +120,7 @@ void StatusBarSpaceInfo::refresh() quint64, quint64, quint64))); - connect(job, SIGNAL(done()), this, SLOT(slotKDFSDone())); + connect(job, SIGNAL(done()), this, SLOT(slotDiskFreeSpaceDone())); job->readDF(mp->mountPoint()); @@ -131,9 +135,8 @@ void StatusBarSpaceInfo::showGettingSizeInfo() { if (m_gettingSize) { m_text = i18nc("@info:status", "Getting size..."); - update(); - setMinimum(0); setMaximum(0); + update(); } }