Solid

fakevolume.cpp
1/*
2 SPDX-FileCopyrightText: 2006 Davide Bettio <davide.bettio@kdemail.net>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "fakevolume.h"
8#include <QVariant>
9
10using namespace Solid::Backends::Fake;
11
12FakeVolume::FakeVolume(FakeDevice *device)
13 : FakeBlock(device)
14{
15}
16
17FakeVolume::~FakeVolume()
18{
19}
20
21bool FakeVolume::isIgnored() const
22{
23 return fakeDevice()->property(QStringLiteral("isIgnored")).toBool();
24}
25
26Solid::StorageVolume::UsageType FakeVolume::usage() const
27{
28 QString usage = fakeDevice()->property(QStringLiteral("usage")).toString();
29
30 if (usage == QLatin1String("filesystem")) {
31 return Solid::StorageVolume::FileSystem;
32 } else if (usage == QLatin1String("partitiontable")) {
33 return Solid::StorageVolume::PartitionTable;
34 } else if (usage == QLatin1String("raid")) {
35 return Solid::StorageVolume::Raid;
36 } else if (usage == QLatin1String("unused")) {
37 return Solid::StorageVolume::Unused;
38 } else if (usage == QLatin1String("encrypted")) {
39 return Solid::StorageVolume::Encrypted;
40 } else {
41 return Solid::StorageVolume::Other;
42 }
43}
44
45QString FakeVolume::fsType() const
46{
47 return fakeDevice()->property(QStringLiteral("fsType")).toString();
48}
49
50QString FakeVolume::label() const
51{
52 return fakeDevice()->property(QStringLiteral("label")).toString();
53}
54
55QString FakeVolume::uuid() const
56{
57 return fakeDevice()->property(QStringLiteral("uuid")).toString();
58}
59
60qulonglong FakeVolume::size() const
61{
62 return fakeDevice()->property(QStringLiteral("size")).toULongLong();
63}
64
65QString Solid::Backends::Fake::FakeVolume::encryptedContainerUdi() const
66{
67 return QString();
68}
69
70#include "moc_fakevolume.cpp"
UsageType
This enum type defines the how a volume is used.
bool toBool() const const
QString toString() const const
qulonglong toULongLong(bool *ok) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:23 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.