[gtk+] clipboard: Add the useful stuff from reverted commit
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] clipboard: Add the useful stuff from reverted commit
- Date: Sun, 10 Dec 2017 00:59:50 +0000 (UTC)
commit 234d34366af481735636ff383dde9673d4dcd968
Author: Benjamin Otte <otte redhat com>
Date: Tue Dec 5 05:16:49 2017 +0100
clipboard: Add the useful stuff from reverted commit
This is the parts of dc50e0637ffa8bc7a369d00a5d8e7656d03c3781 that
should have been committed but were reverted in
b5c62cf86fe37e05ce2a0ae050df2a229457676b to unbreak the build.
docs/reference/gdk/gdk4-sections.txt | 3 +++
gtk/gtkfilechooserwidget.c | 13 ++-----------
gtk/gtktextbuffer.c | 13 ++-----------
3 files changed, 7 insertions(+), 22 deletions(-)
---
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index d167c2b..cdc3b88 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -1306,6 +1306,9 @@ gdk_clipboard_read_texture_finish
gdk_clipboard_read_text_async
gdk_clipboard_read_text_finish
gdk_clipboard_set_content
+gdk_clipboard_set
+gdk_clipboard_set_valist
+gdk_clipboard_set_value
gdk_clipboard_set_text
gdk_clipboard_set_texture
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 1d99534..dd75977 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -1668,19 +1668,10 @@ copy_file_location_cb (GSimpleAction *action,
if (selected_files)
{
GdkClipboard *clipboard;
- GdkContentProvider *provider;
- GValue value = G_VALUE_INIT;
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (impl));
-
- g_value_init (&value, GDK_TYPE_FILE_LIST);
- g_value_take_boxed (&value, selected_files);
-
- provider = gdk_content_provider_new_for_value (&value);
- g_value_unset (&value);
-
- gdk_clipboard_set_content (clipboard, provider);
- g_object_unref (provider);
+ gdk_clipboard_set (clipboard, GDK_TYPE_FILE_LIST, selected_files);
+ g_slist_free_full (selected_files, g_object_unref);
}
}
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c
index b7d1805..1dba4c4 100644
--- a/gtk/gtktextbuffer.c
+++ b/gtk/gtktextbuffer.c
@@ -3927,19 +3927,10 @@ cut_or_copy (GtkTextBuffer *buffer,
if (!gtk_text_iter_equal (&start, &end))
{
GtkTextBuffer *contents;
- GdkContentProvider *provider;
- GValue value = G_VALUE_INIT;
contents = create_clipboard_contents_buffer (buffer, &start, &end);
-
- g_value_init (&value, GTK_TYPE_TEXT_BUFFER);
- g_value_take_object (&value, contents);
-
- provider = gdk_content_provider_new_for_value (&value);
- g_value_unset (&value);
-
- gdk_clipboard_set_content (clipboard, provider);
- g_object_unref (provider);
+ gdk_clipboard_set (clipboard, GTK_TYPE_TEXT_BUFFER, contents);
+ g_object_unref (contents);
if (delete_region_after)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]