7#include "fakestorage.h"
10using namespace Solid::Backends::Fake;
12FakeStorage::FakeStorage(FakeDevice *device)
17FakeStorage::~FakeStorage()
26 return Solid::StorageDrive::Ide;
27 }
else if (bus ==
"usb") {
28 return Solid::StorageDrive::Usb;
29 }
else if (bus ==
"ieee1394") {
30 return Solid::StorageDrive::Ieee1394;
31 }
else if (bus ==
"scsi") {
32 return Solid::StorageDrive::Scsi;
33 }
else if (bus ==
"sata") {
34 return Solid::StorageDrive::Sata;
36 return Solid::StorageDrive::Platform;
45 return Solid::StorageDrive::HardDisk;
46 }
else if (type ==
"cdrom") {
47 return Solid::StorageDrive::CdromDrive;
48 }
else if (type ==
"floppy") {
49 return Solid::StorageDrive::Floppy;
50 }
else if (type ==
"tape") {
51 return Solid::StorageDrive::Tape;
52 }
else if (type ==
"compact_flash") {
53 return Solid::StorageDrive::CompactFlash;
54 }
else if (type ==
"memory_stick") {
55 return Solid::StorageDrive::MemoryStick;
56 }
else if (type ==
"smart_media") {
57 return Solid::StorageDrive::SmartMedia;
58 }
else if (type ==
"sd_mmc") {
59 return Solid::StorageDrive::SdMmc;
61 return Solid::StorageDrive::HardDisk;
65bool FakeStorage::isRemovable()
const
67 return fakeDevice()->property(
"isRemovable").
toBool();
70bool FakeStorage::isHotpluggable()
const
72 return fakeDevice()->property(
"isHotpluggable").
toBool();
75qulonglong FakeStorage::size()
const
77 return fakeDevice()->property(
"size").
toULongLong();
80QDateTime FakeStorage::timeDetected()
const
82 return fakeDevice()->property(
"timeDetected").
toDateTime();
85QDateTime FakeStorage::timeMediaDetected()
const
87 return fakeDevice()->property(
"timeMediaDetected").
toDateTime();
90#include "moc_fakestorage.cpp"
DriveType
This enum type defines the type of drive a storage device can be.
Bus
This enum type defines the type of bus a storage device is attached to.
Type type(const QSqlDatabase &db)
bool toBool() const const
QDateTime toDateTime() const const
QString toString() const const
qulonglong toULongLong(bool *ok) const const