From f5337096d5681327ceb48491aefc7664a1e87eec Mon Sep 17 00:00:00 2001 From: pagedown Date: Sun, 6 Feb 2022 18:57:40 +0800 Subject: [PATCH] Rename LAUNCH_URL to LAUNCH_URLS --- kitty/child-monitor.c | 10 +++++----- kitty/cocoa_window.m | 2 +- kitty/glfw.c | 2 +- kitty/state.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index 03fd194b0..2e789a314 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -1008,14 +1008,14 @@ typedef struct { static CocoaPendingActionsData cocoa_pending_actions_data = {0}; void -set_cocoa_pending_action(CocoaPendingAction action, const char *wd) { - if (wd) { - if (action == LAUNCH_URL) { +set_cocoa_pending_action(CocoaPendingAction action, const char *data) { + if (data) { + if (action == LAUNCH_URLS) { ensure_space_for(&cocoa_pending_actions_data, open_urls, char*, cocoa_pending_actions_data.open_urls_count + 8, open_urls_capacity, 8, true); - cocoa_pending_actions_data.open_urls[cocoa_pending_actions_data.open_urls_count++] = strdup(wd); + cocoa_pending_actions_data.open_urls[cocoa_pending_actions_data.open_urls_count++] = strdup(data); } else { if (cocoa_pending_actions_data.wd) free(cocoa_pending_actions_data.wd); - cocoa_pending_actions_data.wd = strdup(wd); + cocoa_pending_actions_data.wd = strdup(data); } } cocoa_pending_actions[action] = true; diff --git a/kitty/cocoa_window.m b/kitty/cocoa_window.m index bfe25af42..06f9af129 100644 --- a/kitty/cocoa_window.m +++ b/kitty/cocoa_window.m @@ -527,7 +527,7 @@ cocoa_send_notification(PyObject *self UNUSED, PyObject *args) { for (NSURL *url in urlArray) { NSString *path = [url path]; if ([[NSFileManager defaultManager] fileExistsAtPath:path]) { - set_cocoa_pending_action(LAUNCH_URL, [[[NSURL fileURLWithPath:path] absoluteString] UTF8String]); + set_cocoa_pending_action(LAUNCH_URLS, [[[NSURL fileURLWithPath:path] absoluteString] UTF8String]); } } return YES; diff --git a/kitty/glfw.c b/kitty/glfw.c index 9d92013cf..5e3bfe767 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -456,7 +456,7 @@ static void get_window_dpi(GLFWwindow *w, double *x, double *y); #ifdef __APPLE__ static bool apple_url_open_callback(const char* url) { - set_cocoa_pending_action(LAUNCH_URL, url); + set_cocoa_pending_action(LAUNCH_URLS, url); return true; } diff --git a/kitty/state.h b/kitty/state.h index 910059f48..43dc7c96e 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -298,7 +298,7 @@ typedef enum { NEXT_TAB, PREVIOUS_TAB, DETACH_TAB, - LAUNCH_URL, + LAUNCH_URLS, NEW_WINDOW, CLOSE_WINDOW, RESET_TERMINAL,