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

Use our own bookmarks file #1010

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use our own bookmarks file #1010

wants to merge 1 commit into from

Conversation

tsujan
Copy link
Member

@tsujan tsujan commented Aug 15, 2024

The new file is ~/.local/share/libfm-qt/bookmarks. If it doesn't exist or is empty, as soon as a libfm-qt based app is launched, the GTK3 file ~/.config/gtk-3.0/bookmarks will be consulted for backward compatibility, then the new file will be created and the GTK3 file will be ignored.

Closes #1009

NOTE: The portal file dialogs will see the change after a reboot (or after restarting user portal services).

@tsujan tsujan requested a review from stefonarch August 15, 2024 17:29
@tsujan
Copy link
Member Author

tsujan commented Aug 15, 2024

Oops! I forgot to consider the case where the folder ~/.local/share/libfm-qt/ doesn't exist yet. Will fix it soon.

The new file is `~/.local/share/libfm-qt/bookmarks`. If it doesn't exist or is empty, as soon as a libfm-qt based app is launched, the GTK3 file `~/.config/gtk-3.0/bookmarks` will be consulted for backward compatibility, then the new file will be created and the GTK3 file will be ignored.

Closes #1009

NOTE: The portal file dialogs will see the change after a reboot (or after restarting user portal services).
@tsujan tsujan force-pushed the bookmarks_conf_file branch from df4b49e to ca88a5f Compare August 15, 2024 19:33
@tsujan
Copy link
Member Author

tsujan commented Aug 15, 2024

Corrected now.

@stefonarch
Copy link
Member

stefonarch commented Aug 16, 2024

as soon as a libfm-qt based app is launched

Here it starts using the new bookmarks file only after adding/removing one, did even a relogin.

One downside I see is that the GTK filedialog (example Gimp) doesn't show the actual bookmarks. So not really sure if we should use this, as we can't be sure our filedialog will be used everywhere atm.

@tsujan
Copy link
Member Author

tsujan commented Aug 16, 2024

Here it starts using the new bookmarks file only after adding/removing one

Yes, it does, but even before that, although the user may not notice it. Provided that ~/.config/gtk-3.0/bookmarks exists, libfm-qt creates the new bookmarks file by copying it on opening a pcmanfm-qt window and uses it since then.

You can check that by removing the folder ~/.local/share/libfm-qt/, stopping the process of pcmanfm-qt, starting it again, and opening a window: the new file should be created as a copy of the GTK3 file, and any manual change of it should be reflected by pcmanfm-qt.

@stefonarch
Copy link
Member

stefonarch commented Aug 16, 2024

You can check that by removing the folder ~/.local/share/libfm-qt/, stopping the process of pcmanfm-qt, and starting it again: the new file should be created as a copy of the GTK3 file, and any manual change of it should be reflected by pcmanfm-qt.

As I said: No new file here that way


stef@archlinux:libfm-qt$ pwd
/home/stef/.local/share/libfm-qt
stef@archlinux:libfm-qt$ ls
terminals.list

bookmarks only appears after changing one.

What about the gtk- filemanager issue? I think that's a showstopper, having different bookmarks in different apps/filedialogs, like gimp or libreoffice.

@tsujan
Copy link
Member Author

tsujan commented Aug 16, 2024

As I said: No new file here that way

That shouldn't be possible if you have a valid, non-empty ~/.config/gtk-3.0/bookmarks and you open a pcmanfm-qt window after stopping its process first.

What about the gtk- filemanager issue?

It isn't an issue but a "fix" (as I mentioned in #1009): A non-GTK app shouldn't affect GTK bookmarks. I remember that someone had complained about it a long time ago.

@tsujan
Copy link
Member Author

tsujan commented Aug 16, 2024

having different bookmarks in different apps

That's why portals exist.

@stefonarch
Copy link
Member

That's why portals exist.

Portal isn't working in libreoffice, gimp, shotwell and every other GTK app I tried, except firefox/thunderbird.

@tsujan
Copy link
Member Author

tsujan commented Aug 16, 2024

Portal isn't working in libreoffice, gimp...

I know. That's not our problem. Only by chance we used a GTK-only setting before this patch: a remnant of the GTK-based pcmanfm. As I said in #1009, even GTK4 seems to use the portal now.

I don't think KDE/GNOME users ever complain about the difference between KDE and GTK bookmarks. They may only complain that this or that GTK/KDE app doesn't use KDE/GTK file dialog inside KDE/GNOME respectively.

@stefonarch
Copy link
Member

stefonarch commented Aug 16, 2024

For me it's a regression, as I can't anymore update bookmarks shown in gtk filedialogs. If xdg-desktop-portal-lxqt would work everywhere ok, but it doesn't.

I don't think KDE/GNOME users ever complain ....

We have that feature of shared bookmarks - why remove it?

@tsujan
Copy link
Member Author

tsujan commented Aug 16, 2024

For me it's a regression...

"Regression" has a definition far from that. This change breaks a "bad habit" ;)

We have that feature of shared bookmarks - why remove it?

For two reasons (already mentioned — they motivated making of the PR):

  1. Previously we changed a config file that wasn't related to us at all (a "bad habit", or even a bug); and
  2. GTK changes in a backward incompatible way (as it has already changed in its version 4) and we have no reason to follow it.

@stefonarch
Copy link
Member

I'm pragmatic: regression is when something worked and after it doesn't anymore.

For 2) Afaik the only GTK4 app which writes to bookmarks file in foreseeable future is nautilus, and it still writes to ~/.config/gtk-3.0/bookmarks.
I would agree to a "regression" if there would be an incompatibility in sight.

@tsujan
Copy link
Member Author

tsujan commented Aug 16, 2024

Not only ~/.config/gtk-3.0/bookmarks isn't ours to change, but also the original code had this problem that it wouldn't create it if the folder ~/.config/gtk-3.0/ didn't exist; instead, it would use the terrible file ~/.gtk-bookmarks.

However I look at it, changing the contents of a GTK3 config file seems like an old mistake. It should be corrected now.

And I don't see any reason to care for apps that want to have their own file dialogs. This is Krita's — check its bookmarks:

krita

@tsujan
Copy link
Member Author

tsujan commented Aug 16, 2024

I imagine ourselves becoming like Wayland devs who talk for months before going forward ;) GNOME devs are at the other extreme and may talk only after the fact.

Let's focus here on whether this PR does its job as intended, i.e., the review. Of course, I won't merge it if you or other members don't agree with the philosophy behind it.

Copy link
Member

@stefonarch stefonarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works as intended. If it's a good idea needs more discussion IMO. We are writing also to other gtk files (after setting a hook) in lxqt-appearance.
An option "share bookmarks with GTK apps"?

@tsujan
Copy link
Member Author

tsujan commented Aug 16, 2024

If it's a good idea needs more discussion IMO.

I won't merge it without a discussion. But to me, it's inevitable; if not now, in future.

An option "share bookmarks with GTK apps"?

An overdoing, IMO. Sooner or later, we should say goodbye to such things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bookmarks config file
2 participants