summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac5
-rw-r--r--pluma/pluma-plugins-engine.c20
-rw-r--r--pluma/pluma.c8
3 files changed, 33 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 7c0fe9fb..ed760538 100644
--- a/configure.ac
+++ b/configure.ac
@@ -195,6 +195,11 @@ GOBJECT_INTROSPECTION_CHECK([0.9.3])
if test "$found_introspection" = "yes"; then
have_introspection=yes
AC_DEFINE([HAVE_INTROSPECTION], [1], [Define to enable GObject Introspection])
+
+ # Check for girepository-2.0 API (moved to glib in version 1.80+)
+ PKG_CHECK_EXISTS([girepository-2.0],
+ [AC_DEFINE([HAVE_GIREPOSITORY_2], [1], [Using girepository-2.0 API])],
+ [])
else
have_introspection=no
fi
diff --git a/pluma/pluma-plugins-engine.c b/pluma/pluma-plugins-engine.c
index cb5e2c43..fd0d28e2 100644
--- a/pluma/pluma-plugins-engine.c
+++ b/pluma/pluma-plugins-engine.c
@@ -36,7 +36,11 @@
#include <string.h>
#include <glib/gi18n.h>
+#ifdef HAVE_GIREPOSITORY_2
+#include <girepository/girepository.h>
+#else
#include <girepository.h>
+#endif
#include "pluma-plugins-engine.h"
#include "pluma-debug.h"
@@ -68,23 +72,39 @@ pluma_plugins_engine_init (PlumaPluginsEngine *engine)
engine->priv->plugin_settings = g_settings_new (PLUMA_SCHEMA_ID);
/* This should be moved to libpeas */
+#ifdef HAVE_GIREPOSITORY_2
+ if (!gi_repository_require (gi_repository_dup_default (),
+ "Peas", "1.0", 0, &error))
+#else
if (!g_irepository_require (g_irepository_get_default (),
"Peas", "1.0", 0, &error))
+#endif
{
g_warning ("Could not load Peas repository: %s", error->message);
g_clear_error (&error);
}
+#ifdef HAVE_GIREPOSITORY_2
+ if (!gi_repository_require (gi_repository_dup_default (),
+ "PeasGtk", "1.0", 0, &error))
+#else
if (!g_irepository_require (g_irepository_get_default (),
"PeasGtk", "1.0", 0, &error))
+#endif
{
g_warning ("Could not load PeasGtk repository: %s", error->message);
g_clear_error (&error);
}
+#ifdef HAVE_GIREPOSITORY_2
+ if (!gi_repository_require_private (gi_repository_dup_default (),
+ LIBDIR "/girepository-1.0",
+ "Pluma", "1.0", 0, &error))
+#else
if (!g_irepository_require_private (g_irepository_get_default (),
LIBDIR "/girepository-1.0",
"Pluma", "1.0", 0, &error))
+#endif
{
g_warning ("Could not load Pluma repository: %s", error->message);
g_clear_error (&error);
diff --git a/pluma/pluma.c b/pluma/pluma.c
index 9a359ddd..b7f5904e 100644
--- a/pluma/pluma.c
+++ b/pluma/pluma.c
@@ -44,8 +44,12 @@
#include <gdk/gdkx.h>
#ifdef HAVE_INTROSPECTION
+#ifdef HAVE_GIREPOSITORY_2
+#include <girepository/girepository.h>
+#else
#include <girepository.h>
#endif
+#endif
#include "pluma-app.h"
#include "pluma-application.h"
@@ -526,8 +530,12 @@ main (int argc, char *argv[])
g_option_context_add_group (context, egg_sm_client_get_option_group ());
#ifdef HAVE_INTROSPECTION
+#ifdef HAVE_GIREPOSITORY_2
+ g_option_context_add_group (context, gi_repository_get_option_group ());
+#else
g_option_context_add_group (context, g_irepository_get_option_group ());
#endif
+#endif
if (!g_option_context_parse (context, &argc, &argv, &error))
{