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

Distinguish between local and non-local files with thumbnails #643

Closed
tsujan opened this issue Mar 3, 2021 · 10 comments · Fixed by #1007
Closed

Distinguish between local and non-local files with thumbnails #643

tsujan opened this issue Mar 3, 2021 · 10 comments · Fixed by #1007

Comments

@tsujan
Copy link
Member

tsujan commented Mar 3, 2021

libfm-qt has an option to make thumbnails only for local files but that option has no effect for now (pcmanfm-qt inherits it in its Preferences dialog).

@stefonarch
Copy link
Member

It works here with samba, showing or not thumbnails on the other PC following setting in PCMan, maybe I miss something.

@tsujan
Copy link
Member Author

tsujan commented Mar 3, 2021

@stefonarch, the code does absolutely nothing.

@tsujan
Copy link
Member Author

tsujan commented Mar 3, 2021

Here, the problem is distinguishing between local and remote files. A native file may be remote (like a file in Google drive, mounted locally by rclone) and a non-native file can be local (like trash:///).

I tested by adding GLib's G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE to libfm-qt (in 2 ways). It worked with trash (= local), smb (= remote) and sftp (= remote) but not with Google drive (should be remote but is considered local) and, probably, similar cases.

There's another GLib's attribute G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW but it's mysterious to me and I didn't find it in the codes of well-known GTK file managers.

@tsujan
Copy link
Member Author

tsujan commented Mar 5, 2021

I think the safest way of giving sense to that option is tolerantly considering "local" as "native". There is a good reason: most external thumbnailers — if not all — only work with native paths and, for example, can't make thumbnails inside trash:/// or recent:/// (while the built-in thumbnailer can). In this way, we'll have a more self-consistent thumbnail handling.

EDIT: Tested it but didn't like it. The above-mentioned reason seems good but, for example, having thumbnails with google drive isn't good.

tsujan added a commit that referenced this issue Aug 10, 2024
The code relies on the attribute `G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE`; whether it's set correctly or not is the responsibility of GLib/GVFS.

Closes #643

NOTE1: To be on the safe side, recompile all apps that are based on libfm-qt — but I didn't :P

NOTE2: I haven't seen an external thumbnailer that works with remote files. So, this is mostly about libfm-qt's internal thumbnailer.
@tsujan
Copy link
Member Author

tsujan commented Aug 10, 2024

After 3 years, I didn't find a way better than using what GLib proposed, namely, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE: #1004. It might be useful later, with other operations that we don't want to do with remote files (nothing for now).

@stefonarch
Copy link
Member

I tested with ftp, looks working. Indeed toggling the option doesn't change anything.

@tsujan
Copy link
Member Author

tsujan commented Aug 11, 2024

toggling the option doesn't change anything.

It isn't supposed to reload anything (if you mean that). Either the view should be reloaded or the directory should be changed after toggling the option.

@stefonarch
Copy link
Member

I meant remote thumbnails were always generated, with or without setting a hook at that option.

@tsujan
Copy link
Member Author

tsujan commented Aug 11, 2024

Oh, you mean before the patch. Yes, remote internal thumbnails were always made.

@tsujan
Copy link
Member Author

tsujan commented Aug 12, 2024

My approach failed (→ #1004 (comment)).

Since most parts of libfm-qt's code are optimized by using asynchronous info queries, a synchronous querying of filesystem info is a bad idea, while enabling of the setting about local-only thumbnails doesn't seem achievable asynchronously.

tsujan added a commit that referenced this issue Aug 13, 2024
The patch does it only by a single info query for the parent directory. So, it shouldn't affect the speed.

Also, the setting about local-only thumbnails is enabled in this way.

Closes #643 and fixes #1006

NOTE: To be on the safe side, recompile libfm-qt based apps — although the LXQt apps don't seem to need that.

REMINDER: Add an option to lximage-qt for local-only thumbnails if this PR is merged.
tsujan added a commit that referenced this issue Sep 2, 2024
The patch does it only by a single info query for the parent directory. So, it shouldn't affect the speed.

Also, the setting about local-only thumbnails is enabled in this way.

Closes #643 and fixes #1006

NOTE: To be on the safe side, recompile libfm-qt based apps — although the LXQt apps don't seem to need that.

REMINDER: Add an option to lximage-qt for local-only thumbnails if this PR is merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants