clipboard: Add the useful stuff from reverted commit

This is the parts of dc50e0637f that
should have been committed but were reverted in
b5c62cf86f to unbreak the build.
This commit is contained in:
Benjamin Otte 2017-12-05 05:16:49 +01:00
parent 0d31eb8670
commit 234d34366a
3 changed files with 7 additions and 22 deletions

View File

@ -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

View File

@ -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);
}
}

View File

@ -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)
{