SUMMARY Flatpak KCM can not find a bunch of icons for the apps, in particular: Telegram Desktop, LocalSend, LibreOffice, Kdenlive and Shotcut. The `FlatpakHelper::iconSourceUrl` algorithm[1] goes an extra mile only to fail to locate the proper icons which were specified in the exported desktop entries the whole time! Take a look at **LocalSend** for example: ``` $ cd /var/lib/flatpak/app/org.localsend.localsend_app/x86_64/stable/306064fe957c0bc287c6353de49295eb5302335bcecd527f08e8a73f249e454a $ tree export export ├── bin │ └── org.localsend.localsend_app └── share ├── applications │ └── org.localsend.localsend_app.desktop ├── icons │ └── hicolor │ ├── 32x32 │ │ └── apps │ │ └── org.localsend.localsend_app-tray.png │ └── 512x512 │ └── apps │ └── org.localsend.localsend_app.png └── metainfo └── org.localsend.localsend_app.metainfo.xml $ cat export/share/applications/org.localsend.localsend_app.desktop [Desktop Entry] [...] Name=LocalSend Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=localsend --file-forwarding org.localsend.localsend_app @@u %U @@ Icon=org.localsend.localsend_app X-Flatpak=org.localsend.localsend_app ``` the algorithm has no idea about "512x512" directory, it just take some random `nextDir = dir.entryList().at(0);` which on my machine consistently ends up being "32x32" — the one which contains tray icon instead of the app icon. Let's take **Shotcut** for example. Things are even funnier there: for some reason it provides exported *scalable* icons of Glaxnimate: ``` files/share/icons └── hicolor ├── 128x128 │ └── apps │ └── org.shotcut.Shotcut.png ├── 512x512 │ └── apps │ ├── glaxnimate.png │ └── org.mattbas.Glaxnimate.png ├── 64x64 │ └── apps │ └── org.shotcut.Shotcut.png └── scalable └── apps ├── glaxnimate.svg └── org.mattbas.Glaxnimate.svg ``` So the algorithm falls for `if (dir.exists(QStringLiteral("scalable")))` despite the Shotcut icon not being there. **Telegram** exports Icon=org.telegram.desktop, but provides a symbolic version with a "-symbolic" suffix which hides it from the algorithm while masking other directories than "hicolor/symbolic". **Kdenlive** provides its scalable icon with *.svgz extension which the algorithm doesn't account for. And finally, **LibreOffice** isn't exactly a single app: it is a bundle of apps, with a central .desktop launcher named simply org.libreoffice.LibreOffice.desktop; however its Icon= is not as simple — it has a suffix which algorithm has no idea about: "org.libreoffice.LibreOffice.startcenter.png". STEPS TO REPRODUCE 1. Install some flatpak apps, including the aforementioned ones. 2. Add some debug logs to the iconSourceUrl function. 3. Open Flatpak KCM OBSERVED RESULT Some apps are missing their icons, replaced with a generic one instead. EXPECTED RESULT Reuse the wheel instead of reinventing it. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 6.3.3 KDE Frameworks Version: 6.11.0 Qt Version: 6.8.2 Kernel Version: 6.13.6-arch1-1 (64-bit) Graphics Platform: X11 ADDITIONAL INFORMATION [1] The `FlatpakHelper::iconSourceUrl` algorithm: ``` QUrl iconSourceUrl(const QString &displayName, const QString &flatpakName, const QString &appBaseDirectory) { QString dirPath = appBaseDirectory + QStringLiteral("/files/share/icons/hicolor/"); QDir dir(dirPath); dir.setFilter(QDir::NoDotAndDotDot | QDir::AllDirs); QString nextDir; if (dir.exists(QStringLiteral("scalable"))) { nextDir = QStringLiteral("scalable"); } else if (dir.exists(QStringLiteral("symbolic"))) { nextDir = QStringLiteral("symbolic"); } else if (!dir.isEmpty()) { nextDir = dir.entryList().at(0); } else { return QUrl(); } dir.cd(nextDir + QStringLiteral("/apps")); QString file = flatpakName + QStringLiteral(".png"); if (!dir.exists(file)) { file = flatpakName + QStringLiteral(".svg"); if (!dir.exists(file)) { file = displayName.toLower() + QStringLiteral(".png"); if (!dir.exists(file)) { file = displayName.toLower() + QStringLiteral(".svg"); if (!dir.exists(file)) { return QUrl(); } } } } return QUrl::fromLocalFile(dir.absoluteFilePath(file)); } ```
That's true; I can reproduce it.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/flatpak-kcm/-/merge_requests/156
Git commit 804fab2688c2c8e53cb00995f7d3b3ec6e9c6635 by Akseli Lahtinen. Committed on 18/09/2025 at 09:26. Pushed by akselmo into branch 'master'. FlatpakPermissions: Use the icon from Permissions Permissions.qml already searches for the correct icon, so instead of searching for an icon again, just reuse that one. M +2 -0 CMakeLists.txt M +23 -12 appsmodel.cpp M +2 -0 appsmodel.h M +13 -13 autotests/flatpakpermissiontest.cpp M +1 -34 flatpakhelper.cpp M +0 -2 flatpakhelper.h M +1 -9 flatpakreference.cpp M +0 -5 flatpakreference.h M +4 -2 kcm.cpp M +2 -2 ui/FlatpakPermissions.qml M +2 -1 ui/Permissions.qml M +1 -1 ui/main.qml https://invent.kde.org/plasma/flatpak-kcm/-/commit/804fab2688c2c8e53cb00995f7d3b3ec6e9c6635