Solid

frontend/storageaccess.cpp
1/*
2 SPDX-FileCopyrightText: 2006-2007 Kevin Ottens <ervin@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "storageaccess.h"
8#include "storageaccess_p.h"
9
10#include "soliddefs_p.h"
11#include <solid/devices/ifaces/storageaccess.h>
12
13Solid::StorageAccess::StorageAccess(QObject *backendObject)
14 : DeviceInterface(*new StorageAccessPrivate(), backendObject)
15{
16 connect(backendObject, SIGNAL(setupDone(Solid::ErrorType, QVariant, QString)), this, SIGNAL(setupDone(Solid::ErrorType, QVariant, QString)));
17 connect(backendObject, SIGNAL(teardownDone(Solid::ErrorType, QVariant, QString)), this, SIGNAL(teardownDone(Solid::ErrorType, QVariant, QString)));
18 connect(backendObject, SIGNAL(setupRequested(QString)), this, SIGNAL(setupRequested(QString)));
19 connect(backendObject, SIGNAL(teardownRequested(QString)), this, SIGNAL(teardownRequested(QString)));
20
21 connect(backendObject, SIGNAL(accessibilityChanged(bool, QString)), this, SIGNAL(accessibilityChanged(bool, QString)));
22
23 connect(backendObject, SIGNAL(repairRequested(QString)), this, SIGNAL(repairRequested(QString)));
24 connect(backendObject, SIGNAL(repairDone(Solid::ErrorType, QVariant, QString)), this, SIGNAL(repairDone(Solid::ErrorType, QVariant, QString)));
25}
26
27Solid::StorageAccess::StorageAccess(StorageAccessPrivate &dd, QObject *backendObject)
28 : DeviceInterface(dd, backendObject)
29{
30 connect(backendObject,
31 SIGNAL(setupDone(Solid::StorageAccess::SetupResult, QVariant, QString)),
32 this,
33 SIGNAL(setupDone(Solid::StorageAccess::SetupResult, QVariant, QString)));
34 connect(backendObject,
35 SIGNAL(teardownDone(Solid::StorageAccess::TeardownResult, QVariant, QString)),
36 this,
37 SIGNAL(teardownDone(Solid::StorageAccess::TeardownResult, QVariant, QString)));
38 connect(backendObject, SIGNAL(setupRequested(QString)), this, SIGNAL(setupRequested(QString)));
39 connect(backendObject, SIGNAL(teardownRequested(QString)), this, SIGNAL(teardownRequested(QString)));
40
41 connect(backendObject, SIGNAL(accessibilityChanged(bool, QString)), this, SIGNAL(accessibilityChanged(bool, QString)));
42
43 connect(backendObject, SIGNAL(repairRequested(QString)), this, SIGNAL(repairRequested(QString)));
44 connect(backendObject, SIGNAL(repairDone(Solid::ErrorType, QVariant, QString)), this, SIGNAL(repairDone(Solid::ErrorType, QVariant, QString)));
45}
46
50
52{
53 Q_D(const StorageAccess);
54 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, isAccessible());
55}
56
57QString Solid::StorageAccess::filePath() const
58{
59 Q_D(const StorageAccess);
60 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), QString(), filePath());
61}
62
64{
66 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, setup());
67}
68
70{
72 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, teardown());
73}
74
76{
77 Q_D(const StorageAccess);
78 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), true, isIgnored());
79}
80
82{
83 Q_D(const StorageAccess);
84 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, isEncrypted());
85}
86
88{
89 Q_D(const StorageAccess);
90 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, canCheck());
91}
92
94{
96 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, check());
97}
98
100{
101 Q_D(const StorageAccess);
102 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, canRepair());
103}
104
106{
108 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, repair());
109}
110
111#include "moc_storageaccess.cpp"
Base class of all the device interfaces.
This device interface is available on volume devices.
This device interface is available on volume devices to access them (i.e.
bool repair()
Tries to repair the filesystem.
void repairDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
This signal is emitted when the attempted repaired of this device is completed.
bool isEncrypted() const
Checks if source of the storage is encrypted.
void setupRequested(const QString &udi)
This signal is emitted when a setup of this device is requested.
bool canRepair() const
Indicates if the filesystem of this volume supports repair attempts.
~StorageAccess() override
Destroys a StorageAccess object.
bool check()
Checks the filesystem for consistency avoiding any modifications or repairs.
void accessibilityChanged(bool accessible, const QString &udi)
This signal is emitted when the accessiblity of this device has changed.
void teardownRequested(const QString &udi)
This signal is emitted when a teardown of this device is requested.
bool isAccessible() const
Indicates if this volume is mounted.
bool teardown()
Unmounts the volume.
void teardownDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
This signal is emitted when the attempted tearing down of this device is completed.
bool setup()
Mounts the volume.
bool isIgnored() const
Indicates if this volume should be ignored by applications.
bool canCheck() const
Indicates if this volume can check for filesystem errors.
void setupDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
This signal is emitted when the attempted setting up of this device is completed.
void repairRequested(const QString &udi)
This signal is emitted when a repair of this device is requested.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:56:28 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.