pull/59/head
parent bcad7a0944
commit 1f98c56a55

@ -17,7 +17,11 @@ void yon_app_free(apps *target){
int yon_app_set_from_file(apps *target, const char *path){
GKeyFile *cur_file = g_key_file_new();
if (!g_key_file_load_from_file(cur_file,path,G_KEY_FILE_KEEP_TRANSLATIONS,NULL)) return 0;
GError *err = NULL;
if (!g_key_file_load_from_file(cur_file,path,G_KEY_FILE_KEEP_TRANSLATIONS,&err)) {
printf("%s\n",err->message);
return 0;
}
target->Name = g_key_file_get_locale_string(cur_file,"Desktop Entry","Name",NULL,NULL);
target->Desktop_path = yon_char_new(path);
@ -64,8 +68,9 @@ void yon_apps_init(){
if (!strstr(paths[i],".desktop")) continue;
char *cur_path = yon_char_unite(DesktopPath,"/",paths[i],NULL);
apps *cur_app = yon_app_new();
yon_app_set_from_file(cur_app,cur_path);
g_hash_table_insert(_apps,yon_char_new(cur_app->Desktop_path),cur_app);
if (yon_app_set_from_file(cur_app,cur_path)){
g_hash_table_insert(_apps,yon_char_new(cur_app->Desktop_path),cur_app);
}
}
}

Loading…
Cancel
Save