This disables the 'Unmount' context menu in the Places panel for discs
corresponding to / and /home.
It does not make much sense to offer an option that will always fail.
Twin of D15989 for Dolphin
BUG: 399659
ngraham |
Frameworks |
This disables the 'Unmount' context menu in the Places panel for discs
corresponding to / and /home.
It does not make much sense to offer an option that will always fail.
Twin of D15989 for Dolphin
BUG: 399659
No Linters Available |
No Unit Test Coverage |
Buildable 4878 | |
Build 4896: arc lint + arc unit |
Can you add CCBUG: 399659 to this so that bug report reflects that two commits were necessary to fully resolve it? Thanks!
However, I'm afraid this doesn't actually work for me:
(D15989 does work for Dolphin though)
Why would you be unable to unmount /home? If you're logged in as root (not saying that one should or can), whose home is /root you can surely unmount /home
If logged in as root, wouldn't QDir::homePath() return /root and not /home/<user> ? You should be able to unmount /home in that case.
+1
This whole method could put placesModel->url(index) into a local variable to avoid calling it so many times, though.
That's strange, it is the same code than in Dolphin (and it works for me). Could you have a look at the placesModel->url(index) != QUrl::fromLocalFile(QDir::rootPath()) comparison at tell me what each side contains ?
Rebase
Cache placesModel->url(index) in the contextMenuEvent function
@ngraham, could you help me debug the problem you are having ?
Wouldn't you know it, now it works for me. It probably worked all along; I bet I was doing something wrong, sorry!
Do address @dfaure's comment before landing, please.
I did make the modification asked by dfaure in the last diff.
So if there is no other comment, I will land this.