Only one desktop entry with a given ID will show up in drun mode

This commit is contained in:
Scoopta 2019-10-19 20:23:23 -07:00
parent 44a8e79fd7
commit 9e96c9ee6a

View File

@ -48,6 +48,7 @@ static char* get_text(char* file) {
void drun_init() { void drun_init() {
struct map* cached = map_init(); struct map* cached = map_init();
struct map* entries = map_init();
struct wl_list* cache = wofi_read_cache("drun"); struct wl_list* cache = wofi_read_cache("drun");
struct cache_line* node, *tmp; struct cache_line* node, *tmp;
@ -104,6 +105,10 @@ void drun_init() {
free(full_path); free(full_path);
continue; continue;
} }
if(map_contains(entries, entry->d_name)) {
continue;
}
map_put(entries, entry->d_name, "true");
wofi_insert_widget(text, full_path); wofi_insert_widget(text, full_path);
free(text); free(text);
free(full_path); free(full_path);
@ -115,6 +120,7 @@ void drun_init() {
} }
free(original_dirs); free(original_dirs);
map_free(cached); map_free(cached);
map_free(entries);
} }
static void launch_done(GObject* obj, GAsyncResult* result, gpointer data) { static void launch_done(GObject* obj, GAsyncResult* result, gpointer data) {