Changeset View
Changeset View
Standalone View
Standalone View
src/solid/devices/backends/udisks2/udisksstorageaccess.h
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 42 | public: | |||
---|---|---|---|---|---|
43 | StorageAccess(Device *device); | 43 | StorageAccess(Device *device); | ||
44 | virtual ~StorageAccess(); | 44 | virtual ~StorageAccess(); | ||
45 | 45 | | |||
46 | bool isAccessible() const override; | 46 | bool isAccessible() const override; | ||
47 | QString filePath() const override; | 47 | QString filePath() const override; | ||
48 | bool isIgnored() const override; | 48 | bool isIgnored() const override; | ||
49 | bool setup() override; | 49 | bool setup() override; | ||
50 | bool teardown() override; | 50 | bool teardown() override; | ||
51 | bool changeLabel(const QString &label) override; | ||||
51 | 52 | | |||
52 | Q_SIGNALS: | 53 | Q_SIGNALS: | ||
53 | void accessibilityChanged(bool accessible, const QString &udi) override; | 54 | void accessibilityChanged(bool accessible, const QString &udi) override; | ||
54 | void setupDone(Solid::ErrorType error, QVariant errorData, const QString &udi) override; | 55 | void setupDone(Solid::ErrorType error, QVariant errorData, const QString &udi) override; | ||
55 | void teardownDone(Solid::ErrorType error, QVariant errorData, const QString &udi) override; | 56 | void teardownDone(Solid::ErrorType error, QVariant errorData, const QString &udi) override; | ||
57 | void labelChanged(Solid::ErrorType error, QVariant errorData, const QString &udi) override; | ||||
56 | void setupRequested(const QString &udi) override; | 58 | void setupRequested(const QString &udi) override; | ||
57 | void teardownRequested(const QString &udi) override; | 59 | void teardownRequested(const QString &udi) override; | ||
60 | void changeLabelRequested(const QString &udi) override; | ||||
58 | 61 | | |||
59 | public Q_SLOTS: | 62 | public Q_SLOTS: | ||
60 | Q_SCRIPTABLE Q_NOREPLY void passphraseReply(const QString &passphrase); | 63 | Q_SCRIPTABLE Q_NOREPLY void passphraseReply(const QString &passphrase); | ||
61 | 64 | | |||
62 | private Q_SLOTS: | 65 | private Q_SLOTS: | ||
63 | void slotDBusReply(const QDBusMessage &reply); | 66 | void slotDBusReply(const QDBusMessage &reply); | ||
64 | void slotDBusError(const QDBusError &error); | 67 | void slotDBusError(const QDBusError &error); | ||
65 | 68 | | |||
66 | void connectDBusSignals(); | 69 | void connectDBusSignals(); | ||
67 | 70 | | |||
68 | void slotSetupRequested(); | 71 | void slotSetupRequested(); | ||
69 | void slotSetupDone(int error, const QString &errorString); | 72 | void slotSetupDone(int error, const QString &errorString); | ||
70 | void slotTeardownRequested(); | 73 | void slotTeardownRequested(); | ||
71 | void slotTeardownDone(int error, const QString &errorString); | 74 | void slotTeardownDone(int error, const QString &errorString); | ||
75 | void slotChangeLabelRequested(); | ||||
76 | void slotLabelChanged(int error, const QString &errorString); | ||||
72 | 77 | | |||
73 | void checkAccessibility(); | 78 | void checkAccessibility(); | ||
74 | 79 | | |||
75 | private: | 80 | private: | ||
76 | /// @return true if this device is luks and unlocked | 81 | /// @return true if this device is luks and unlocked | ||
77 | bool isLuksDevice() const; | 82 | bool isLuksDevice() const; | ||
78 | 83 | | |||
79 | void updateCache(); | 84 | void updateCache(); | ||
80 | 85 | | |||
81 | bool mount(); | 86 | bool mount(); | ||
82 | bool unmount(); | 87 | bool unmount(); | ||
83 | 88 | | |||
84 | bool requestPassphrase(); | 89 | bool requestPassphrase(); | ||
85 | void callCryptoSetup(const QString &passphrase); | 90 | void callCryptoSetup(const QString &passphrase); | ||
86 | bool callCryptoTeardown(bool actOnParent = false); | 91 | bool callCryptoTeardown(bool actOnParent = false); | ||
87 | 92 | | |||
88 | QString generateReturnObjectPath(); | 93 | QString generateReturnObjectPath(); | ||
89 | QString clearTextPath() const; | 94 | QString clearTextPath() const; | ||
90 | 95 | | |||
96 | bool setLabel(const QString &label); | ||||
97 | | ||||
91 | private: | 98 | private: | ||
92 | bool m_isAccessible; | 99 | bool m_isAccessible; | ||
93 | bool m_setupInProgress; | 100 | bool m_setupInProgress; | ||
94 | bool m_teardownInProgress; | 101 | bool m_teardownInProgress; | ||
95 | bool m_passphraseRequested; | 102 | bool m_passphraseRequested; | ||
103 | bool m_changingLabel; | ||||
96 | QString m_lastReturnObject; | 104 | QString m_lastReturnObject; | ||
97 | 105 | | |||
98 | static const int s_unmountTimeout = 0x7fffffff; | 106 | static const int s_unmountTimeout = 0x7fffffff; | ||
99 | }; | 107 | }; | ||
100 | } | 108 | } | ||
101 | } | 109 | } | ||
102 | } | 110 | } | ||
103 | 111 | | |||
104 | #endif // UDISKSSTORAGEACCESS_H | 112 | #endif // UDISKSSTORAGEACCESS_H |