Repository navigation
Conversation
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.
…names Fix sidebar device bugs and long file names hiding the extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
/, or else the shortest path. Fixes device path changing between reboot #97./dev/sdX, so they stay hidden when disk names swap after a reboot. Existing settings are migrated. Fixes Devices randomly changing #94..tar.gzand similar) in the grid, compact and details views.Why
lsblklisted first, and that order isn't fixed./dev/sdXnames aren't stable across boots.How it was verified
drivemanager.cppagainst a fakelsblkthat simulates two disks swapping names. Both bugs reproduced before the fix and are gone after.