7#include "iokitvolume.h"
8#include "iokitgenericinterface.h"
10#include <CoreFoundation/CoreFoundation.h>
12using namespace Solid::Backends::IOKit;
14IOKitVolume::IOKitVolume(IOKitDevice *device)
16 , daDict(new DADictionary(device))
20IOKitVolume::IOKitVolume(
const IOKitDevice *device)
22 , daDict(new DADictionary(device))
26IOKitVolume::~IOKitVolume()
31bool IOKitVolume::isIgnored()
const
34 bool isIgnored = m_device->property(QStringLiteral(
"Open")).
toBool() ==
false;
42 const QString content = m_device->property(QStringLiteral(
"Content")).
toString();
43 if (content == QStringLiteral(
"CD_DA")) {
45 return Solid::StorageVolume::Other;
47 if (content.
contains(QStringLiteral(
"partition_scheme"))) {
48 return Solid::StorageVolume::PartitionTable;
50 return Solid::StorageVolume::FileSystem;
53QString IOKitVolume::fsType()
const
55 return daDict->stringForKey(kDADiskDescriptionVolumeKindKey);
58QString IOKitVolume::label()
const
60 return daDict->stringForKey(kDADiskDescriptionVolumeNameKey);
63QString IOKitVolume::uuid()
const
65 return m_device->property(QStringLiteral(
"UUID")).
toString();
68qulonglong IOKitVolume::size()
const
70 return m_device->property(QStringLiteral(
"Size")).
toULongLong();
73QString IOKitVolume::encryptedContainerUdi()
const
78QString IOKitVolume::vendor()
const
80 return daDict->stringForKey(kDADiskDescriptionDeviceVendorKey);
83QString IOKitVolume::product()
const
85 return daDict->stringForKey(kDADiskDescriptionDeviceModelKey);
88QString IOKitVolume::description()
const
90 return daDict->stringForKey(kDADiskDescriptionMediaNameKey);
93DADiskRef IOKitVolume::daRef()
const
98#include "moc_iokitvolume.cpp"
UsageType
This enum type defines the how a volume is used.
bool setProperty(const char *name, QVariant &&value)
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
bool toBool() const const
QString toString() const const
qulonglong toULongLong(bool *ok) const const