From 3ca66d6fb6e7493ec742d90bb64821ca12331eb9 Mon Sep 17 00:00:00 2001 From: JosephMcc Date: Sun, 16 Aug 2020 12:04:56 -0700 Subject: [PATCH] Port to Gtksourceview4 This allows us access to some newer fixes since the older version is no longer being worked on. Fixes: https://github.com/linuxmint/xed/issues/395 --- debian/control | 2 +- meson.build | 4 ++-- xed/meson.build | 4 ++-- xed/xed-searchbar.c | 16 ++++++++-------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/debian/control b/debian/control index 544d0eb..5402b16 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Build-Depends: debhelper (>= 9), libglib2.0-dev, libgspell-1-dev, libgtk-3-dev, - libgtksourceview-3.0-dev, + libgtksourceview-4-dev, libpeas-dev, libxapp-dev, libsm-dev, diff --git a/meson.build b/meson.build index 90e31ff..681be83 100644 --- a/meson.build +++ b/meson.build @@ -29,10 +29,10 @@ glib = dependency('glib-2.0', version: '>= 2.40.0') gthread = dependency('gthread-2.0', version: '>= 2.13.0') gio = dependency('gio-2.0', version: '>= 2.40.0') gtk = dependency('gtk+-3.0', version: '>= 3.19.3') -gtksourceview = dependency('gtksourceview-3.0', version: '>= 3.19.0') +gtksourceview = dependency('gtksourceview-4', version: '>= 4.6') libpeas = dependency('libpeas-1.0', version: '>= 1.12.0') libpeas_gtk = dependency('libpeas-gtk-1.0', version: '>= 1.12.0') -gir_dep = dependency('gobject-introspection-1.0', version: '>= 0.6.7', required: false) +gir_dep = dependency('gobject-introspection-1.0', version: '>= 1.42.0', required: false) gmodule = dependency('gmodule-2.0') xapp = dependency('xapp', version: '>= 1.4.0') X11 = dependency('x11') diff --git a/xed/meson.build b/xed/meson.build index 9fc0f1b..7525bad 100644 --- a/xed/meson.build +++ b/xed/meson.build @@ -173,7 +173,7 @@ gir = gnome.generate_gir( sources: public_headers + libxed_sources + xed_enums + xed_marshal, identifier_prefix: 'Xed', symbol_prefix: 'xed', - includes: ['Gtk-3.0', 'GtkSource-3.0'], + includes: ['Gtk-3.0', 'GtkSource-4'], install: true, install_dir_typelib: join_paths(libdir, 'xed', 'girepository-1.0'), install_dir_gir: join_paths(datadir, 'xed', 'gir-1.0') @@ -186,7 +186,7 @@ pkgconfig.generate( version: meson.project_version(), libraries: libxed, requires: [ - 'gtksourceview-3.0', + 'gtksourceview-4', 'libpeas-1.0', 'libpeas-gtk-1.0' ], diff --git a/xed/xed-searchbar.c b/xed/xed-searchbar.c index f6a8994..7ba9967 100755 --- a/xed/xed-searchbar.c +++ b/xed/xed-searchbar.c @@ -136,7 +136,7 @@ forward_search_finished (GtkSourceSearchContext *search_context, GtkTextIter match_start; GtkTextIter match_end; - found = gtk_source_search_context_forward_finish2 (search_context, result, &match_start, &match_end, NULL, NULL); + found = gtk_source_search_context_forward_finish (search_context, result, &match_start, &match_end, NULL, NULL); buffer = gtk_source_search_context_get_buffer (search_context); if (found) @@ -210,7 +210,7 @@ backward_search_finished (GtkSourceSearchContext *search_context, GtkTextIter match_end; GtkSourceBuffer *buffer; - found = gtk_source_search_context_backward_finish2 (search_context, result, &match_start, &match_end, NULL, NULL); + found = gtk_source_search_context_backward_finish (search_context, result, &match_start, &match_end, NULL, NULL); buffer = gtk_source_search_context_get_buffer (search_context); if (found) @@ -479,12 +479,12 @@ do_replace (XedSearchbar *searchbar) gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), &start, &end); searchbar->priv->search_mode = XED_SEARCH_MODE_REPLACE; - gtk_source_search_context_replace2 (search_context, - &start, - &end, - unescaped_replace_text, - -1, - NULL); + gtk_source_search_context_replace (search_context, + &start, + &end, + unescaped_replace_text, + -1, + NULL); g_free (unescaped_replace_text);