From 0db5bb77645afd24d7805270c663d8bbdec04364 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 5 Jun 2022 15:21:00 +0200 Subject: [PATCH] [clipboard] Moved function to session, to easier testing. --- src/osdep/osdep.c | 3 ++- src/session/session.c | 6 ++++++ src/session/session.h | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/osdep/osdep.c b/src/osdep/osdep.c index 00b886cd9..e6e3d2d98 100644 --- a/src/osdep/osdep.c +++ b/src/osdep/osdep.c @@ -65,6 +65,7 @@ #include "main/select.h" #include "osdep/osdep.h" #include "osdep/signals.h" +#include "session/session.h" #include "terminal/terminal.h" #include "util/conv.h" #include "util/file.h" @@ -443,7 +444,7 @@ void set_clipboard_text(char *data) { #ifdef HAVE_ACCESS - char *f = get_opt_str("ui.clipboard_file", NULL); + char *f = get_ui_clipboard_file(); if (f && *f) { char *filename = expand_tilde(f); diff --git a/src/session/session.c b/src/session/session.c index b6e2f0bae..2de998258 100644 --- a/src/session/session.c +++ b/src/session/session.c @@ -1665,3 +1665,9 @@ set_kbd_repeat_count(struct session *ses, int new_count) return new_count; } + +char * +get_ui_clipboard_file(void) +{ + return get_opt_str("ui.clipboard_file", NULL); +} diff --git a/src/session/session.h b/src/session/session.h index 21106c590..fe223995b 100644 --- a/src/session/session.h +++ b/src/session/session.h @@ -340,6 +340,8 @@ int eat_kbd_repeat_count(struct session *ses); * highlighting and status bar. */ int set_kbd_repeat_count(struct session *ses, int new_count); +char *get_ui_clipboard_file(void); + #ifdef CONFIG_SCRIPTING void maybe_pre_format_html(struct cache_entry *cached, struct session *ses); #endif