What sort is the app.info.name returned by the function g_ app_ info_ get_ all_ for_type based on?
The following apps have been installed:
Audacious.
Lollypop.
deepin-music.
file /usr/share/applications/mimeinfo.cache display:
audio/mpeg=org.gnome.lollypop.desktop;org.audacious-media-player.audacious.desktop;deepin-music.desktop;
When I uninstalled Lollypop, then I reinstalled Lollypop, file /usr/share/applications/mimeinfo.cache display:
audio/mpeg=org.gnome.lollypop.desktop;org.audacious-media-player.audacious.desktop;deepin-music.desktop;
Using the following code:
#include <stdio.h>
#include <gio/gio.h>
void findMimeAppList(const char *context){
GList *typeList = g_app_info_get_all_for_type(context);
for (GList *l = typeList; l != NULL; l = l->next){
const char *name = g_app_info_get_name((GAppInfo *)(l->data));
printf("name:%s.\n",name);
}
}
int main(int argc,char **argv) {
findMimeAppList("audio/mpeg");
}
the output is as follows:
name:Audacious.
name:Lollypop.
name:deeping-music.