- m_gettingSize = true;
- m_foundMountPoint = false;
- KDiskFreeSpace* job = new KDiskFreeSpace(this);
- connect(job, SIGNAL(foundMountPoint(const QString&,
- quint64,
- quint64,
- quint64)),
- this, SLOT(slotFoundMountPoint(const QString&,
- quint64,
- quint64,
- quint64)));
- connect(job, SIGNAL(done()), this, SLOT(slotKDFSDone()));
-
- job->readDF(mp->mountPoint());
-
- // refresh() is invoked for each directory change. Usually getting
- // the size information can be done very fast, so to prevent any
- // flickering the "Getting size..." indication is only shown if
- // at least 300 ms have been passed.
- QTimer::singleShot(300, this, SLOT(showGettingSizeInfo()));
-}
+ KDiskFreeSpaceInfo job = KDiskFreeSpaceInfo::freeSpaceInfo(mp->mountPoint());
+ if (!job.isValid()) {
+ setText(i18nc("@info:status", "Unknown size"));
+ setValue(0);
+ update();
+ return;
+ }