Solid

frontend/storageaccess.cpp
1 /*
2  SPDX-FileCopyrightText: 2006-2007 Kevin Ottens <[email protected]>
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(backendObject, SIGNAL(setupDone(Solid::ErrorType,QVariant,QString)),
17  this, SIGNAL(setupDone(Solid::ErrorType,QVariant,QString)));
18  connect(backendObject, SIGNAL(teardownDone(Solid::ErrorType,QVariant,QString)),
19  this, SIGNAL(teardownDone(Solid::ErrorType,QVariant,QString)));
20  connect(backendObject, SIGNAL(setupRequested(QString)),
21  this, SIGNAL(setupRequested(QString)));
22  connect(backendObject, SIGNAL(teardownRequested(QString)),
23  this, SIGNAL(teardownRequested(QString)));
24 
25  connect(backendObject, SIGNAL(accessibilityChanged(bool,QString)),
26  this, SIGNAL(accessibilityChanged(bool,QString)));
27 }
28 
29 Solid::StorageAccess::StorageAccess(StorageAccessPrivate &dd, QObject *backendObject)
30  : DeviceInterface(dd, backendObject)
31 {
32  connect(backendObject, SIGNAL(setupDone(Solid::StorageAccess::SetupResult,QVariant,QString)),
33  this, SIGNAL(setupDone(Solid::StorageAccess::SetupResult,QVariant,QString)));
34  connect(backendObject, SIGNAL(teardownDone(Solid::StorageAccess::TeardownResult,QVariant,QString)),
35  this, SIGNAL(teardownDone(Solid::StorageAccess::TeardownResult,QVariant,QString)));
36  connect(backendObject, SIGNAL(setupRequested(QString)),
37  this, SIGNAL(setupRequested(QString)));
38  connect(backendObject, SIGNAL(teardownRequested(QString)),
39  this, SIGNAL(teardownRequested(QString)));
40 
41  connect(backendObject, SIGNAL(accessibilityChanged(bool,QString)),
42  this, SIGNAL(accessibilityChanged(bool,QString)));
43 }
44 
46 {
47 
48 }
49 
51 {
52  Q_D(const StorageAccess);
53  return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, isAccessible());
54 }
55 
57 {
58  Q_D(const StorageAccess);
59  return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), QString(), filePath());
60 }
61 
63 {
64  Q_D(StorageAccess);
65  return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, setup());
66 }
67 
69 {
70  Q_D(StorageAccess);
71  return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), false, teardown());
72 }
73 
75 {
76  Q_D(const StorageAccess);
77  return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), true, isIgnored());
78 }
79 
void teardownRequested(const QString &udi)
This signal is emitted when a teardown of this device is requested.
void setupRequested(const QString &udi)
This signal is emitted when a setup of this device is requested.
bool isAccessible() const
Indicates if this volume is mounted.
Base class of all the device interfaces.
void setupDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
This signal is emitted when the attempted setting up of this device is completed. ...
virtual ~StorageAccess()
Destroys a StorageAccess object.
void accessibilityChanged(bool accessible, const QString &udi)
This signal is emitted when the accessiblity of this device has changed.
bool isIgnored() const
Indicates if this volume should be ignored by applications.
This device interface is available on volume devices to access them (i.e.
QString filePath() const
Retrieves the absolute path of this volume mountpoint.
void teardownDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
This signal is emitted when the attempted tearing down of this device is completed.
This device interface is available on volume devices.
bool teardown()
Unmounts the volume.
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
bool setup()
Mounts the volume.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 22:50:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.