From 64187964d4ef31ae778329ae75ebdbffaf662374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Wed, 6 Jan 2021 18:54:55 +0100 Subject: [PATCH] uris -> files. --- internal/desktop/drop/drop.c | 6 +++--- internal/desktop/drop/drop.go | 8 ++++---- internal/desktop/drop/drop.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/desktop/drop/drop.c b/internal/desktop/drop/drop.c index 0307c40b..457808ac 100644 --- a/internal/desktop/drop/drop.c +++ b/internal/desktop/drop/drop.c @@ -85,9 +85,9 @@ char **uris_make(int size) { return calloc(size + 1, sizeof(char *)); } -void uris_set(char **uris, char *filename, int n) { - GFile *file = g_file_new_for_path(filename); - uris[n] = g_file_get_uri(file); +void uris_set_file(char **uris, char *file, int n) { + GFile *gfile = g_file_new_for_path(file); + uris[n] = g_file_get_uri(gfile); } void uris_free(char **uris, int size) { diff --git a/internal/desktop/drop/drop.go b/internal/desktop/drop/drop.go index 6f7d326b..3bc8b9b3 100644 --- a/internal/desktop/drop/drop.go +++ b/internal/desktop/drop/drop.go @@ -14,16 +14,16 @@ import ( var mu = sync.Mutex{} -func FileDrop(x int, y int, uris []string) { +func DragWindow(files []string) { mu.Lock() defer mu.Unlock() - size := C.int(len(uris)) + size := C.int(len(files)) urisUnsafe := C.uris_make(size); defer C.uris_free(urisUnsafe, size) - for i, uri := range uris { - C.uris_set(urisUnsafe, C.CString(uri), C.int(i)) + for i, file := range files { + C.uris_set_file(urisUnsafe, C.CString(file), C.int(i)) } C.drag_window(urisUnsafe) diff --git a/internal/desktop/drop/drop.h b/internal/desktop/drop/drop.h index df0222dd..6b128f1c 100644 --- a/internal/desktop/drop/drop.h +++ b/internal/desktop/drop/drop.h @@ -25,5 +25,5 @@ static void drag_end( void drag_window(char **uris); char **uris_make(int size); -void uris_set(char **uris, char *filename, int n); +void uris_set_file(char **uris, char *file, int n); void uris_free(char **uris, int size);