Solid

frontend/storagevolume.cpp
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
14Solid::StorageVolume::StorageVolume(QObject *backendObject)
15 : DeviceInterface(*new StorageVolumePrivate(), backendObject)
16{
17}
18
19Solid::StorageVolume::StorageVolume(StorageVolumePrivate &dd, QObject *backendObject)
20 : DeviceInterface(dd, backendObject)
21{
22}
23
27
29{
30 Q_D(const StorageVolume);
31 return_SOLID_CALL(Ifaces::StorageVolume *, d->backendObject(), true, isIgnored());
32}
33
34Solid::StorageVolume::UsageType Solid::StorageVolume::usage() const
35{
36 Q_D(const StorageVolume);
37 return_SOLID_CALL(Ifaces::StorageVolume *, d->backendObject(), Unused, usage());
38}
39
40QString Solid::StorageVolume::fsType() const
41{
42 Q_D(const StorageVolume);
43 return_SOLID_CALL(Ifaces::StorageVolume *, d->backendObject(), QString(), fsType());
44}
45
46QString Solid::StorageVolume::label() const
47{
48 Q_D(const StorageVolume);
49 return_SOLID_CALL(Ifaces::StorageVolume *, d->backendObject(), QString(), label());
50}
51
52QString Solid::StorageVolume::uuid() const
53{
54 Q_D(const StorageVolume);
55 return_SOLID_CALL(Ifaces::StorageVolume *, d->backendObject(), QString(), uuid().toLower());
56}
57
58qulonglong Solid::StorageVolume::size() const
59{
60 Q_D(const StorageVolume);
61 return_SOLID_CALL(Ifaces::StorageVolume *, d->backendObject(), 0, size());
62}
63
65{
66 Q_D(const StorageVolume);
67
68 Ifaces::StorageVolume *iface = qobject_cast<Ifaces::StorageVolume *>(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"
Base class of all the device interfaces.
This class allows applications to deal with devices available in the underlying system.
This device interface is available on volume devices.
virtual QString encryptedContainerUdi() const =0
Retrieves the crypto container UDI of this volume.
This device interface is available on volume devices.
~StorageVolume() override
Destroys a StorageVolume object.
Device encryptedContainer() const
Retrieves the crypto container of this volume.
bool isIgnored() const
Indicates if this volume should be ignored by applications.
UsageType
This enum type defines the how a volume is used.
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:56:28 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.