#include "mountpointobserver.h"
-#include <KGlobal>
#include <KMountPoint>
#include <QTimer>
public:
MountPointObserverCache instance;
};
-K_GLOBAL_STATIC(MountPointObserverCacheSingleton, s_MountPointObserverCache)
+Q_GLOBAL_STATIC(MountPointObserverCacheSingleton, s_MountPointObserverCache)
MountPointObserverCache::MountPointObserverCache() :
m_observerForMountPoint(),
m_mountPointForObserver(),
- m_updateTimer(0)
+ m_updateTimer(nullptr)
{
m_updateTimer = new QTimer(this);
}
} else {
// Even if determining the mount point failed, the observer might still
// be able to retrieve information about the url.
- cachedObserverUrl = url.toLocalFile();
+ cachedObserverUrl = url;
}
} else {
- cachedObserverUrl = url.url();
+ cachedObserverUrl = url;
}
MountPointObserver* observer = m_observerForMountPoint.value(cachedObserverUrl);
connect(observer, &MountPointObserver::destroyed, this, &MountPointObserverCache::slotObserverDestroyed);
if (!m_updateTimer->isActive()) {
- m_updateTimer->start(10000);
+ m_updateTimer->start(60000); // 1 minute
}
connect(m_updateTimer, &QTimer::timeout, observer, &MountPointObserver::update);