Skip to content

Fix/sidebar devices and long filenames - #107

Merged
dim-ghub merged 5 commits into
mainfrom
fix/sidebar-devices-and-long-filenames
Oct 23, 2026
Merged

dim-ghub merged 5 commits into
mainfrom
fix/sidebar-devices-and-long-filenames

Conversation

@dim-ghub

Copy link
Copy Markdown
Collaborator

What this changes

Why

How it was verified

A filesystem mounted in several places, like a btrfs root with /home,
/var/tmp and /var/cache subvolumes, was shown at whichever mount point
lsblk happened to list first, so clicking / in the sidebar opened a
different folder after each boot. Prefer / and otherwise the shortest
path, for both the sidebar and the mount-and-open fallback.
Hidden devices were stored by their /dev/sdX path. With more than one
disk the kernel can hand out those names in a different order after a
reboot, so a hidden /boot came back and another device was hidden in its
place. Store the filesystem UUID, or the partition UUID when there is no
filesystem UUID, and only fall back to the /dev path for devices that
have neither. Existing /dev entries are moved to the UUID of the device
at that path the first time the drive list loads.
Grid labels wrap over several lines and asked for Text.ElideMiddle, but
Qt does not support middle eliding on multi-line text and cuts off the
end instead, so long names lost their extension without even showing an
ellipsis. Shorten the base name until the label fits its lines and keep
the extension, as the compact and details views already do.
Compressed tarballs have a two-part extension, so a long backup.tar.gz
was shortened to backup….gz. Treat .tar.<anything> as one extension.
FileNameHelper built its measuring object with
Qt.createComponent("QtQuick.TextMetrics"), which treats the string as a
file URL, so it never loaded and every name fell back to plain end
eliding with the extension cut off. Create a FontMetrics inline instead,
parented to the top-level item so the shared instance outlives the
delegate that first asked for it, and measure through advanceWidth() so
the calling bindings do not depend on what they write and loop.
@dim-ghub
dim-ghub merged commit f22cc38 into main Oct 23, 2026
2 checks passed
@dim-ghub
dim-ghub deleted the fix/sidebar-devices-and-long-filenames branch October 23, 2026 23:41
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.

1 participant