Solid::StorageDrive Class

class Solid::StorageDrive
Header: #include <StorageDrive>
CMake: find_package(KF6 REQUIRED COMPONENTS Solid)
target_link_libraries(mytarget PRIVATE KF6::Solid)
Inherits: Solid::DeviceInterface
Inherited By:

Solid::OpticalDrive

Public Types

enum Bus { Ide, Usb, Ieee1394, Scsi, Sata, Platform }
enum DriveType { HardDisk, CdromDrive, Floppy, Tape, CompactFlash, …, Xd }

Public Functions

virtual ~StorageDrive() override
Solid::StorageDrive::Bus bus() const
Solid::StorageDrive::DriveType driveType() const
bool isHotpluggable() const
bool isInUse() const
bool isRemovable() const
qulonglong size() const
QDateTime timeDetected() const
QDateTime timeMediaDetected() const

Static Public Members

Solid::DeviceInterface::Type deviceInterfaceType()

Protected Functions

StorageDrive(Solid::StorageDrivePrivate &dd, QObject *backendObject)

Detailed Description

@class Solid::StorageDrive storagedrive.h <Solid/StorageDrive>

This device interface is available on storage devices.

A storage is anything that can contain a set of volumes (card reader, hard disk, cdrom drive...). It's a particular kind of block device.

Member Type Documentation

enum StorageDrive::Bus

This enum type defines the type of bus a storage device is attached to.

- Ide : An Integrated Drive Electronics (IDE) bus, also known as ATA - Usb : An Universal Serial Bus (USB) - Ieee1394 : An Ieee1394 bus, also known as Firewire - Scsi : A Small Computer System Interface bus - Sata : A Serial Advanced Technology Attachment (SATA) bus - Platform : A legacy bus that is part of the underlying platform

enum StorageDrive::DriveType

This enum type defines the type of drive a storage device can be.

- HardDisk : A hard disk - CdromDrive : An optical drive - Floppy : A floppy disk drive - Tape : A tape drive - CompactFlash : A Compact Flash card reader - MemoryStick : A Memory Stick card reader - SmartMedia : A Smart Media card reader - SdMmc : A SecureDigital/MultiMediaCard card reader - Xd : A xD card reader

Member Function Documentation

[protected] StorageDrive::StorageDrive(Solid::StorageDrivePrivate &dd, QObject *backendObject)

@internal

[override virtual noexcept] StorageDrive::~StorageDrive()

Destroys a StorageDrive object.

Solid::StorageDrive::Bus StorageDrive::bus() const

Retrieves the type of physical interface this storage device is connected to.

@return the bus type @see Solid::StorageDrive::Bus

Note: Getter function for property bus.

[static] Solid::DeviceInterface::Type StorageDrive::deviceInterfaceType()

Get the Solid::DeviceInterface::Type of the StorageDrive device interface.

@return the StorageDrive device interface type @see Solid::DeviceInterface::Type

Solid::StorageDrive::DriveType StorageDrive::driveType() const

Retrieves the type of this storage drive.

@return the drive type @see Solid::StorageDrive::DriveType

Note: Getter function for property driveType.

bool StorageDrive::isHotpluggable() const

Indicates if this storage device can be plugged or unplugged while the computer is running.

@return true if this storage supports hotplug, false otherwise

Note: Getter function for property hotpluggable.

bool StorageDrive::isInUse() const

Indicates if the storage device is currently in use i.e. if at least one child storage access is mounted

@return true if at least one child storage access is mounted

Note: Getter function for property inUse.

bool StorageDrive::isRemovable() const

Indicates if the media contained by this drive can be removed.

For example memory card can be removed from the drive by the user, while partitions can't be removed from hard disks.

@return true if media can be removed, false otherwise.

Note: Getter function for property removable.

qulonglong StorageDrive::size() const

Retrieves this drives size in bytes.

@return the size of this drive

Note: Getter function for property size.

QDateTime StorageDrive::timeDetected() const

Returns the time the drive was deteced. Typically this means the time a drive was plugged in, or the computer rebooted

An invalid datetime may be returned if the underlying information is not available @since 6.0

Note: Getter function for property timeDetected. Getter function for property timeMediaDetected.

QDateTime StorageDrive::timeMediaDetected() const

Returns the time media in the drive was deteced. Typically this means the time a card was inserted into a reader, or the computer rebooted

An invalid datetime may be returned if the underlying information is not available @since 6.0