static void collect_manager_refresh(void) { GList *list = NULL; GList *work; gchar *base; base = g_strconcat(homedir(), "/", GQVIEW_RC_DIR_COLLECTIONS, NULL); path_list(base, &list, NULL); g_free(base); work = collection_manager_entry_list; while (work && list) { CollectManagerEntry *entry; GList *list_step; entry = work->data; work = work->next; list_step = list; while (list_step && entry) { gchar *path; path = list_step->data; list_step = list_step->next; if (strcmp(path, entry->path) == 0) { list = g_list_remove(list, path); g_free(path); entry = NULL; } else { collect_manager_entry_free(entry); } } } work = list; while (work) { gchar *path; path = work->data; work = work->next; collect_manager_entry_new(path); g_free(path); } g_list_free(list); }
static void collect_manager_refresh(void) { GList *list; GList *work; FileData *dir_fd; dir_fd = file_data_new_simple(get_collections_dir()); filelist_read(dir_fd, &list, NULL); file_data_unref(dir_fd); work = collection_manager_entry_list; while (work && list) { CollectManagerEntry *entry; GList *list_step; entry = work->data; work = work->next; list_step = list; while (list_step && entry) { FileData *fd; fd = list_step->data; list_step = list_step->next; if (strcmp(fd->path, entry->path) == 0) { list = g_list_remove(list, fd); file_data_unref(fd); entry = NULL; } else { collect_manager_entry_free(entry); } } } work = list; while (work) { FileData *fd; fd = work->data; work = work->next; collect_manager_entry_new(fd->path); } filelist_free(list); }