Solid::StorageAccess Class
class Solid::StorageAccessHeader: | #include <StorageAccess> |
CMake: | find_package(KF6 REQUIRED COMPONENTS Solid) target_link_libraries(mytarget PRIVATE KF6::Solid) |
Inherits: | Solid::DeviceInterface |
Public Functions
virtual | ~StorageAccess() override |
bool | canCheck() const |
bool | canRepair() const |
bool | check() |
QString | filePath() const |
bool | isAccessible() const |
bool | isEncrypted() const |
bool | isIgnored() const |
bool | repair() |
bool | setup() |
bool | teardown() |
Signals
void | accessibilityChanged(bool accessible, const QString &udi) |
void | repairDone(Solid::ErrorType error, QVariant errorData, const QString &udi) |
void | repairRequested(const QString &udi) |
void | setupDone(Solid::ErrorType error, QVariant errorData, const QString &udi) |
void | setupRequested(const QString &udi) |
void | teardownDone(Solid::ErrorType error, QVariant errorData, const QString &udi) |
void | teardownRequested(const QString &udi) |
Static Public Members
Solid::DeviceInterface::Type | deviceInterfaceType() |
Protected Functions
StorageAccess(Solid::StorageAccessPrivate &dd, QObject *backendObject) |
Detailed Description
@class Solid::StorageAccess storageaccess.h <Solid/StorageAccess>
This device interface is available on volume devices to access them (i.e. mount or unmount them).
A volume is anything that can contain data (partition, optical disc, memory card). It's a particular kind of block device.
Member Function Documentation
[protected]
StorageAccess::StorageAccess(Solid::StorageAccessPrivate &dd, QObject *backendObject)
@internal
[override virtual noexcept]
StorageAccess::~StorageAccess()
Destroys a StorageAccess object.
[signal]
void StorageAccess::accessibilityChanged(bool accessible, const QString &udi)
This signal is emitted when the accessiblity of this device has changed.
@param accessible true if the volume is accessible, false otherwise @param udi the UDI of the volume
bool StorageAccess::canCheck() const
Indicates if this volume can check for filesystem errors.
@return true if the volume is can be checked
bool StorageAccess::canRepair() const
Indicates if the filesystem of this volume supports repair attempts. It does not indicate if such an attempt will succeed.
@return true if the volume is can be repaired
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.
[static]
Solid::DeviceInterface::Type StorageAccess::deviceInterfaceType()
Get the Solid::DeviceInterface::Type of the StorageAccess device interface.
@return the StorageVolume device interface type @see Solid::Ifaces::Enums::DeviceInterface::Type
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
Note: Getter function for property filePath.
bool StorageAccess::isAccessible() const
Indicates if this volume is mounted.
@return true if the volume is mounted
Note: Getter function for property accessible.
bool StorageAccess::isEncrypted() const
Checks if source of the storage is encrypted.
@return true if storage is encrypted one
@since 5.80
Note: Getter function for property encrypted.
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
Note: Getter function for property ignored.
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
[signal]
void StorageAccess::repairDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
This signal is emitted when the attempted repaired of this device is completed. The signal might be spontaneous i.e. it can be triggered by another process.
@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
[signal]
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
bool StorageAccess::setup()
Mounts the volume.
@return false if the operation is not supported, true if the operation is attempted
[signal]
void StorageAccess::setupDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
This signal is emitted when the attempted setting up of this device is completed. The signal might be spontaneous i.e. it can be triggered by another process.
@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
[signal]
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
bool StorageAccess::teardown()
Unmounts the volume.
@return false if the operation is not supported, true if the operation is attempted
[signal]
void StorageAccess::teardownDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
This signal is emitted when the attempted tearing down of this device is completed. The signal might be spontaneous i.e. it can be triggered by another process.
@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
[signal]
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