mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kfreespace: remove redundant checks if device is storage volume
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3ad56ec0b3
commit
c44c42d306
2 changed files with 4 additions and 12 deletions
|
@ -203,10 +203,6 @@ void KCMFreeSpace::load()
|
||||||
|
|
||||||
KConfig kfreespaceconfig("kfreespacerc", KConfig::SimpleConfig);
|
KConfig kfreespaceconfig("kfreespacerc", KConfig::SimpleConfig);
|
||||||
foreach (const Solid::Device soliddevice, Solid::Device::allDevices()) {
|
foreach (const Solid::Device soliddevice, Solid::Device::allDevices()) {
|
||||||
const Solid::StorageVolume* solidstorage = soliddevice.as<Solid::StorageVolume>();
|
|
||||||
if (!solidstorage) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const Solid::StorageAccess* solidaccess = soliddevice.as<Solid::StorageAccess>();
|
const Solid::StorageAccess* solidaccess = soliddevice.as<Solid::StorageAccess>();
|
||||||
if (!solidaccess) {
|
if (!solidaccess) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -224,8 +220,8 @@ void KCMFreeSpace::load()
|
||||||
// qDebug() << Q_FUNC_INFO << soliddevice.udi();
|
// qDebug() << Q_FUNC_INFO << soliddevice.udi();
|
||||||
KConfigGroup kfreespacegroup = kfreespaceconfig.group(soliddevice.udi());
|
KConfigGroup kfreespacegroup = kfreespaceconfig.group(soliddevice.udi());
|
||||||
const bool kfreespacewatch = kfreespacegroup.readEntry("watch", s_kfreespacewatch);
|
const bool kfreespacewatch = kfreespacegroup.readEntry("watch", s_kfreespacewatch);
|
||||||
const qulonglong kfreespacechecktime = kfreespacegroup.readEntry("checktime", qlonglong(s_kfreespacechecktime));
|
const qulonglong kfreespacechecktime = kfreespacegroup.readEntry("checktime", s_kfreespacechecktime);
|
||||||
const qulonglong kfreespacefreespace = kfreespacegroup.readEntry("freespace", qlonglong(s_kfreespacefreespace));
|
const qulonglong kfreespacefreespace = kfreespacegroup.readEntry("freespace", s_kfreespacefreespace);
|
||||||
|
|
||||||
KFreeSpaceBox* devicebox = new KFreeSpaceBox(
|
KFreeSpaceBox* devicebox = new KFreeSpaceBox(
|
||||||
this,
|
this,
|
||||||
|
|
|
@ -65,10 +65,6 @@ void KFreeSpaceModule::slotInit()
|
||||||
KConfig kfreespaceconfig("kfreespacerc", KConfig::SimpleConfig);
|
KConfig kfreespaceconfig("kfreespacerc", KConfig::SimpleConfig);
|
||||||
bool watcherror = false;
|
bool watcherror = false;
|
||||||
foreach (const Solid::Device soliddevice, Solid::Device::allDevices()) {
|
foreach (const Solid::Device soliddevice, Solid::Device::allDevices()) {
|
||||||
const Solid::StorageVolume* solidstorage = soliddevice.as<Solid::StorageVolume>();
|
|
||||||
if (!solidstorage) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const Solid::StorageAccess* solidaccess = soliddevice.as<Solid::StorageAccess>();
|
const Solid::StorageAccess* solidaccess = soliddevice.as<Solid::StorageAccess>();
|
||||||
if (!solidaccess) {
|
if (!solidaccess) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -91,8 +87,8 @@ void KFreeSpaceModule::slotInit()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const qulonglong kfreespacechecktime = kfreespacegroup.readEntry("checktime", qulonglong(s_kfreespacechecktime));
|
const qulonglong kfreespacechecktime = kfreespacegroup.readEntry("checktime", s_kfreespacechecktime);
|
||||||
const qulonglong kfreespacefreespace = kfreespacegroup.readEntry("freespace", qulonglong(s_kfreespacefreespace));
|
const qulonglong kfreespacefreespace = kfreespacegroup.readEntry("freespace", s_kfreespacefreespace);
|
||||||
KFreeSpaceImpl* kfreespaceimpl = new KFreeSpaceImpl(this);
|
KFreeSpaceImpl* kfreespaceimpl = new KFreeSpaceImpl(this);
|
||||||
const bool kfreespacestatus = kfreespaceimpl->watch(
|
const bool kfreespacestatus = kfreespaceimpl->watch(
|
||||||
kfreespacedirpath,
|
kfreespacedirpath,
|
||||||
|
|
Loading…
Add table
Reference in a new issue