App chooser execution file name change

pull/44/head
parent 9b21e1f09b
commit 176c415d4c

@ -61,15 +61,18 @@ int yon_app_chooser_convert_apps(yon_app_chooser_window *window){
window->apps_convert = NULL; window->apps_convert = NULL;
for (int i=0;i<window->apps_size;i++){ for (int i=0;i<window->apps_size;i++){
if (g_key_file_load_from_file(file,window->apps[i],G_KEY_FILE_KEEP_TRANSLATIONS,NULL)){ if (g_key_file_load_from_file(file,window->apps[i],G_KEY_FILE_KEEP_TRANSLATIONS,NULL)){
char *exec_temp = yon_char_new(window->apps[i]);
free(yon_char_divide(exec_temp,yon_char_find_last(exec_temp,'/')));
struct application *app = new(struct application); struct application *app = new(struct application);
memset(app,0,sizeof(struct application)); memset(app,0,sizeof(struct application));
app->name = g_key_file_get_locale_string(file,"Desktop Entry","Name",setlocale(LC_ALL,NULL),NULL); app->name = g_key_file_get_locale_string(file,"Desktop Entry","Name",setlocale(LC_ALL,NULL),NULL);
app->description = g_key_file_get_locale_string(file,"[Desktop Entry","Comment",setlocale(LC_ALL,NULL),NULL); app->description = g_key_file_get_locale_string(file,"[Desktop Entry","Comment",setlocale(LC_ALL,NULL),NULL);
app->tags = g_key_file_get_string(file,"Desktop Entry","Categories",NULL); app->tags = g_key_file_get_string(file,"Desktop Entry","Categories",NULL);
app->execute = g_key_file_get_string(file,"Desktop Entry","Exec",NULL); app->execute = yon_char_divide_search(exec_temp,".",-1);
app->icon = g_key_file_get_string(file,"Desktop Entry","Icon",NULL); app->icon = g_key_file_get_string(file,"Desktop Entry","Icon",NULL);
app->path = yon_char_new(window->apps[i]); app->path = yon_char_new(window->apps[i]);
yon_dictionary_add_or_create_if_exists_with_data(window->apps_convert,app->name,app); yon_dictionary_add_or_create_if_exists_with_data(window->apps_convert,app->name,app);
free(exec_temp);
} }
} }
if (window->apps_convert) return 1; else return 0; if (window->apps_convert) return 1; else return 0;

Loading…
Cancel
Save