[PlacesItemModel] Use QDir::homePath() instead of KUser().homeDir()
ClosedPublic

Authored by broulik on Mar 14 2017, 1:59 PM.

Details

Summary

KUser does quite a lot of stuff under the hood and also calls getpwuid which might block with network login.

Test Plan

File system bookmark still shows up, $HOME variable on that machine was properly setup which QFileSystemEngine_unix::homePath() uses.

Diff Detail

Repository
R318 Dolphin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Mar 14 2017, 1:59 PM
dfaure accepted this revision.Mar 15 2017, 7:37 AM

Would be worth doing a search for all uses of KUser::homeDir() then -- and possibly deprecated it, except if it makes sense for e.g. a user-management KCM?

This revision is now accepted and ready to land.Mar 15 2017, 7:37 AM

I did a search for KUser() and found another occurrence in Yakuake - will lxr then. Another interesting find was KFileWidget which uses KUser to get the user's name for the what's this text(!) on the "Up" button so it can tell you "when you press this, e.g. /home/$name will be /home"

This revision was automatically updated to reflect the committed changes.