| 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 | |
| 13 | Solid::StorageAccess::StorageAccess(QObject *backendObject) |
| 14 | : DeviceInterface(*new StorageAccessPrivate(), backendObject) |
| 15 | { |
| 16 | connect(sender: backendObject, SIGNAL(setupDone(Solid::ErrorType, QVariant, QString)), receiver: this, SIGNAL(setupDone(Solid::ErrorType, QVariant, QString))); |
| 17 | connect(sender: backendObject, SIGNAL(teardownDone(Solid::ErrorType, QVariant, QString)), receiver: this, SIGNAL(teardownDone(Solid::ErrorType, QVariant, QString))); |
| 18 | connect(sender: backendObject, SIGNAL(setupRequested(QString)), receiver: this, SIGNAL(setupRequested(QString))); |
| 19 | connect(sender: backendObject, SIGNAL(teardownRequested(QString)), receiver: this, SIGNAL(teardownRequested(QString))); |
| 20 | |
| 21 | connect(sender: backendObject, SIGNAL(accessibilityChanged(bool, QString)), receiver: this, SIGNAL(accessibilityChanged(bool, QString))); |
| 22 | |
| 23 | connect(sender: backendObject, SIGNAL(checkRequested(QString)), receiver: this, SIGNAL(checkRequested(QString))); |
| 24 | connect(sender: backendObject, SIGNAL(checkDone(Solid::ErrorType, QVariant, QString)), receiver: this, SIGNAL(checkDone(Solid::ErrorType, QVariant, QString))); |
| 25 | connect(sender: backendObject, SIGNAL(repairRequested(QString)), receiver: this, SIGNAL(repairRequested(QString))); |
| 26 | connect(sender: backendObject, SIGNAL(repairDone(Solid::ErrorType, QVariant, QString)), receiver: this, SIGNAL(repairDone(Solid::ErrorType, QVariant, QString))); |
| 27 | } |
| 28 | |
| 29 | Solid::StorageAccess::StorageAccess(StorageAccessPrivate &dd, QObject *backendObject) |
| 30 | : DeviceInterface(dd, backendObject) |
| 31 | { |
| 32 | connect(sender: backendObject, |
| 33 | SIGNAL(setupDone(Solid::StorageAccess::SetupResult, QVariant, QString)), |
| 34 | receiver: this, |
| 35 | SIGNAL(setupDone(Solid::StorageAccess::SetupResult, QVariant, QString))); |
| 36 | connect(sender: backendObject, |
| 37 | SIGNAL(teardownDone(Solid::StorageAccess::TeardownResult, QVariant, QString)), |
| 38 | receiver: this, |
| 39 | SIGNAL(teardownDone(Solid::StorageAccess::TeardownResult, QVariant, QString))); |
| 40 | connect(sender: backendObject, SIGNAL(setupRequested(QString)), receiver: this, SIGNAL(setupRequested(QString))); |
| 41 | connect(sender: backendObject, SIGNAL(teardownRequested(QString)), receiver: this, SIGNAL(teardownRequested(QString))); |
| 42 | |
| 43 | connect(sender: backendObject, SIGNAL(accessibilityChanged(bool, QString)), receiver: this, SIGNAL(accessibilityChanged(bool, QString))); |
| 44 | |
| 45 | connect(sender: backendObject, SIGNAL(checkRequested(QString)), receiver: this, SIGNAL(checkRequested(QString))); |
| 46 | connect(sender: backendObject, SIGNAL(checkDone(Solid::ErrorType, QVariant, QString)), receiver: this, SIGNAL(checkDone(Solid::ErrorType, QVariant, QString))); |
| 47 | connect(sender: backendObject, SIGNAL(repairRequested(QString)), receiver: this, SIGNAL(repairRequested(QString))); |
| 48 | connect(sender: backendObject, SIGNAL(repairDone(Solid::ErrorType, QVariant, QString)), receiver: this, SIGNAL(repairDone(Solid::ErrorType, QVariant, QString))); |
| 49 | } |
| 50 | |
| 51 | Solid::StorageAccess::~StorageAccess() |
| 52 | { |
| 53 | } |
| 54 | |
| 55 | bool Solid::StorageAccess::isAccessible() const |
| 56 | { |
| 57 | Q_D(const StorageAccess); |
| 58 | return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, isAccessible()); |
| 59 | } |
| 60 | |
| 61 | QString Solid::StorageAccess::filePath() const |
| 62 | { |
| 63 | Q_D(const StorageAccess); |
| 64 | return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), QString(), filePath()); |
| 65 | } |
| 66 | |
| 67 | bool Solid::StorageAccess::setup() |
| 68 | { |
| 69 | Q_D(StorageAccess); |
| 70 | return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, setup()); |
| 71 | } |
| 72 | |
| 73 | bool Solid::StorageAccess::teardown() |
| 74 | { |
| 75 | Q_D(StorageAccess); |
| 76 | return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, teardown()); |
| 77 | } |
| 78 | |
| 79 | bool Solid::StorageAccess::isIgnored() const |
| 80 | { |
| 81 | Q_D(const StorageAccess); |
| 82 | return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), true, isIgnored()); |
| 83 | } |
| 84 | |
| 85 | bool Solid::StorageAccess::isEncrypted() const |
| 86 | { |
| 87 | Q_D(const StorageAccess); |
| 88 | return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, isEncrypted()); |
| 89 | } |
| 90 | |
| 91 | bool Solid::StorageAccess::canCheck() const |
| 92 | { |
| 93 | Q_D(const StorageAccess); |
| 94 | return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, canCheck()); |
| 95 | } |
| 96 | |
| 97 | bool Solid::StorageAccess::check() |
| 98 | { |
| 99 | Q_D(StorageAccess); |
| 100 | return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, check()); |
| 101 | } |
| 102 | |
| 103 | bool Solid::StorageAccess::canRepair() const |
| 104 | { |
| 105 | Q_D(const StorageAccess); |
| 106 | return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, canRepair()); |
| 107 | } |
| 108 | |
| 109 | bool Solid::StorageAccess::repair() |
| 110 | { |
| 111 | Q_D(StorageAccess); |
| 112 | return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, repair()); |
| 113 | } |
| 114 | |
| 115 | #include "moc_storageaccess.cpp" |
| 116 | |