From 1f98c56a551216b6676a0128beda0e118f9ae29e Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Thu, 27 Nov 2025 17:58:40 +0600 Subject: [PATCH] Fixes --- source/libublsettings-gtk3-apps.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/libublsettings-gtk3-apps.c b/source/libublsettings-gtk3-apps.c index d3e7482..6b07e27 100644 --- a/source/libublsettings-gtk3-apps.c +++ b/source/libublsettings-gtk3-apps.c @@ -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); + } } }