mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
solid: implement all Solid::StorageDrive::DriveType for udev backend
Xd is not a thing Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e52ca10b25
commit
d269abe7a0
3 changed files with 11 additions and 19 deletions
|
@ -239,8 +239,6 @@ QString UDevDevice::icon() const
|
|||
return QLatin1String("media-flash-smart-media");
|
||||
} else if (drivetype == Solid::StorageDrive::SdMmc) {
|
||||
return QLatin1String("media-flash-sd-mmc");
|
||||
} else if (drivetype == Solid::StorageDrive::Xd) {
|
||||
return QLatin1String("drive-removable-media");
|
||||
}
|
||||
} else if (queryDeviceInterface(Solid::DeviceInterface::StorageVolume)) {
|
||||
return QLatin1String("drive-harddisk");
|
||||
|
@ -423,8 +421,6 @@ QString UDevDevice::description() const
|
|||
return QObject::tr("%1 Smart Media Drive").arg(storagesize);
|
||||
} else if (drivetype == Solid::StorageDrive::SdMmc) {
|
||||
return QObject::tr("%1 SD/MMC Drive").arg(storagesize);
|
||||
} else if (drivetype == Solid::StorageDrive::Xd) {
|
||||
return QObject::tr("%1 Xd Drive").arg(storagesize);
|
||||
}
|
||||
} else if (queryDeviceInterface(Solid::DeviceInterface::StorageVolume)) {
|
||||
const StorageVolume storageIface(const_cast<UDevDevice *>(this));
|
||||
|
|
|
@ -60,28 +60,25 @@ Solid::StorageDrive::DriveType StorageDrive::driveType() const
|
|||
const QString idbus(m_device->deviceProperty("ID_BUS"));
|
||||
const int idcdrom = m_device->deviceProperty("ID_CDROM").toInt();
|
||||
const int iddrivefloppy = m_device->deviceProperty("ID_DRIVE_FLOPPY").toInt();
|
||||
|
||||
const int iddriveflashcf = m_device->deviceProperty("ID_DRIVE_FLASH_CF").toInt();
|
||||
const int iddriveflashms = m_device->deviceProperty("ID_DRIVE_FLASH_MS").toInt();
|
||||
const int iddriveflashsm = m_device->deviceProperty("ID_DRIVE_FLASH_SM").toInt();
|
||||
const int iddriveflashsd = m_device->deviceProperty("ID_DRIVE_FLASH_SD").toInt();
|
||||
const int iddriveflashmmc = m_device->deviceProperty("ID_DRIVE_FLASH_MMC").toInt();
|
||||
if (idtype == QLatin1String("cd") || idcdrom == 1) {
|
||||
return Solid::StorageDrive::CdromDrive;
|
||||
} else if (iddrivefloppy == 1) {
|
||||
return Solid::StorageDrive::Floppy;
|
||||
} else if (idtype == QLatin1String("tape")) {
|
||||
return Solid::StorageDrive::Tape;
|
||||
// TODO: other types and remove this generic check
|
||||
} else if (idbus == QLatin1String("usb")) {
|
||||
return Solid::StorageDrive::CompactFlash;
|
||||
#if 0
|
||||
} else if (idtype == "flash_cf") {
|
||||
return Solid::StorageDrive::CompactFlash;
|
||||
} else if (idtype == "flash_ms") {
|
||||
} else if (iddriveflashms == 1) {
|
||||
return Solid::StorageDrive::MemoryStick;
|
||||
} else if (idtype == "flash_sm") {
|
||||
} else if (iddriveflashsm == 1) {
|
||||
return Solid::StorageDrive::SmartMedia;
|
||||
} else if (idtype == "flash_sd" || idtype == "flash_mmc") {
|
||||
} else if (iddriveflashsd == 1 || iddriveflashmmc == 1) {
|
||||
return Solid::StorageDrive::SdMmc;
|
||||
} else if (idtype == "flash_xd") {
|
||||
return Solid::StorageDrive::Xd;
|
||||
#endif
|
||||
} else if (iddriveflashcf == 1 || idbus == QLatin1String("usb")) {
|
||||
return Solid::StorageDrive::CompactFlash;
|
||||
} else {
|
||||
return Solid::StorageDrive::HardDisk;
|
||||
}
|
||||
|
|
|
@ -73,9 +73,8 @@ namespace Solid
|
|||
* - MemoryStick : A Memory Stick card reader
|
||||
* - SmartMedia : A Smart Media card reader
|
||||
* - SdMmc : A SecureDigital/MultiMediaCard card reader
|
||||
* - Xd : A xD card reader
|
||||
*/
|
||||
enum DriveType { HardDisk, CdromDrive, Floppy, Tape, CompactFlash, MemoryStick, SmartMedia, SdMmc, Xd };
|
||||
enum DriveType { HardDisk, CdromDrive, Floppy, Tape, CompactFlash, MemoryStick, SmartMedia, SdMmc };
|
||||
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Reference in a new issue