QML: fix property name mismatch in ImFileDialog#1505
Conversation
Signed-off-by: wallentx <william.allentx@gmail.com>
|
Interesting... any idea why this only affected the ArchLinux-supplied versions of Raspberry Pi Imager and didn't affect the pre-compiled AppImages that we supply? (see e.g. #1502 (comment) ) |
|
There are a few things at play here, so bear with me.. The thing that I'm the most certain ofThis is what my PR addresses, and might be best explained by this: My original PR comment suggesting this being about strictness was incorrect. I don't have a view of your build system, but I pulled the AppImage from the latest release, and was able to determine that it is running $ ./Raspberry_Pi_Imager-v2.0.6-desktop-x86_64.AppImage --appimage-extract
$ strings squashfs-root/usr/lib/libQt6Core.so.6 | grep "Qt 6" | head
Qt 6.9.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 11.4.0)The Arch repo is currently providing The difference in behavior between versions aligns with what they show in their docs. Things I'm less certain aboutI believe prior versions of I’m not a D-Bus expert, but the default policy on EndeavourOS and Arch uses As a result, I was unable to get my native build, the Arch repository package, or the AppImage to use my system’s native file picker. All of them fail with I’d be interested to know whether anyone on another distribution is able to use their system’s native file picker instead of the QML fallback. |
Ah excellent! Thank you so much for your digging on this; "In 6.10, they removed I'll try to find some time next week to test that AppImages built with your suggested fix included still work okay on Raspberry Pi OS (arm64) and Ubuntu (amd64).
Correct, there's more info about that in #1336 (comment) But of course as Raspberry Pi Imager is open-source software, the ArchLinux developers are welcome to maintain a downstream patch that re-enables that functionality in the packages that they provide for their distro. |
|
Good catch, @wallentx - thanks for the submission. As rpi-imager will migrate to 6.10 fairly soon, this is an extremely valuable catch. Critically, it looks safe to use even in our current vendored 6.9 environment. |
That's correct - at least in the current architecture. We observed in internal testing that UDisks2 was completely inoperable in Ubuntu 25.10 - not only did it not prompt, but it threw an auth error back to Imager that presented a UX dead-end. The only viable workaround was to |


Problem: QML-based file dialog fails due to deprecated model role usage
This change addresses issues reported in:
And maybe a few others.
The native XDG Desktop Portal file dialog requires an active user D-Bus session (at least on Arch-based distros). When no session bus is available,
rpi-imagercorrectly falls back to its internal QML-based file picker (ImFileDialog.qml). This fallback path is expected and intentional.However, the fallback file dialog was entirely non-functional due to incorrect use of a Qt model role. As a result, the file list rendered empty and the application emitted repeated QML errors such as:
Root cause
The failure was caused by a property name mismatch between the data model and the QML delegates:FolderListModelexposes a role namedfileUrl~~
https://doc.qt.io/qt-6/qml-qt-labs-folderlistmodel-folderlistmodel.html#detailsThe delegates inImFileDialog.qmldefined a required property namedfileURLBecause the property was marked as ``, this mismatch caused delegate instantiation to fail for every item, resulting in the errors shown above and a completely empty file picker.To be more precise: the
fileURLrole (uppercase) was actually valid in older Qt versions but has been deprecated since Qt 5.15 and appears to have been removed in Qt 6.10.* Qt 6.9 Docs: List both
fileUrlandfileURL (deprecated).* Qt 6.10 Docs: List only
fileUrl.This explains why the AppImage (built with Qt 6.9) still works despite using the old name, while native builds on newer systems (like Arch with Qt 6.10) fail completely. My fix updates the code to use the modern, supported
fileUrlrole, which ensures compatibility with Qt ≥ 5.15 and future Qt versions.Fix
Renamed all occurrences of
fileURLtofileUrlinsrc/qmlcomponents/ImFileDialog.qmlto match the roles provided byFolderListModel.Verification
Built and tested locally. The internal QML file picker now functions correctly when the native file dialog is unavailable.