┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/statusbarspaceinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/statusbarspaceinfo.cpp')
-rw-r--r--src/statusbarspaceinfo.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/statusbarspaceinfo.cpp b/src/statusbarspaceinfo.cpp
index 8da3dc947..6ccedd77d 100644
--- a/src/statusbarspaceinfo.cpp
+++ b/src/statusbarspaceinfo.cpp
@@ -31,6 +31,7 @@
StatusBarSpaceInfo::StatusBarSpaceInfo(QWidget* parent) :
QProgressBar(parent),
m_gettingSize(false),
+ m_foundMountPoint(false),
m_text()
{
setMinimum(0);
@@ -69,6 +70,7 @@ void StatusBarSpaceInfo::slotFoundMountPoint(const QString& mountPoint,
Q_UNUSED(mountPoint);
m_gettingSize = false;
+ m_foundMountPoint = true;
const bool valuesChanged = (kBUsed != static_cast<quint64>(value())) ||
(kBAvailable != static_cast<quint64>(maximum()));
if (valuesChanged) {
@@ -78,6 +80,17 @@ void StatusBarSpaceInfo::slotFoundMountPoint(const QString& mountPoint,
}
}
+void StatusBarSpaceInfo::slotKDFSDone()
+{
+ if( m_foundMountPoint )
+ return;
+ m_gettingSize = false;
+ m_text = i18n("Free disk space could not be determined");
+ setMinimum(0);
+ setMaximum(0);
+ setValue(0);
+}
+
void StatusBarSpaceInfo::refresh()
{
// KDiskFreeSpace is for local paths only
@@ -93,6 +106,7 @@ void StatusBarSpaceInfo::refresh()
}
m_gettingSize = true;
+ m_foundMountPoint = false;
KDiskFreeSpace* job = new KDiskFreeSpace(this);
connect(job, SIGNAL(foundMountPoint(const QString&,
quint64,
@@ -102,6 +116,7 @@ void StatusBarSpaceInfo::refresh()
quint64,
quint64,
quint64)));
+ connect(job, SIGNAL(done()), this, SLOT(slotKDFSDone()));
job->readDF(mp->mountPoint());