Solid::Ifaces::StorageAccess Class

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

Public Functions

virtual ~StorageAccess() override
virtual bool canCheck() const
virtual bool canRepair() const
virtual bool check()
virtual QString filePath() const = 0
virtual bool isAccessible() const = 0
virtual bool isEncrypted() const = 0
virtual bool isIgnored() const = 0
virtual bool repair()
virtual bool setup() = 0
virtual bool teardown() = 0

Protected Functions

virtual void accessibilityChanged(bool accessible, const QString &udi) = 0
virtual void repairDone(Solid::ErrorType error, QVariant resultData, const QString &udi)
virtual void repairRequested(const QString &udi)
virtual void setupDone(Solid::ErrorType error, QVariant resultData, const QString &udi) = 0
virtual void setupRequested(const QString &udi) = 0
virtual void teardownDone(Solid::ErrorType error, QVariant resultData, const QString &udi) = 0
virtual void teardownRequested(const QString &udi) = 0

Detailed Description

This device interface is available on volume devices.

A volume is anything that can contain data (partition, optical disc, memory card). It's a particular kind of block device.

Member Function Documentation

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

Destroys a StorageVolume object.

[pure virtual protected] void StorageAccess::accessibilityChanged(bool accessible, const QString &udi)

This signal is emitted when the mount state of this device has changed.

@param newState true if the volume is mounted, false otherwise @param udi the UDI of the volume

[virtual] bool StorageAccess::canCheck() const

Indicates if this volume can check for filesystem errors.

@return true if the volume is can be checked

[virtual] bool StorageAccess::canRepair() const

Indicates if this volume can repair filesystem errors.

@return true if the volume is can be repaired

[virtual] bool StorageAccess::check()

Checks the filesystem for consistency avoiding any modifications or repairs.

Mounted or unsupported filesystems will result in an error.

@return Whether the filesystem is undamaged.

[pure virtual] QString StorageAccess::filePath() const

Retrieves the absolute path of this volume mountpoint.

@return the absolute path to the mount point if the volume is mounted, QString() otherwise

[pure virtual] bool StorageAccess::isAccessible() const

Indicates if this volume is mounted.

@return true if the volume is mounted

[pure virtual] bool StorageAccess::isEncrypted() const

Checks if source of the storage is encrypted.

@return true if storage is encrypted one

[pure virtual] bool StorageAccess::isIgnored() const

Indicates if this volume should be ignored by applications.

If it should be ignored, it generally means that it should be invisible to the user. It's useful for firmware partitions or OS reinstall partitions on some systems.

@return true if the volume should be ignored

[virtual] bool StorageAccess::repair()

Tries to repair the filesystem.

Mounted or unsupported filesystems will result in an error.

@return Whether the filesystem could be successfully repaired

[virtual protected] void StorageAccess::repairDone(Solid::ErrorType error, QVariant resultData, const QString &udi)

This signal is emitted when the attempted repaired of this device is completed.

@param error type of error that occurred, if any @param errorData more information about the error, if any @param udi the UDI of the volume

[virtual protected] void StorageAccess::repairRequested(const QString &udi)

This signal is emitted when a repair of this device is requested. The signal might be spontaneous i.e. it can be triggered by another process.

@param udi the UDI of the volume

[pure virtual] bool StorageAccess::setup()

Mounts the volume.

@return the job handling the operation

[pure virtual protected] void StorageAccess::setupDone(Solid::ErrorType error, QVariant resultData, const QString &udi)

This signal is emitted when the mount state of this device has changed.

@param newState true if the volume is mounted, false otherwise @param udi the UDI of the volume

[pure virtual protected] void StorageAccess::setupRequested(const QString &udi)

This signal is emitted when a setup of this device is requested. The signal might be spontaneous i.e. it can be triggered by another process.

@param udi the UDI of the volume

[pure virtual] bool StorageAccess::teardown()

Unmounts the volume.

@return the job handling the operation

[pure virtual protected] void StorageAccess::teardownDone(Solid::ErrorType error, QVariant resultData, const QString &udi)

This signal is emitted when the mount state of this device has changed.

@param newState true if the volume is mounted, false otherwise @param udi the UDI of the volume

[pure virtual protected] void StorageAccess::teardownRequested(const QString &udi)

This signal is emitted when a teardown of this device is requested. The signal might be spontaneous i.e. it can be triggered by another process

@param udi the UDI of the volume