7#include "fakeopticaldisc.h"
12using namespace Solid::Backends::Fake;
14FakeOpticalDisc::FakeOpticalDisc(FakeDevice *device)
19FakeOpticalDisc::~FakeOpticalDisc()
27 const QMap<QString, Solid::OpticalDisc::ContentType>
map = {
28 {QStringLiteral(
"audio"), Solid::OpticalDisc::Audio},
29 {QStringLiteral(
"data"), Solid::OpticalDisc::Data},
30 {QStringLiteral(
"vcd"), Solid::OpticalDisc::VideoCd},
31 {QStringLiteral(
"svcd"), Solid::OpticalDisc::SuperVideoCd},
32 {QStringLiteral(
"videodvd"), Solid::OpticalDisc::VideoDvd},
35 const QStringList content_typelist = fakeDevice()->property(QStringLiteral(
"availableContent")).toString().split(QLatin1Char(
','));
37 for (
const QString &type : content_typelist) {
38 content |=
map.value(type, Solid::OpticalDisc::NoContent);
46 QString
type = fakeDevice()->property(QStringLiteral(
"discType")).toString();
48 if (type == QLatin1String(
"cd_rom")) {
49 return Solid::OpticalDisc::CdRom;
50 }
else if (type == QLatin1String(
"cd_r")) {
51 return Solid::OpticalDisc::CdRecordable;
52 }
else if (type == QLatin1String(
"cd_rw")) {
53 return Solid::OpticalDisc::CdRewritable;
54 }
else if (type == QLatin1String(
"dvd_rom")) {
55 return Solid::OpticalDisc::DvdRom;
56 }
else if (type == QLatin1String(
"dvd_ram")) {
57 return Solid::OpticalDisc::DvdRam;
58 }
else if (type == QLatin1String(
"dvd_r")) {
59 return Solid::OpticalDisc::DvdRecordable;
60 }
else if (type == QLatin1String(
"dvd_rw")) {
61 return Solid::OpticalDisc::DvdRewritable;
62 }
else if (type == QLatin1String(
"dvd_plus_r")) {
63 return Solid::OpticalDisc::DvdPlusRecordable;
64 }
else if (type == QLatin1String(
"dvd_plus_rw")) {
65 return Solid::OpticalDisc::DvdPlusRewritable;
66 }
else if (type == QLatin1String(
"dvd_plus_r_dl")) {
67 return Solid::OpticalDisc::DvdPlusRecordableDuallayer;
68 }
else if (type == QLatin1String(
"dvd_plus_rw_dl")) {
69 return Solid::OpticalDisc::DvdPlusRewritableDuallayer;
70 }
else if (type == QLatin1String(
"bd_rom")) {
71 return Solid::OpticalDisc::BluRayRom;
72 }
else if (type == QLatin1String(
"bd_r")) {
73 return Solid::OpticalDisc::BluRayRecordable;
74 }
else if (type == QLatin1String(
"bd_re")) {
75 return Solid::OpticalDisc::BluRayRewritable;
76 }
else if (type == QLatin1String(
"hddvd_rom")) {
77 return Solid::OpticalDisc::HdDvdRom;
78 }
else if (type == QLatin1String(
"hddvd_r")) {
79 return Solid::OpticalDisc::HdDvdRecordable;
80 }
else if (type == QLatin1String(
"hddvd_rw")) {
81 return Solid::OpticalDisc::HdDvdRewritable;
83 return Solid::OpticalDisc::UnknownDiscType;
87bool FakeOpticalDisc::isAppendable()
const
89 return fakeDevice()->property(QStringLiteral(
"isAppendable")).toBool();
92bool FakeOpticalDisc::isBlank()
const
94 return fakeDevice()->property(QStringLiteral(
"isBlank")).toBool();
97bool FakeOpticalDisc::isRewritable()
const
99 return fakeDevice()->property(QStringLiteral(
"isRewritable")).toBool();
102qulonglong FakeOpticalDisc::capacity()
const
104 return fakeDevice()->property(QStringLiteral(
"capacity")).toULongLong();
107#include "moc_fakeopticaldisc.cpp"
QFlags< ContentType > ContentTypes
Stores a combination of ContentType values.
DiscType
This enum type defines the type of optical disc it can be.
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)