Add Desktop and Downloads to the default list of Places
ClosedPublic

Authored by ngraham on Mar 28 2018, 3:58 PM.

Details

Summary

Add Desktop and Downloads to the default list of places, for the following reasons:

  1. The Desktop and Downloads folders are heavily used by average users, and making them accessible by default from Dolphin and file open/save dialogs is a big usability win
  2. We'll have space to do it without cluttering up the panel from having removed some un-useful entries in D11767: Remove Recently Saved This Month and Recently Saved Last Month entries by default

FEATURE: 203472
FIXED-IN: 5.46

Test Plan

Created a new user account, logged into it, and opened Dolphin:

Diff Detail

Branch
add-desktop-and-downloads (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
ngraham requested review of this revision.Mar 28 2018, 3:58 PM
ngraham created this revision.
ngraham edited the test plan for this revision. (Show Details)Mar 28 2018, 3:59 PM
ngraham set the repository for this revision to R241 KIO.
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 28 2018, 3:59 PM

+1

src/filewidgets/kfileplacesmodel.cpp
245

Desktop KIO claims that this may return $HOME if the Desktop folder does not exist, can you confirm/invalidate that?

ngraham added inline comments.Mar 29 2018, 1:43 PM
src/filewidgets/kfileplacesmodel.cpp
245

If I delete ~/Desktop, trying to access it via the Places entry gives me a red KMessageWidget that says "The file or folder /home/test/Desktop does not exist."

Still, that folder exists by default, and I think the kind of user who deletes their Desktop folder is the kind of user we're not targeting with this change.

Still, that folder exists by default

Are you sure? It might be created by some weird startup script or something else. Also, a user can choose to change the location of the Desktop folder. Just wanting to make sure this change (which I'm totally in favor of, don't get me wrong) doesn't break or have unwanted side-effects.

In Neon and Kubuntu, ~/Desktop exists for a new user by default. Is this not the case in other distros?

I think a user who goes and figures out how to make Folder View point to a different folder than ~/Desktop is the kind of user who can figure out how to edit and delete Places panel entries.

Still, that folder exists by default

Are you sure? It might be created by some weird startup script or something else. Also, a user can choose to change the location of the Desktop folder. Just wanting to make sure this change (which I'm totally in favor of, don't get me wrong) doesn't break or have unwanted side-effects.

It might exist by default on some distributions, but we cannot assume that it is created on all systems. Arch Linux, just to give one example, will not create any folders for you. I imagine that it can be quite annoying to see a warning on the first start of dolphin, just because a folder is missing that the user didn't event want to have.

I like the change in general, but please add a check if the folder exists before creating the bookmark.

fabiank added a subscriber: fabiank.EditedMar 29 2018, 2:28 PM

In Neon and Kubuntu, ~/Desktop exists for a new user by default. Is this not the case in other distros?

I'm not sure what is currently done, but I'm pretty sure in Chakra we used to create localized versions (and I think even Ubuntu did that), so instead of ~/Desktop, a German user would have ~/Schreibtisch. There's actually an xdg standard for this, https://www.freedesktop.org/wiki/Software/xdg-user-dirs. Afaik, Qt supports this with QStandardPaths, e.g. QStandardPaths::DesktopLocation. Actually, scratch that, it doesn't support xdg-user-dirs, and returns a generic value.

In Neon and Kubuntu, ~/Desktop exists for a new user by default. Is this not the case in other distros?

I'm not sure what is currently done, but I'm pretty sure in Chakra we used to create localized versions (and I think even Ubuntu did that), so instead of ~/Desktop, a German user would have ~/Schreibtisch. There's actually an xdg standard for this, https://www.freedesktop.org/wiki/Software/xdg-user-dirs. Afaik, Qt supports this with QStandardPaths, e.g. QStandardPaths::DesktopLocation. Actually, scratch that, it doesn't support xdg-user-dirs, and returns a generic value.

This patch uses QStandardPaths::DesktopLocation(), so that case is handled. In discussions here, I was just referring to "~/Desktop" as a placeholder for the appropriate location.

markg requested changes to this revision.Mar 29 2018, 4:32 PM
markg added a subscriber: markg.

I don't know why, but i already have this by default in my Dolphin... (ArchLinux user here, i don't think they add it explicitly as they try to stay as true to upstream as possible).
So, err, don't know why.

Anyhow, having them by default is a big +1 from me.

Yet i still give a -1.. The reason for that is simple. Ever since the placesmodel changes in KIO and Dolphin, a unittest for that fails. Fix that first.
I did have a look at it, but quite some placesmodel magic changed so it's better if one of the authors of those changes takes a look.
For reference:, look at all the recent builds of Dolphin and KIO.
Dolphin: https://build.kde.org/job/Applications%20dolphin%20kf5-qt5%20SUSEQt5.9/
KIO: https://build.kde.org/job/Frameworks%20kio%20kf5-qt5%20SUSEQt5.10/

This revision now requires changes to proceed.Mar 29 2018, 4:32 PM

I sent an email to Renato asking if he can resolve the test failures.

ngraham updated this revision to Diff 30891.Mar 29 2018, 10:52 PM

Only create user place bookmarks if their target directories already exist

huoni added a subscriber: huoni.Mar 29 2018, 10:52 PM

FWIW, I run Arch, and never use Desktop View and therefore the Desktop folder.
I do have ~/Desktop, but I do not have the places entries by default.

I definitely +1 this change, but it has to be robust and deal with any combination of pre-existing distro defaults.

ngraham marked 2 inline comments as done.Mar 29 2018, 10:54 PM
progwolff accepted this revision.Mar 30 2018, 8:36 AM
ngraham edited the summary of this revision. (Show Details)
ngraham set the repository for this revision to R241 KIO.
ngraham edited the summary of this revision. (Show Details)Apr 9 2018, 6:46 PM
abetts added a subscriber: abetts.Apr 20 2018, 4:21 AM

I would say remove search for images audio files and video and move them to the places location

markg accepted this revision.Apr 22 2018, 3:15 PM

Blocking it any longer seems rude to me :)

This revision is now accepted and ready to land.Apr 22 2018, 3:15 PM

Heh, thanks. Renato said he'd fix the tests soon, FWIW.

ngraham closed this revision.Apr 22 2018, 3:24 PM

Hey Nate, is there a reason why Documents was not added with this patch? I always end up adding it. I was reading through D10245#201638 and the discussion seemed in favor of adding it, along with the Desktop and Downloads.

Restricted Application added a subscriber: kde-frameworks-devel. · View Herald TranscriptSep 1 2018, 5:02 AM

It was done in the interests of getting something in rather than nothing, since my initial larger list was controversial. I would favor adding Documents too, FWIW. Seems like others felt similarly. Wanna submit a patch? :)