| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2006-2007 Kevin Ottens <ervin@kde.org> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 5 | */ |
| 6 | |
| 7 | #include "storagevolume.h" |
| 8 | #include "storagevolume_p.h" |
| 9 | |
| 10 | #include "soliddefs_p.h" |
| 11 | #include <solid/device.h> |
| 12 | #include <solid/devices/ifaces/storagevolume.h> |
| 13 | |
| 14 | Solid::StorageVolume::StorageVolume(QObject *backendObject) |
| 15 | : DeviceInterface(*new StorageVolumePrivate(), backendObject) |
| 16 | { |
| 17 | } |
| 18 | |
| 19 | Solid::StorageVolume::StorageVolume(StorageVolumePrivate &dd, QObject *backendObject) |
| 20 | : DeviceInterface(dd, backendObject) |
| 21 | { |
| 22 | } |
| 23 | |
| 24 | Solid::StorageVolume::~StorageVolume() |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | bool Solid::StorageVolume::isIgnored() const |
| 29 | { |
| 30 | Q_D(const StorageVolume); |
| 31 | return_SOLID_CALL(Ifaces::StorageVolume *, d->backendObject(), true, isIgnored()); |
| 32 | } |
| 33 | |
| 34 | Solid::StorageVolume::UsageType Solid::StorageVolume::usage() const |
| 35 | { |
| 36 | Q_D(const StorageVolume); |
| 37 | return_SOLID_CALL(Ifaces::StorageVolume *, d->backendObject(), Unused, usage()); |
| 38 | } |
| 39 | |
| 40 | QString Solid::StorageVolume::fsType() const |
| 41 | { |
| 42 | Q_D(const StorageVolume); |
| 43 | return_SOLID_CALL(Ifaces::StorageVolume *, d->backendObject(), QString(), fsType()); |
| 44 | } |
| 45 | |
| 46 | QString Solid::StorageVolume::label() const |
| 47 | { |
| 48 | Q_D(const StorageVolume); |
| 49 | return_SOLID_CALL(Ifaces::StorageVolume *, d->backendObject(), QString(), label()); |
| 50 | } |
| 51 | |
| 52 | QString Solid::StorageVolume::uuid() const |
| 53 | { |
| 54 | Q_D(const StorageVolume); |
| 55 | return_SOLID_CALL(Ifaces::StorageVolume *, d->backendObject(), QString(), uuid().toLower()); |
| 56 | } |
| 57 | |
| 58 | qulonglong Solid::StorageVolume::size() const |
| 59 | { |
| 60 | Q_D(const StorageVolume); |
| 61 | return_SOLID_CALL(Ifaces::StorageVolume *, d->backendObject(), 0, size()); |
| 62 | } |
| 63 | |
| 64 | Solid::Device Solid::StorageVolume::encryptedContainer() const |
| 65 | { |
| 66 | Q_D(const StorageVolume); |
| 67 | |
| 68 | Ifaces::StorageVolume *iface = qobject_cast<Ifaces::StorageVolume *>(object: d->backendObject()); |
| 69 | |
| 70 | if (iface != nullptr) { |
| 71 | return Device(iface->encryptedContainerUdi()); |
| 72 | } else { |
| 73 | return Device(); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | #include "moc_storagevolume.cpp" |
| 78 | |