mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-02-27 16:54:39 +01:00
CS
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
dcc2e9f736
commit
250c575f44
1 changed files with 17 additions and 17 deletions
34
utils.c
34
utils.c
|
@ -244,26 +244,26 @@ replace_substring(const char* string, const char* old, const char* new)
|
||||||
|
|
||||||
GdkAtom* get_selection(zathura_t* zathura)
|
GdkAtom* get_selection(zathura_t* zathura)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(zathura != NULL, NULL);
|
g_return_val_if_fail(zathura != NULL, NULL);
|
||||||
|
|
||||||
char* value;
|
char* value;
|
||||||
girara_setting_get(zathura->ui.session, "selection-clipboard", &value);
|
girara_setting_get(zathura->ui.session, "selection-clipboard", &value);
|
||||||
|
|
||||||
GdkAtom* selection = g_malloc(sizeof(GdkAtom));
|
GdkAtom* selection = g_malloc(sizeof(GdkAtom));
|
||||||
|
|
||||||
if (strcmp(value, "primary") == 0) {
|
|
||||||
*selection = GDK_SELECTION_PRIMARY;
|
|
||||||
} else if (strcmp(value, "clipboard") == 0) {
|
|
||||||
*selection = GDK_SELECTION_CLIPBOARD;
|
|
||||||
} else {
|
|
||||||
girara_error("Invalid value for the selection-clipboard setting");
|
|
||||||
g_free(value);
|
|
||||||
g_free(selection);
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (strcmp(value, "primary") == 0) {
|
||||||
|
*selection = GDK_SELECTION_PRIMARY;
|
||||||
|
} else if (strcmp(value, "clipboard") == 0) {
|
||||||
|
*selection = GDK_SELECTION_CLIPBOARD;
|
||||||
|
} else {
|
||||||
|
girara_error("Invalid value for the selection-clipboard setting");
|
||||||
g_free(value);
|
g_free(value);
|
||||||
|
g_free(selection);
|
||||||
|
|
||||||
return selection;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_free(value);
|
||||||
|
|
||||||
|
return selection;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue