mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 10:22:49 +00:00
kfreespace: skip free space check for devices that are not mounted
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
99cca218ec
commit
921e8fdb6f
3 changed files with 5 additions and 3 deletions
|
@ -30,7 +30,6 @@
|
|||
#include <kpluginfactory.h>
|
||||
#include <kpluginloader.h>
|
||||
#include <solid/device.h>
|
||||
#include <solid/storagevolume.h>
|
||||
#include <solid/storageaccess.h>
|
||||
|
||||
class KFreeSpaceBox : public QGroupBox
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "kded_kfreespace.h"
|
||||
#include "kfreespace.h"
|
||||
|
||||
#include <QTimer>
|
||||
#include <klocale.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <kconfiggroup.h>
|
||||
|
@ -27,7 +26,6 @@
|
|||
#include <kpluginfactory.h>
|
||||
#include <kdebug.h>
|
||||
#include <solid/device.h>
|
||||
#include <solid/storagevolume.h>
|
||||
#include <solid/storageaccess.h>
|
||||
#include <solid/devicenotifier.h>
|
||||
|
||||
|
|
|
@ -66,6 +66,11 @@ void KFreeSpaceImpl::timerEvent(QTimerEvent *event)
|
|||
const Solid::StorageAccess* solidaccess = m_soliddevice.as<Solid::StorageAccess>();
|
||||
Q_ASSERT(solidaccess);
|
||||
const QString mountpoint = solidaccess->filePath();
|
||||
if (mountpoint.isEmpty()) {
|
||||
kDebug() << "Device not mounted" << m_soliddevice.udi();
|
||||
return;
|
||||
}
|
||||
|
||||
const KDiskFreeSpaceInfo kdiskinfo = KDiskFreeSpaceInfo::freeSpaceInfo(mountpoint);
|
||||
if (!kdiskinfo.isValid()) {
|
||||
kDebug() << "Disk info is not valid for" << mountpoint;
|
||||
|
|
Loading…
Add table
Reference in a new issue