File indexing completed on 2024-05-12 04:01:52
0001 /* 0002 SPDX-FileCopyrightText: 2006-2007 Kevin Ottens <ervin@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #include "storageaccess.h" 0008 #include "storageaccess_p.h" 0009 0010 #include "soliddefs_p.h" 0011 #include <solid/devices/ifaces/storageaccess.h> 0012 0013 Solid::StorageAccess::StorageAccess(QObject *backendObject) 0014 : DeviceInterface(*new StorageAccessPrivate(), backendObject) 0015 { 0016 connect(backendObject, SIGNAL(setupDone(Solid::ErrorType, QVariant, QString)), this, SIGNAL(setupDone(Solid::ErrorType, QVariant, QString))); 0017 connect(backendObject, SIGNAL(teardownDone(Solid::ErrorType, QVariant, QString)), this, SIGNAL(teardownDone(Solid::ErrorType, QVariant, QString))); 0018 connect(backendObject, SIGNAL(setupRequested(QString)), this, SIGNAL(setupRequested(QString))); 0019 connect(backendObject, SIGNAL(teardownRequested(QString)), this, SIGNAL(teardownRequested(QString))); 0020 0021 connect(backendObject, SIGNAL(accessibilityChanged(bool, QString)), this, SIGNAL(accessibilityChanged(bool, QString))); 0022 } 0023 0024 Solid::StorageAccess::StorageAccess(StorageAccessPrivate &dd, QObject *backendObject) 0025 : DeviceInterface(dd, backendObject) 0026 { 0027 connect(backendObject, 0028 SIGNAL(setupDone(Solid::StorageAccess::SetupResult, QVariant, QString)), 0029 this, 0030 SIGNAL(setupDone(Solid::StorageAccess::SetupResult, QVariant, QString))); 0031 connect(backendObject, 0032 SIGNAL(teardownDone(Solid::StorageAccess::TeardownResult, QVariant, QString)), 0033 this, 0034 SIGNAL(teardownDone(Solid::StorageAccess::TeardownResult, QVariant, QString))); 0035 connect(backendObject, SIGNAL(setupRequested(QString)), this, SIGNAL(setupRequested(QString))); 0036 connect(backendObject, SIGNAL(teardownRequested(QString)), this, SIGNAL(teardownRequested(QString))); 0037 0038 connect(backendObject, SIGNAL(accessibilityChanged(bool, QString)), this, SIGNAL(accessibilityChanged(bool, QString))); 0039 } 0040 0041 Solid::StorageAccess::~StorageAccess() 0042 { 0043 } 0044 0045 bool Solid::StorageAccess::isAccessible() const 0046 { 0047 Q_D(const StorageAccess); 0048 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, isAccessible()); 0049 } 0050 0051 QString Solid::StorageAccess::filePath() const 0052 { 0053 Q_D(const StorageAccess); 0054 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), QString(), filePath()); 0055 } 0056 0057 bool Solid::StorageAccess::setup() 0058 { 0059 Q_D(StorageAccess); 0060 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, setup()); 0061 } 0062 0063 bool Solid::StorageAccess::teardown() 0064 { 0065 Q_D(StorageAccess); 0066 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, teardown()); 0067 } 0068 0069 bool Solid::StorageAccess::isIgnored() const 0070 { 0071 Q_D(const StorageAccess); 0072 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), true, isIgnored()); 0073 } 0074 0075 bool Solid::StorageAccess::isEncrypted() const 0076 { 0077 Q_D(const StorageAccess); 0078 return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, isEncrypted()); 0079 } 0080 0081 #include "moc_storageaccess.cpp"