Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bookmark creation in GNOME, XFCE etc. #9752

Merged
merged 1 commit into from
May 31, 2022
Merged

Conversation

fmoc
Copy link
Contributor

@fmoc fmoc commented May 31, 2022

Gtk+ 3 based desktops store bookmarks information in another location. The old path was valid for Gtk+ 2 only.

Tested on xUbuntu 20.04, 22.04, Fedora 36, openSUSE Leap 15.3.

@fmoc fmoc requested a review from a team May 31, 2022 12:38
@TheOneRing
Copy link
Member

Are there still gtk2 distros? (should we handle both locations)

@fmoc
Copy link
Contributor Author

fmoc commented May 31, 2022

I don't think there are any left. Gtk+ 2.0 has been deprecated for a while now. Even Xfce adopted Gtk+ 3 around 2015.

Gtk+ 3 based desktops store bookmarks information in another location. The old path was valid for Gtk+ 2 only.

Tested on xUbuntu 20.04, 22.04, Fedora 36, openSUSE Leap 15.3.
@sonarcloud
Copy link

sonarcloud bot commented May 31, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@fmoc fmoc merged commit 5e0386c into master May 31, 2022
@delete-merged-branch delete-merged-branch bot deleted the work/fix-gtk-bookmarks branch May 31, 2022 15:07
@HanaGemela
Copy link
Contributor

HanaGemela commented Nov 10, 2022

Expected result: There is a bookmark in the sidebar of the file browser

@jnweiger
Copy link
Contributor

jnweiger commented Nov 11, 2022

On my Linux Mint 20.3, the file manager is Nemo 5.2.4 and with two active sync folder connections from shiny new 3.0.0-beta.1 client, it looks like this
grafik

There is nothing in the bookmarks, the two sync folder connections ownCloud and damkencloud are under My Computer.

@jnweiger
Copy link
Contributor

jnweiger commented Nov 11, 2022

Same with a trusted old 2.11.0 client. No bookmarks. Sorry.
Do I need to configure something special to make bookmarks appear?
In my world, I would actually not expect that the system adds bookmarks for me. I would want to add my bookmarks myself...

@HanaGemela HanaGemela added this to the 3.1 milestone Nov 11, 2022
@TheOneRing
Copy link
Member

@fmoc

@fmoc
Copy link
Contributor Author

fmoc commented Nov 14, 2022

This is working fine with the latest 3.1 daily on xubuntu 22.04.1. Same goes for 3.0.

screenshot_2022-11-14_15-16-52

In 2.11, bookmark creation is broken, but that is perfectly normal, since this went into 3.0.

I'll try Cinnamon and GNOME next.

@fmoc
Copy link
Contributor Author

fmoc commented Nov 14, 2022

Works as expected in an Ubuntu 22.04.1 with GNOME.

Using Linux Mint 21 with MATE, the bookmark creation does not work. I tracked the bug down to missing escaping: spaces must be escaped as %20. I suppose that we need to apply full URL encoding to the file:// URLs. We should check whether this works for other desktop environments as well.

Cinnamon is working as expected.

@fmoc
Copy link
Contributor Author

fmoc commented Nov 14, 2022

Adding the escaping makes Xfce display the bookmark like this:

Bildschirmfoto_2022-11-14_16-14-06

Right now, it looks like this:

Bildschirmfoto_2022-11-14_16-14-06

I am not sure what causes this behavior. Both ways are kind of broken.

On Mint 21 with Cinnamon, the escaping fixes the rendering. (In fact, without escaping, a warning icon
screenshot_2022-11-14_16-28-47 is displayed.)

Similar result on Ubuntu 22.04.1: screenshot_2022-11-14_16-41-33 vs. screenshot_2022-11-14_16-42-02

I don't think any of this is critical. I'll create an issue for 3.1.

@HanaGemela @jnweiger please limit testing of this change to the following desktop environments for now:

  • GNOME
  • Xfce
  • LXQt
  • Cinnamon

@fmoc fmoc mentioned this pull request Nov 14, 2022
2 tasks
@jnweiger
Copy link
Contributor

Seen with owncloud-client_3.0.0~daily20221125+oc-9173_amd64.deb on Linux Mint 20.3 with Cinnamon:

Bookmarks are now there:
grafik

@fmoc
Copy link
Contributor Author

fmoc commented Nov 25, 2022

Please post an excerpt of your ~/.config/gtk-3.0/bookmarks.

@jnweiger
Copy link
Contributor

jnweiger commented Nov 25, 2022

a) I never intentionally used bookmarks, seems the file has now more entries, than visible in the UI. Strange, but ok for me.
b) seems the proper syntax is two elements separated by whitespace. Filename + Display name
Correct fix is of course to avoid whitespace in the folder name.
As a workaround, you could add " (ownCloud)" at the end, then it would look a bit better. :-)

$ cat ~/.config/gtk-3.0/bookmarks 
file:///home/testy/corona corona
file:///home/testy/ownCloud ownCloud
file:///home/testy/damkenCloud damkenCloud
file:///home/testy/Documents Documents
file:///home/testy/Downloads Downloads
file:///home/testy/ownCloud - admin@demo.owncloud.org
file:///home/testy/testpilotcloud - demo@demo.owncloud.org

In my home, I actually have

$ ls -1d corona ownCloud damkenCloud Documents Downloads ownCloud\ -\ admin@demo.owncloud.org testpilotcloud\ -\ demo@demo.owncloud.org
ls: cannot access 'corona': No such file or directory
damkenCloud
Documents
Downloads
ownCloud
'ownCloud - admin@demo.owncloud.org'
'testpilotcloud - demo@demo.owncloud.org'

@fmoc
Copy link
Contributor Author

fmoc commented Nov 25, 2022

Please replace the spaces with %20, that should help. In fact, that is what #10280 is supposed to do.

@HanaGemela HanaGemela self-assigned this Nov 25, 2022
@jnweiger

This comment was marked as off-topic.

@jnweiger
Copy link
Contributor

jnweiger commented Nov 25, 2022

Added a new account (the one with cloud.fablab ...):

3& [testy:~] $ cat ~/.config/gtk-3.0/bookmarks 
file:///home/testy/corona corona
file:///home/testy/ownCloud ownCloud
file:///home/testy/damkenCloud damkenCloud
file:///home/testy/Documents Documents
file:///home/testy/Downloads Downloads
file:///home/testy/ownCloud jw@cloud.owncloud.com
file:///home/testy/ownCloud%20-%20J%C3%BCrgen%20Weigert@cloud.fablab-nuernberg.de

This time it got proper escaping. OK
The display name is missing, but that is harmless in Cinnamon, it nicely uses the part after the last / as display name.

Bookmarks can be "renamed" in Nemo. After doing so the file looks like this:

3& [testy:~] $ cat ~/.config/gtk-3.0/bookmarks 
file:///home/testy/corona corona
file:///home/testy/ownCloud ownCloud
file:///home/testy/damkenCloud damkenCloud
file:///home/testy/Documents Documents
file:///home/testy/Downloads Downloads
file:///home/testy/ownCloud jw@cloud.owncloud.com
file:///home/testy/ownCloud%20-%20J%C3%BCrgen%20Weigert@cloud.fablab-nuernberg.de cloud.fablab-nuernberg.de

Just right. the whitesapaces that should be escaped remain escaped, the one that shouldn't isn't. OK.

Confirmed fixed from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants