3131#include <config.h>
3232#include <string.h>
3333#include <glib/gi18n.h>
34+ #if PYGOBJECT_MAJOR_VERSION > 3 || (PYGOBJECT_MAJOR_VERSION == 3 && PYGOBJECT_MINOR_VERSION > 50 )
35+ #include <girepository/girepository.h>
36+ #else
3437#include <girepository.h>
38+ #endif
3539
3640#include "xed-plugins-engine.h"
3741#include "xed-debug.h"
@@ -66,7 +70,11 @@ xed_plugins_engine_init (XedPluginsEngine *engine)
6670
6771 typelib_dir = g_build_filename (xed_dirs_get_xed_lib_dir (), "girepository-1.0" , NULL );
6872
73+ #if PYGOBJECT_MAJOR_VERSION > 3 || (PYGOBJECT_MAJOR_VERSION == 3 && PYGOBJECT_MINOR_VERSION > 50 )
74+ if (!gi_repository_require_private (gi_repository_dup_default (), typelib_dir , "Xed" , "1.0" , 0 , & error ))
75+ #else
6976 if (!g_irepository_require_private (g_irepository_get_default (), typelib_dir , "Xed" , "1.0" , 0 , & error ))
77+ #endif
7078 {
7179 g_warning ("Could not load Xed repository: %s" , error -> message );
7280 g_error_free (error );
@@ -76,14 +84,22 @@ xed_plugins_engine_init (XedPluginsEngine *engine)
7684 g_free (typelib_dir );
7785
7886 /* This should be moved to libpeas */
87+ #if PYGOBJECT_MAJOR_VERSION > 3 || (PYGOBJECT_MAJOR_VERSION == 3 && PYGOBJECT_MINOR_VERSION > 50 )
88+ if (!gi_repository_require (gi_repository_dup_default (), "Peas" , "1.0" , 0 , & error ))
89+ #else
7990 if (!g_irepository_require (g_irepository_get_default (), "Peas" , "1.0" , 0 , & error ))
91+ #endif
8092 {
8193 g_warning ("Could not load Peas repository: %s" , error -> message );
8294 g_error_free (error );
8395 error = NULL ;
8496 }
8597
98+ #if PYGOBJECT_MAJOR_VERSION > 3 || (PYGOBJECT_MAJOR_VERSION == 3 && PYGOBJECT_MINOR_VERSION > 50 )
99+ if (!gi_repository_require (gi_repository_dup_default (), "PeasGtk" , "1.0" , 0 , & error ))
100+ #else
86101 if (!g_irepository_require (g_irepository_get_default (), "PeasGtk" , "1.0" , 0 , & error ))
102+ #endif
87103 {
88104 g_warning ("Could not load PeasGtk repository: %s" , error -> message );
89105 g_error_free (error );
0 commit comments