Solid::StorageAccess Class
class Solid::StorageAccessThis device interface is available on volume devices to access them (i.e. mount or unmount them). More...
Header: | #include <Solid/StorageAccess> |
CMake: | find_package(KF6 REQUIRED COMPONENTS Solid) target_link_libraries(mytarget PRIVATE KF6::Solid) |
Inherits: | Solid::DeviceInterface |
Properties
- accessible : const bool
- encrypted : const bool
- filePath : const QString
- ignored : const bool
Public Functions
bool | canCheck() const |
bool | canRepair() const |
bool | check() |
QString | filePath() const |
bool | isAccessible() const |
(since 5.80) bool | isEncrypted() const |
bool | isIgnored() const |
bool | repair() |
bool | setup() |
bool | teardown() |
Signals
void | accessibilityChanged(bool accessible, const QString &udi) |
(since 6.11) void | checkDone(Solid::ErrorType error, QVariant errorData, const QString &udi) |
(since 6.11) void | checkRequested(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() |
Detailed Description
A volume is anything that can contain data (partition, optical disc, memory card). It's a particular kind of block device.
Property Documentation
[read-only]
accessible : const bool
Access functions:
bool | isAccessible() const |
[read-only]
encrypted : const bool
Access functions:
bool | isEncrypted() const |
[read-only]
filePath : const QString
Access functions:
QString | filePath() const |
[read-only]
ignored : const bool
Access functions:
bool | isIgnored() const |
Member Function Documentation
[signal]
void StorageAccess::accessibilityChanged(bool accessible, const QString &udi)
This signal is emitted when the accessiblity of this device has changed.
accessible true if the volume is accessible, false otherwise
udi the UDI of the volume
bool StorageAccess::canCheck() const
Indicates if this volume can check for filesystem errors.
Returns 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.
Returns 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.
Returns Whether the filesystem is undamaged.
[signal, since 6.11]
void StorageAccess::checkDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
This signal is emitted when the attempted check of this device is completed. The signal might be spontaneous i.e. it can be triggered by another process.
error type of error that occurred, if any
errorData more information about the error, if any
udi the UDI of the volume
This function was introduced in 6.11.
[signal, since 6.11]
void StorageAccess::checkRequested(const QString &udi)
This signal is emitted when a check of this device is requested. The signal might be spontaneous i.e. it can be triggered by another process.
udi the UDI of the volume
This function was introduced in 6.11.
[static]
Solid::DeviceInterface::Type StorageAccess::deviceInterfaceType()
Get the Solid::DeviceInterface::Type of the StorageAccess device interface.
Returns the StorageVolume device interface type
See also Solid::Ifaces::Enums::DeviceInterface::Type.
QString StorageAccess::filePath() const
Retrieves the absolute path of this volume mountpoint.
Returns 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.
Returns true if the volume is mounted
Note: Getter function for property accessible.
[since 5.80]
bool StorageAccess::isEncrypted() const
Checks if source of the storage is encrypted.
Returns true if storage is encrypted one
Note: Getter function for property encrypted.
This function was introduced in 5.80.
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.
Returns 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.
Returns 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.
error type of error that occurred, if any
errorData more information about the error, if any
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.
udi the UDI of the volume
bool StorageAccess::setup()
Mounts the volume.
Returns 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.
error type of error that occurred, if any
errorData more information about the error, if any
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.
udi the UDI of the volume
bool StorageAccess::teardown()
Unmounts the volume.
Returns 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.
error type of error that occurred, if any
errorData more information about the error, if any
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
udi the UDI of the volume