Changeset View
Changeset View
Standalone View
Standalone View
src/solid/devices/backends/fstab/fstabdevice.h
Show All 16 Lines | 1 | /* | |||
---|---|---|---|---|---|
17 | You should have received a copy of the GNU Lesser General Public | 17 | You should have received a copy of the GNU Lesser General Public | ||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef SOLID_BACKENDS_FSTAB_FSTAB_DEVICE_H | 21 | #ifndef SOLID_BACKENDS_FSTAB_FSTAB_DEVICE_H | ||
22 | #define SOLID_BACKENDS_FSTAB_FSTAB_DEVICE_H | 22 | #define SOLID_BACKENDS_FSTAB_FSTAB_DEVICE_H | ||
23 | 23 | | |||
24 | #include <solid/devices/ifaces/device.h> | 24 | #include <solid/devices/ifaces/device.h> | ||
25 | #include <solid/devices/backends/fstab/filesystem_entry.h> | ||||
25 | #include <QStringList> | 26 | #include <QStringList> | ||
26 | #include <QPointer> | 27 | #include <QPointer> | ||
27 | #include "fstabstorageaccess.h" | 28 | #include "fstabstorageaccess.h" | ||
28 | 29 | | |||
29 | namespace Solid | 30 | namespace Solid | ||
30 | { | 31 | { | ||
31 | namespace Backends | 32 | namespace Backends | ||
32 | { | 33 | { | ||
33 | namespace Fstab | 34 | namespace Fstab | ||
34 | { | 35 | { | ||
35 | 36 | | |||
37 | class SystemFilesystemTable; | ||||
38 | | ||||
36 | class FstabDevice : public Solid::Ifaces::Device | 39 | class FstabDevice : public Solid::Ifaces::Device | ||
37 | { | 40 | { | ||
38 | Q_OBJECT | 41 | Q_OBJECT | ||
39 | 42 | | |||
40 | public: | 43 | public: | ||
41 | FstabDevice(QString uid); | 44 | FstabDevice(QString uid, const FilesystemEntry &fsEntry, const SystemFilesystemTable& sysFsTable); | ||
42 | 45 | | |||
43 | virtual ~FstabDevice(); | 46 | virtual ~FstabDevice(); | ||
44 | 47 | | |||
45 | QString udi() const override; | 48 | QString udi() const override; | ||
46 | 49 | | |||
47 | QString parentUdi() const override; | 50 | QString parentUdi() const override; | ||
48 | 51 | | |||
49 | QString vendor() const override; | 52 | QString vendor() const override; | ||
50 | 53 | | |||
51 | QString product() const override; | 54 | QString product() const override; | ||
52 | 55 | | |||
53 | QString icon() const override; | 56 | QString icon() const override; | ||
54 | 57 | | |||
55 | QStringList emblems() const override; | 58 | QStringList emblems() const override; | ||
56 | 59 | | |||
57 | QString description() const override; | 60 | QString description() const override; | ||
58 | 61 | | |||
59 | bool queryDeviceInterface(const Solid::DeviceInterface::Type &type) const override; | 62 | bool queryDeviceInterface(const Solid::DeviceInterface::Type &type) const override; | ||
60 | 63 | | |||
61 | QObject *createDeviceInterface(const Solid::DeviceInterface::Type &type) override; | 64 | QObject *createDeviceInterface(const Solid::DeviceInterface::Type &type) override; | ||
62 | 65 | | |||
63 | QString device() const; | 66 | QString device() const; | ||
64 | 67 | | |||
68 | const FilesystemEntry& filesystemEntry() const; | ||||
69 | | ||||
70 | const SystemFilesystemTable& systemFilesystemTable() const; | ||||
71 | | ||||
65 | Q_SIGNALS: | 72 | Q_SIGNALS: | ||
66 | void mtabChanged(const QString &device); | 73 | void filesystemEntryChanged(const FilesystemEntry &fsEntry); | ||
67 | 74 | | |||
68 | private Q_SLOTS: | 75 | private Q_SLOTS: | ||
69 | void onMtabChanged(const QString &device); | 76 | void onFilesystemEntryChanged(const FilesystemEntry &fsEntry); | ||
70 | 77 | | |||
71 | private: | 78 | private: | ||
72 | QString m_uid; | 79 | QString m_uid; | ||
73 | QString m_device; | 80 | QString m_device; | ||
74 | QString m_product; | 81 | QString m_product; | ||
75 | QString m_vendor; | 82 | QString m_vendor; | ||
76 | QString m_description; | 83 | QString m_description; | ||
77 | QString m_iconName; | 84 | QString m_iconName; | ||
78 | QPointer<FstabStorageAccess> m_storageAccess; | 85 | QPointer<FstabStorageAccess> m_storageAccess; | ||
79 | enum class StorageType : uint8_t { | 86 | enum class StorageType : uint8_t { | ||
80 | Other = 0, | 87 | Other = 0, | ||
81 | NetworkShare, | 88 | NetworkShare, | ||
82 | Encrypted, | 89 | Encrypted, | ||
83 | }; | 90 | }; | ||
84 | StorageType m_storageType = StorageType::Other; | 91 | StorageType m_storageType = StorageType::Other; | ||
92 | FilesystemEntry m_fsEntry; | ||||
93 | const SystemFilesystemTable& m_systemFilesystemTable; | ||||
85 | }; | 94 | }; | ||
86 | 95 | | |||
87 | } | 96 | } | ||
88 | } | 97 | } | ||
89 | } | 98 | } | ||
90 | #endif // SOLID_BACKENDS_FSTAB_FSTAB_DEVICE_H | 99 | #endif // SOLID_BACKENDS_FSTAB_FSTAB_DEVICE_H |