#include "statusbarspaceinfo.h"
#include <KDiskFreeSpaceInfo>
-#include <kmountpoint.h>
-#include <klocale.h>
-#include <kio/job.h>
+#include <KLocale>
+#include <KIO/Job>
#include <QTimer>
#include <QKeyEvent>
m_kBSize(0),
m_timer(0)
{
- setMaximumWidth(200);
- setMinimumWidth(200); // something to fix on kcapacitybar (ereslibre)
-
// Use a timer to update the space information. Polling is useful
// here, as files can be deleted/added outside the scope of Dolphin.
m_timer = new QTimer(this);
refresh();
}
+KUrl StatusBarSpaceInfo::url() const
+{
+ return m_url;
+}
+
void StatusBarSpaceInfo::showEvent(QShowEvent* event)
{
KCapacityBar::showEvent(event);
return;
}
- KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(m_url.toLocalFile());
- if (!mp) {
- return;
- }
-
- KDiskFreeSpaceInfo job = KDiskFreeSpaceInfo::freeSpaceInfo(mp->mountPoint());
+ KDiskFreeSpaceInfo job = KDiskFreeSpaceInfo::freeSpaceInfo(m_url.toLocalFile());
if (!job.isValid()) {
setText(i18nc("@info:status", "Unknown size"));
setValue(0);