Pages
API Documentation
On this page

Solid::StorageAccess Class

This 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

List of all members, including inherited members

Properties

Public Functions

Signals

Static Public Members

Detailed Description

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

A StorageAccess is commonly used in conjunction with StorageDrive and StorageVolume.

StorageDrive StorageVolume StorageAccess
drives partition tables / filesystems mount points / partitions
const List<Solid::Device> devices = Solid::Device::listFromType(Solid::DeviceInterface::StorageVolume, QString());
for (auto device : devices) {
    auto access = device.as<const Solid::StorageAccess>();
    if (access) {
        // ...
    }
}

Property Documentation

[read-only] accessible : bool

Access functions:

[read-only] encrypted : bool

Access functions:

[read-only] filePath : QString

Access functions:

[read-only] ignored : bool

Access functions:

Member Function Documentation

[signal] void StorageAccess::accessibilityChanged(bool accessible, const QString &udi)

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

bool StorageAccess::canCheck() const

Indicates if this volume can check for filesystem errors.

bool StorageAccess::canRepair() const

Returns whether the filesystem of this volume supports repair attempts.

It does not indicate if such an attempt will succeed.

bool StorageAccess::check()

Checks the filesystem for consistency avoiding any modifications or repairs.

Returns whether the filesystem is undamaged. Mounted or unsupported filesystems will result in an error.

[signal, since 6.11] void StorageAccess::checkDone(Solid::ErrorType error, QVariant errorData, const QString &udi)

This signal is emitted when the attempted check of the device with the given udi is completed.

Returns an error followed by additional errorData information, if any.

The signal might be spontaneous i.e. it can be triggered by another process.

This function was introduced in Qt 6.11.

[signal, since 6.11] void StorageAccess::checkRequested(const QString &udi)

This signal is emitted when a check of the device with the given udi is requested.

The signal might be spontaneous i.e. it can be triggered by another process.

This function was introduced in Qt 6.11.

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

Returns the Solid::DeviceInterface::Type of the StorageAccess device interface.

See also Solid::DeviceInterface::Type

QString StorageAccess::filePath() const

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

Returns if this volume is mounted.

Note: Getter function for property accessible.

bool StorageAccess::isEncrypted() const

Returns if the source of the storage is encrypted.

Note: Getter function for property encrypted.

bool StorageAccess::isIgnored() const

Returns whether 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.

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 repair of the device with the given udi is completed.

Returns an error followed by additional errorData information, if any.

The signal might be spontaneous i.e. it can be triggered by another process.

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

This signal is emitted when a repair of the device with the given udi is requested.

The signal might be spontaneous i.e. it can be triggered by another process.

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 the device with the given udi is completed.

Returns an error followed by additional errorData information, if any.

The signal might be spontaneous i.e. it can be triggered by another process.

[signal] void StorageAccess::setupRequested(const QString &udi)

* This signal is emitted when a setup of the device with the given udi is requested.

* The signal might be spontaneous i.e. it can be triggered by another process.

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 the device with the given udi is completed.

Returns an error followed by additional errorData information, if any.

The signal might be spontaneous i.e. it can be triggered by another process.

[signal] void StorageAccess::teardownRequested(const QString &udi)

This signal is emitted when a teardown of the device with the given udi is requested.

The signal might be spontaneous i.e. it can be triggered by another process.

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.