D15989: Disable unmount option for / or /home
Elvis Angelaccio
noreply at phabricator.kde.org
Thu Oct 11 21:17:04 BST 2018
elvisangelaccio requested changes to this revision.
elvisangelaccio added inline comments.
This revision now requires changes to proceed.
INLINE COMMENTS
> placespanel.cpp:185
> if (teardownAction) {
> + KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(QDir::homePath());
> + if (item->url() == QUrl::fromLocalFile(QDir::rootPath()) ||
Please use a descriptive name for the variable (e.g. `mountPoint`).
> placespanel.cpp:185
> if (teardownAction) {
> + KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(QDir::homePath());
> + if (item->url() == QUrl::fromLocalFile(QDir::rootPath()) ||
Small optimization: we could do the mount points lookup (which isn't a trivial operation) only if we are sure `item->url()` is not the root path.
REPOSITORY
R318 Dolphin
REVISION DETAIL
https://phabricator.kde.org/D15989
To: thsurrel, #dolphin, #vdg, elvisangelaccio
Cc: sefaeyeoglu, elvisangelaccio, ngraham, broulik, bruns, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20181011/18ba0672/attachment.htm>
More information about the kfm-devel
mailing list