D20433: Use mount point returned from DBus instead of using property value
Kai Uwe Broulik
noreply at phabricator.kde.org
Wed Apr 10 15:19:48 BST 2019
broulik added inline comments.
INLINE COMMENTS
> udisksstorageaccess.cpp:35
> StorageAccess::StorageAccess(Device *device)
> - : DeviceInterface(device), m_setupInProgress(false), m_teardownInProgress(false), m_passphraseRequested(false)
> + : DeviceInterface(device), m_setupInProgress(false), m_teardownInProgress(false), m_passphraseRequested(false), m_mountPoint()
> {
Initialization not needed for complex types
> udisksstorageaccess.cpp:82
> {
> - QByteArrayList mntPoints;
> -
> - if (isLuksDevice()) { // encrypted (and unlocked) device
> - const QString path = clearTextPath();
> - if (path.isEmpty() || path == "/") {
> - return QString();
> - }
> - Device holderDevice(path);
> - mntPoints = qdbus_cast<QByteArrayList>(holderDevice.prop("MountPoints"));
> + if (m_mountPoint.isEmpty()) {
> + QByteArrayList mntPoints = qdbus_cast<QByteArrayList>(m_device->prop("MountPoints"));
Won't this bypass the luks stuff when it is not mounted or something?
On mount you do this `holderDevice` dance but otherwise you just go straight to `MountPoints`
> udisksstorageaccess.cpp:151
> + if (isLuksDevice()) {
> + if(!isAccessible()) { // unlocked device, now mount it
> + mount();
Coding style: `if (!...) {`
> udisksstorageaccess.cpp:200
> m_teardownInProgress = false;
> m_device->invalidateCache();
> m_device->broadcastActionDone("teardown");
Don't you need to clear the `m_mountPoint` after unmount?
REPOSITORY
R245 Solid
REVISION DETAIL
https://phabricator.kde.org/D20433
To: nicolasfella, broulik, bruns
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190410/a1220020/attachment-0001.html>
More information about the Kde-frameworks-devel
mailing list