Commit 8dd04f2c authored by Alexander Lohnau's avatar Alexander Lohnau 💬

Run clang-format

If you want git blame to ignore formatting revisions run:
git config blame.ignoreRevsFile .git-blame-ignore-revs
parent faa7d365
......@@ -4,10 +4,10 @@
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QJsonDocument>
#include <QObject>
#include <QStandardPaths>
#include <QTest>
#include <QJsonDocument>
#include <KSycoca>
#include <smartdata.h>
......
......@@ -4,10 +4,10 @@
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QJsonDocument>
#include <QObject>
#include <QStandardPaths>
#include <QTest>
#include <QJsonDocument>
#include <functional>
......@@ -30,8 +30,7 @@ class SMARTMonitorTest : public QObject
{
Q_OBJECT
struct Payload
{
struct Payload {
QJsonDocument doc;
bool err = true;
};
......@@ -55,10 +54,14 @@ private Q_SLOTS:
auto ctl = new MockCtl; // new; monitor takes ownership!
Payload payload;
load("fixtures/pass.json", payload);
if (payload.err) { return; }
if (payload.err) {
return;
}
ctl->m_docs["/dev/testfoobarpass"] = payload.doc;
load("fixtures/fail.json", payload);
if (payload.err) { return; }
if (payload.err) {
return;
}
ctl->m_docs["/dev/testfoobarfail"] = payload.doc;
// NOTE: monitor still talks to solid but we aren't interested in its results
......@@ -66,10 +69,10 @@ private Q_SLOTS:
SMARTMonitor monitor(ctl);
// don't start it, that'd only run solid stuff that we do not test here
monitor.checkDevice(new Device {"udi-pass", "product", "/dev/testfoobarpass"});
monitor.checkDevice(new Device{"udi-pass", "product", "/dev/testfoobarpass"});
// discover this twice to ensure notifications aren't duplicated!
monitor.checkDevice(new Device {"udi-fail", "product", "/dev/testfoobarfail"});
monitor.checkDevice(new Device {"udi-fail", "product", "/dev/testfoobarfail"});
monitor.checkDevice(new Device{"udi-fail", "product", "/dev/testfoobarfail"});
monitor.checkDevice(new Device{"udi-fail", "product", "/dev/testfoobarfail"});
bool sawPass = false;
bool sawFail = false;
......
......@@ -28,8 +28,7 @@ public:
}
const int fooIndex = metaObject()->indexOfMethod("onPropertyChanged()"); // of adaptor
Q_ASSERT(fooIndex != -1);
connect(adaptee, property.notifySignal(),
this, metaObject()->method(fooIndex));
connect(adaptee, property.notifySignal(), this, metaObject()->method(fooIndex));
}
}
......@@ -52,14 +51,11 @@ private slots:
if (ciid == -1) {
continue;
}
QDBusMessage signal = QDBusMessage::createSignal(
m_objectPath,
QStringLiteral("org.freedesktop.DBus.Properties"),
QStringLiteral("PropertiesChanged"));
QDBusMessage signal = QDBusMessage::createSignal(m_objectPath, //
QStringLiteral("org.freedesktop.DBus.Properties"),
QStringLiteral("PropertiesChanged"));
signal << mo->classInfo(ciid).value();
signal << QVariantMap({
{ QString::fromLatin1(property.name()), property.read(sender()) }
}); // changed properties DICT<STRING,VARIANT>
signal << QVariantMap({{QString::fromLatin1(property.name()), property.read(sender())}}); // changed properties DICT<STRING,VARIANT>
signal << QStringList(); // invalidated property names no clue what invalidation means
QDBusConnection::sessionBus().send(signal);
}
......@@ -76,12 +72,8 @@ KDBusObjectManagerServer::KDBusObjectManagerServer(QObject *parent)
QDBusConnection connection = QDBusConnection::sessionBus();
if (!connection.registerObject(m_path,
this,
QDBusConnection::ExportAllSlots
| QDBusConnection::ExportAllSignals
| QDBusConnection::ExportAllProperties
| QDBusConnection::ExportAllInvokables
| QDBusConnection::ExportAllContents
| QDBusConnection::ExportAdaptors)) {
QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals | QDBusConnection::ExportAllProperties
| QDBusConnection::ExportAllInvokables | QDBusConnection::ExportAllContents | QDBusConnection::ExportAdaptors)) {
qCDebug(KDED) << "failed to register" << m_path;
return;
}
......@@ -91,24 +83,22 @@ bool KDBusObjectManagerServer::serve(QObject *object)
{
m_managedObjects << object;
emit InterfacesAdded(path(object), interfacePropertiesMap(object));
connect(object, &QObject::destroyed, this, [this](QObject *obj) { unserve(obj); }); // auto-unserve
connect(object, &QObject::destroyed, this, [this](QObject *obj) {
unserve(obj);
}); // auto-unserve
const QString dbusPath = path(object).path();
new KDBusPropertiesChangedAdaptor(dbusPath, object);
QDBusConnection connection = QDBusConnection::sessionBus();
return connection.registerObject(dbusPath,
object,
QDBusConnection::ExportAllSlots
| QDBusConnection::ExportAllSignals
| QDBusConnection::ExportAllProperties
| QDBusConnection::ExportAllInvokables
| QDBusConnection::ExportAllContents
| QDBusConnection::ExportAdaptors);
QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals | QDBusConnection::ExportAllProperties
| QDBusConnection::ExportAllInvokables | QDBusConnection::ExportAllContents | QDBusConnection::ExportAdaptors);
}
void KDBusObjectManagerServer::unserve(QObject *object)
{
const QStringList interfaces = metaObjectsFor(object).keys();
emit InterfacesRemoved(path(object), { interfaces });
emit InterfacesRemoved(path(object), {interfaces});
QDBusConnection::sessionBus().unregisterObject(path(object).path());
m_managedObjects.removeAll(object);
}
......@@ -137,7 +127,7 @@ KDBusObjectManagerObjectPathInterfacePropertiesMap KDBusObjectManagerServer::Get
for (const auto *object : m_managedObjects) {
const QDBusObjectPath dbusPath = path(object);
if (dbusPath.path().isEmpty()) {
qCDebug(KDED) << "Invalid dbus path for" << object->objectName();
qCDebug(KDED) << "Invalid dbus path for" << object->objectName();
continue;
}
map[dbusPath] = interfacePropertiesMap(object);
......@@ -149,7 +139,7 @@ QDBusObjectPath KDBusObjectManagerServer::path(const QObject *object)
{
const QString path = m_path + "/" + object->objectName();
qCDebug(KDED) << "path for " << object ->objectName() << object->metaObject()->className() << ":" << path;
qCDebug(KDED) << "path for " << object->objectName() << object->metaObject()->className() << ":" << path;
return QDBusObjectPath(path);
}
......
......@@ -3,9 +3,9 @@
#pragma once
#include <QDebug>
#include <QDBusObjectPath>
#include <QChildEvent>
#include <QDBusObjectPath>
#include <QDebug>
#include <QMetaObject>
#include <QMetaProperty>
......@@ -25,6 +25,7 @@ class KDBusObjectManagerServer : public QObject
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.freedesktop.DBus.ObjectManager")
typedef QHash<QString, const QMetaObject *> InterfaceMetaObjectHash;
public:
KDBusObjectManagerServer(QObject *parent = nullptr);
bool serve(QObject *object);
......
......@@ -6,9 +6,9 @@
#include <KConfigGroup>
#include <KSharedConfig>
#include <Solid/Block>
#include <Solid/Device>
#include <Solid/DeviceInterface>
#include <Solid/Block>
#include <QRegularExpression>
......@@ -17,9 +17,7 @@ Device::Device(const QString &udi_, const QString &product_, const QString &path
, m_udi(udi_)
, m_product(product_)
, m_path(path_)
, m_ignored(KSharedConfig::openConfig("org.kde.kded.smart")
->group("Ignores")
.readEntry(m_udi, false))
, m_ignored(KSharedConfig::openConfig("org.kde.kded.smart")->group("Ignores").readEntry(m_udi, false))
{
// A simple replace actually makes any UDI safe to use for dbus.
// https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-marshaling-object-path
......@@ -38,9 +36,7 @@ Device::Device(const QString &udi_, const QString &product_, const QString &path
Device::Device(const Solid::Device &solidDevice, QObject *parent)
: Device(solidDevice.udi(),
solidDevice.vendor().isEmpty() ? solidDevice.product()
: QStringLiteral("%1 %2").arg(solidDevice.vendor(),
solidDevice.product()),
solidDevice.vendor().isEmpty() ? solidDevice.product() : QStringLiteral("%1 %2").arg(solidDevice.vendor(), solidDevice.product()),
solidDevice.as<Solid::Block>()->device(),
parent)
{
......@@ -48,7 +44,7 @@ Device::Device(const Solid::Device &solidDevice, QObject *parent)
bool Device::operator==(const Device &other) const
{
return m_udi == other.m_udi;
return m_udi == other.m_udi;
}
bool Device::failed() const
......@@ -75,9 +71,7 @@ void Device::setIgnore(bool ignored)
if (m_ignored == ignored) {
return;
}
KSharedConfig::openConfig("org.kde.kded.smart")
->group("Ignores")
.writeEntry(m_udi, ignored);
KSharedConfig::openConfig("org.kde.kded.smart")->group("Ignores").writeEntry(m_udi, ignored);
m_ignored = ignored;
emit ignoreChanged();
}
......@@ -5,7 +5,8 @@
#include <QObject>
namespace Solid {
namespace Solid
{
class Device;
}
......@@ -32,9 +33,20 @@ public:
bool ignore() const;
void setIgnore(bool ignore);
QString udi() const { return m_udi; }
QString product() const { return m_product; }
QString path() const { return m_path; }
QString udi() const
{
return m_udi;
}
QString product() const
{
return m_product;
}
QString path() const
{
return m_path;
}
signals:
void failedChanged();
......
......@@ -4,17 +4,17 @@
#include "helper.h"
#include <QDebug>
#include <QProcess>
#include <QFileInfo>
#include <QProcess>
#include <chrono>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
// Append name to /dev/ and ensure it is a trustable block device.
static QString nameToPath(const QString &name)
......@@ -69,9 +69,7 @@ ActionReply SMARTHelper::smartctl(const QVariantMap &args)
setenv("PATH", "/usr/sbin:/sbin", 1);
QProcess p;
// json=c is badly documented and means "gimme json but don't pretty print"
p.start(QStringLiteral("smartctl"),
{ QStringLiteral("--all"), QStringLiteral("--json=c"), devicePath },
QProcess::ReadOnly);
p.start(QStringLiteral("smartctl"), {QStringLiteral("--all"), QStringLiteral("--json=c"), devicePath}, QProcess::ReadOnly);
// Wait for 120 seconds + 5 seconds leeway.
// This allows us to ideally let smartctl time out internally and still
// construct a json blob if possible. The kernel ioctl timeout for nvme
......
......@@ -14,17 +14,17 @@ DeviceModel::DeviceModel(QObject *parent)
{
KDBusObjectManagerServer::registerTypes();
auto watcher = new QDBusServiceWatcher("org.kde.kded5", QDBusConnection::sessionBus(),
QDBusServiceWatcher::WatchForOwnerChange,
this);
connect(watcher, &QDBusServiceWatcher::serviceOwnerChanged,
this, [this](const QString &/*service*/, const QString &/*oldOwner*/, const QString &newOwner){
if (!newOwner.isEmpty()) { // this is a registration even not a loss event
reload();
} else {
reset();
}
});
auto watcher = new QDBusServiceWatcher("org.kde.kded5", QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this);
connect(watcher,
&QDBusServiceWatcher::serviceOwnerChanged,
this,
[this](const QString & /*service*/, const QString & /*oldOwner*/, const QString &newOwner) {
if (!newOwner.isEmpty()) { // this is a registration even not a loss event
reload();
} else {
reset();
}
});
reload();
}
......@@ -135,11 +135,7 @@ void DeviceModel::addObject(const QDBusObjectPath &dbusPath, const KDBusObjectMa
// so it brings literally nothing to the table for our Device class.
// Use QObjects with dynamic properties instead to model the remote objects.
// Property changes are abstracted via the ListModel anyway.
auto obj = new OrgFreedesktopDBusPropertiesInterface(
"org.kde.kded5",
path,
QDBusConnection::sessionBus(),
this);
auto obj = new OrgFreedesktopDBusPropertiesInterface("org.kde.kded5", path, QDBusConnection::sessionBus(), this);
m_objects << obj;
obj->setObjectName(path);
// Don't care about interfaces, iterate the values i.e. propertymap
......@@ -150,23 +146,23 @@ void DeviceModel::addObject(const QDBusObjectPath &dbusPath, const KDBusObjectMa
}
obj->installEventFilter(new RuntimePropertyChangeFilter(obj));
connect(obj, &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged,
this, [this, obj](const QString &/*interface*/,
const QVariantMap &properties,
const QStringList &/*invalidated*/) {
for (auto it = properties.cbegin(); it != properties.cend(); ++it) {
obj->setProperty(qPrintable(it.key()), it.value());
// Technically we need an event filter to monitor dynamic prop changes,
// but since this is the only place they can change we'll take a shortcut
// and notify the views immediately.
const int role = m_objectPoperties.key(it.key().toLatin1(), -1);
Q_ASSERT(role != -1);
const int index = m_objects.indexOf(obj);
Q_ASSERT(index != -1);
emit dataChanged(createIndex(index, 0), createIndex(index, 0), {role});
}
});
connect(obj,
&OrgFreedesktopDBusPropertiesInterface::PropertiesChanged,
this,
[this, obj](const QString & /*interface*/, const QVariantMap &properties, const QStringList & /*invalidated*/) {
for (auto it = properties.cbegin(); it != properties.cend(); ++it) {
obj->setProperty(qPrintable(it.key()), it.value());
// Technically we need an event filter to monitor dynamic prop changes,
// but since this is the only place they can change we'll take a shortcut
// and notify the views immediately.
const int role = m_objectPoperties.key(it.key().toLatin1(), -1);
Q_ASSERT(role != -1);
const int index = m_objects.indexOf(obj);
Q_ASSERT(index != -1);
emit dataChanged(createIndex(index, 0), createIndex(index, 0), {role});
}
});
if (m_roles.isEmpty()) {
initRoleNames(obj);
......@@ -241,15 +237,9 @@ void DeviceModel::reload()
{
reset();
m_iface = new OrgFreedesktopDBusObjectManagerInterface(
"org.kde.kded5",
"/modules/smart/devices",
QDBusConnection::sessionBus(),
this);
connect(m_iface, &OrgFreedesktopDBusObjectManagerInterface::InterfacesAdded,
this, &DeviceModel::addObject);
connect(m_iface, &OrgFreedesktopDBusObjectManagerInterface::InterfacesRemoved,
this, &DeviceModel::removeObject);
m_iface = new OrgFreedesktopDBusObjectManagerInterface("org.kde.kded5", "/modules/smart/devices", QDBusConnection::sessionBus(), this);
connect(m_iface, &OrgFreedesktopDBusObjectManagerInterface::InterfacesAdded, this, &DeviceModel::addObject);
connect(m_iface, &OrgFreedesktopDBusObjectManagerInterface::InterfacesRemoved, this, &DeviceModel::removeObject);
emit validChanged();
......@@ -260,8 +250,7 @@ void DeviceModel::reload()
}
m_getManagedObjectsWatcher = new QDBusPendingCallWatcher(m_iface->GetManagedObjects(), this);
emit waitingChanged();
connect(m_getManagedObjectsWatcher, &QDBusPendingCallWatcher::finished,
this, [this] {
connect(m_getManagedObjectsWatcher, &QDBusPendingCallWatcher::finished, this, [this] {
QDBusPendingReply<KDBusObjectManagerObjectPathInterfacePropertiesMap> call = *m_getManagedObjectsWatcher;
auto map = call.value();
for (auto it = map.cbegin(); it != map.cend(); ++it) {
......
......@@ -3,10 +3,10 @@
#pragma once
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
......@@ -23,10 +23,10 @@ class DeviceModel : public QAbstractListModel
Q_PROPERTY(bool waiting READ waiting NOTIFY waitingChanged)
public:
enum ItemRole {
ObjectRole = Qt::UserRole + 1
ObjectRole = Qt::UserRole + 1,
};
QVector<QObject*> m_objects;
QVector<QObject *> m_objects;
DeviceModel(QObject *parent = nullptr);
......@@ -63,4 +63,4 @@ private:
QDBusPendingCallWatcher *m_getManagedObjectsWatcher = nullptr;
};
Q_DECLARE_METATYPE(DeviceModel*)
Q_DECLARE_METATYPE(DeviceModel *)
......@@ -13,7 +13,6 @@
Module::Module(QObject *parent, const QVariantList &args)
: KQuickAddons::ConfigModule(parent, args)
{
auto aboutData = new KAboutData(QStringLiteral("plasma_disks"),
i18nc("@title", "Storage Device Health Monitoring"),
QString::fromLatin1(global_s_versionStringFull),
......
......@@ -3,8 +3,8 @@
#pragma once
#include <QObject>
#include <KService>
#include <QObject>
class ServiceRunner : public QObject
{
......@@ -27,5 +27,5 @@ signals:
private:
QString m_name;
KService::Ptr m_service { nullptr };
KService::Ptr m_service{nullptr};
};
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
// SPDX-FileCopyrightText: 2020 Harald Sitter <sitter@kde.org>
#include <QCoreApplication>
#include <KPluginFactory>
#include <KDEDModule>
#include <KPluginFactory>
#include <QCoreApplication>
#include "dbusobjectmanagerserver.h"
#include "device.h"
......@@ -18,25 +18,21 @@ public:
: KDEDModule(parent)
{
Q_UNUSED(args);
connect(&m_monitor, &SMARTMonitor::deviceAdded,
this, [this](Device *device) {
connect(&m_monitor, &SMARTMonitor::deviceAdded, this, [this](Device *device) {
dbusDeviceServer.serve(device);
});
connect(&m_monitor, &SMARTMonitor::deviceRemoved,
&dbusDeviceServer, [this](Device *device) {
connect(&m_monitor, &SMARTMonitor::deviceRemoved, &dbusDeviceServer, [this](Device *device) {
dbusDeviceServer.unserve(device);
});
m_monitor.start();
}
private:
SMARTMonitor m_monitor { new SMARTCtl };
SMARTNotifier m_notifier { &m_monitor };
SMARTMonitor m_monitor{new SMARTCtl};
SMARTNotifier m_notifier{&m_monitor};
KDBusObjectManagerServer dbusDeviceServer;
};
K_PLUGIN_FACTORY_WITH_JSON(SMARTModuleFactory,
"smart.json",
registerPlugin<SMARTModule>();)
K_PLUGIN_FACTORY_WITH_JSON(SMARTModuleFactory, "smart.json", registerPlugin<SMARTModule>();)
#include "main.moc"
......@@ -3,11 +3,11 @@
#include "smartctl.h"
#include <QDebug>
#include <QFileInfo>
#include <KAuthAction>
#include <KAuthExecuteJob>
#include <KLocalizedString>
#include <QDebug>
#include <QFileInfo>
#include "kded_debug.h"
......@@ -26,12 +26,10 @@ void SMARTCtl::run(const QString &devicePath)
// This is technically never used unless the sysadmin forces our action
// to require authentication. In that case we'll want to give request context
// as we do requests per-device though.
action.setDetailsV2({
{ KAuth::Action::AuthDetail::DetailMessage,
i18nc("@label description of authentication request to read SMART data. %1 is a device path e.g. /dev/sda",
"Read SMART report for storage device %1",
devicePath) }
});
action.setDetailsV2({{KAuth::Action::AuthDetail::DetailMessage,
i18nc("@label description of authentication request to read SMART data. %1 is a device path e.g. /dev/sda",
"Read SMART report for storage device %1",
devicePath)}});
action.setHelperId(QStringLiteral("org.kde.kded.smart"));
// The helper only consumes names, ensure we fully resolve the name of the
......@@ -42,13 +40,9 @@ void SMARTCtl::run(const QString &devicePath)
Q_ASSERT(canonicalDeviceInfo.absolutePath() == QLatin1String("/dev"));
action.addArgument(QStringLiteral("deviceName"), canonicalDeviceInfo.fileName());
qCDebug(KDED) << action.isValid()
<< action.hasHelper()
<< action.helperId()
<< action.status();
qCDebug(KDED) << action.isValid() << action.hasHelper() << action.helperId() << action.status();
KAuth::ExecuteJob *job = action.execute();
connect(job, &KJob::result,
this, [this, job, devicePath] {
connect(job, &KJob::result, this, [this, job, devicePath] {
const auto data = job->data();
const auto code = data.value(QStringLiteral("exitCode"), QByteArray()).toInt();
const auto json = data.value(QStringLiteral("data"), QByteArray()).toByteArray();
......
......@@ -53,7 +53,7 @@ public:
Prefail = 0x10,
PastPrefail = 0x20,
ErrorsRecorded = 0x40,
SelfTestErrors = 0x80
SelfTestErrors = 0x80,
// The entire thing doesn't exceed 8 bits because it's a posix exit code.
};
......
......@@ -3,10 +3,10 @@
#include "smartmonitor.h"
#include <Solid/Block>
#include <Solid/Device>
#include <Solid/DeviceInterface>
#include <Solid/DeviceNotifier>
#include <Solid/Block>
#include <Solid/StorageDrive>
#include <Solid/StorageVolume>
......@@ -21,20 +21,16 @@ SMARTMonitor::SMARTMonitor(AbstractSMARTCtl *ctl, QObject *parent)
: QObject(parent)
, m_ctl(ctl)
{
connect(&m_reloadTimer, &QTimer::timeout,
this, &SMARTMonitor::reloadData);
connect(ctl, &AbstractSMARTCtl::finished,
this, &SMARTMonitor::onSMARTCtlFinished);
connect(&m_reloadTimer, &QTimer::timeout, this, &SMARTMonitor::reloadData);
connect(ctl, &AbstractSMARTCtl::finished, this, &SMARTMonitor::onSMARTCtlFinished);
m_reloadTimer.setInterval(1000 * 60 /*minute*/ * 60 /*hour*/ * 24 /*day*/);
}
void SMARTMonitor::start()
{
qCDebug(KDED) << "starting";
connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceAdded,
this, &SMARTMonitor::checkUDI);
connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceRemoved,
this, &SMARTMonitor::removeUDI);
connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceAdded, this, &SMARTMonitor::checkUDI);
connect(Solid::DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceRemoved, this, &SMARTMonitor::removeUDI);
QMetaObject::invokeMethod(this, &SMARTMonitor::reloadData);
}
......@@ -91,7 +87,7 @@ void SMARTMonitor::onSMARTCtlFinished(const QString &devicePath, const QJsonDocu
Q_ASSERT(devicePath == data.m_device);
auto existingIt = std::find_if(m_devices.begin(), m_devices.end(), [&device](Device *existing) {
return *existing == *device;
return *existing == *device;
});
if (existingIt != m_devices.cend()) {
device->deleteLater(); // won't be needing this
......@@ -125,10 +121,14 @@ void SMARTMonitor::checkDevice(const Solid::Device &device)
return; // certainly not an interesting device
}
switch (device.as<Solid::StorageVolume>()->usage()) {
case Solid::StorageVolume::Unused: Q_FALLTHROUGH();
case Solid::StorageVolume::FileSystem: Q_FALLTHROUGH();
case Solid::StorageVolume::Encrypted: Q_FALLTHROUGH();
case Solid::StorageVolume::Other: Q_FALLTHROUGH();
case Solid::StorageVolume::Unused:
Q_FALLTHROUGH();