hughsie / appstream-glib

This library provides objects and helper methods to help reading and writing AppStream metadata.
GNU Lesser General Public License v2.1
65 stars 103 forks source link

generated appdata doesn't contain an icon when id doesn't contain .desktop suffix #463

Open ilya-fedin opened 2 years ago

ilya-fedin commented 2 years ago

It seems #209 is still present, at least with some app ids. We're encountering it at https://github.com/flathub/org.telegram.desktop. We sadly can't use <launchable> tag as it's just not known at build time what the desktop id will be as both snap and flatpak rename .desktop and .metainfo.xml files according to their rules. It seems the specification doesn't define how exactly the desktop id should be discovered, could it ignore the <id> tag and use the app_name?

Like

        if (launchable != NULL) {
            desktop_basename = g_string_new (as_launchable_get_value (launchable));
        } else {
            desktop_basename = g_strconcat (app_name, ".desktop", NULL);
        }

It would also be ok if the g_str_has_suffix check is just removed I guess, I just don't see how to make both flatpak and snap happy otherwise...