treewide: Port to libpeas-2
Closes #609 Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/746>
This commit is contained in:
committed by
Marge Bot
parent
506a1cfc34
commit
26484766d3
@@ -41,7 +41,7 @@
|
||||
#include "enum-types.h"
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <libpeas/peas.h>
|
||||
#include <libpeas.h>
|
||||
|
||||
#define LIBFEEDBACK_USE_UNSTABLE_API
|
||||
#include <libfeedback.h>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "calls-plugin-manager.h"
|
||||
#include "calls-util.h"
|
||||
|
||||
#include <libpeas/peas.h>
|
||||
#include <libpeas.h>
|
||||
|
||||
/**
|
||||
* SECTION:plugin-manager
|
||||
@@ -217,6 +217,7 @@ calls_plugin_manager_init (CallsPluginManager *self)
|
||||
{
|
||||
g_autofree char *default_plugin_dir_provider = NULL;
|
||||
const char *dir;
|
||||
uint n_plugins;
|
||||
|
||||
self->plugin_engine = peas_engine_new ();
|
||||
|
||||
@@ -228,7 +229,7 @@ calls_plugin_manager_init (CallsPluginManager *self)
|
||||
|
||||
if (g_file_test (plugin_dir_provider, G_FILE_TEST_EXISTS)) {
|
||||
g_debug ("Adding '%s' to plugin search path", plugin_dir_provider);
|
||||
peas_engine_prepend_search_path (self->plugin_engine, plugin_dir_provider, NULL);
|
||||
peas_engine_add_search_path (self->plugin_engine, plugin_dir_provider, NULL);
|
||||
} else {
|
||||
g_warning ("Not adding '%s' to plugin search path, because the directory doesn't exist.\n"
|
||||
"Check if env CALLS_PLUGIN_DIR is set correctly", plugin_dir_provider);
|
||||
@@ -245,8 +246,11 @@ calls_plugin_manager_init (CallsPluginManager *self)
|
||||
|
||||
self->providers = g_list_store_new (CALLS_TYPE_PROVIDER);
|
||||
|
||||
for (const GList *node = peas_engine_get_plugin_list (self->plugin_engine); node; node = node->next) {
|
||||
PeasPluginInfo *info = node->data;
|
||||
n_plugins = g_list_model_get_n_items (G_LIST_MODEL (self->plugin_engine));
|
||||
|
||||
for (uint i = 0; i < n_plugins; i++) {
|
||||
g_autoptr (PeasPluginInfo) info =
|
||||
g_list_model_get_item (G_LIST_MODEL (self->plugin_engine), i);
|
||||
CallsPlugin *plugin = calls_plugin_new (info);
|
||||
|
||||
g_debug ("Created plugin '%s', found in '%s'",
|
||||
|
||||
@@ -67,7 +67,7 @@ calls_plugin_set_property (GObject *object,
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_PLUGIN_INFO:
|
||||
self->info = g_value_get_boxed (value);
|
||||
self->info = g_value_get_object (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -146,7 +146,7 @@ calls_plugin_class_init (CallsPluginClass *klass)
|
||||
* The #PeasPluginInfo containing information about the plugin
|
||||
*/
|
||||
props[PROP_PLUGIN_INFO] =
|
||||
g_param_spec_boxed ("plugin-info",
|
||||
g_param_spec_object ("plugin-info",
|
||||
"",
|
||||
"",
|
||||
PEAS_TYPE_PLUGIN_INFO,
|
||||
@@ -264,7 +264,7 @@ calls_plugin_load (CallsPlugin *self,
|
||||
GError **error)
|
||||
{
|
||||
PeasEngine *peas = peas_engine_get_default ();
|
||||
PeasExtension *extension;
|
||||
GObject *extension;
|
||||
|
||||
g_return_val_if_fail (CALLS_IS_PLUGIN (self), FALSE);
|
||||
|
||||
@@ -384,7 +384,7 @@ calls_plugin_get_description (CallsPlugin *self)
|
||||
}
|
||||
|
||||
|
||||
const char **
|
||||
const char * const *
|
||||
calls_plugin_get_authors (CallsPlugin *self)
|
||||
{
|
||||
g_return_val_if_fail (CALLS_IS_PLUGIN (self), NULL);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "calls-provider.h"
|
||||
|
||||
#include <libpeas/peas.h>
|
||||
#include <libpeas.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -44,7 +44,7 @@ CallsProvider *calls_plugin_get_provider (CallsPlugin *self);
|
||||
const char *calls_plugin_get_module_name (CallsPlugin *self);
|
||||
const char *calls_plugin_get_name (CallsPlugin *self);
|
||||
const char *calls_plugin_get_description (CallsPlugin *self);
|
||||
const char **calls_plugin_get_authors (CallsPlugin *self);
|
||||
const char* const *calls_plugin_get_authors (CallsPlugin *self);
|
||||
const char *calls_plugin_get_copyright (CallsPlugin *self);
|
||||
const char *calls_plugin_get_version (CallsPlugin *self);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "calls-util.h"
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <libpeas/peas.h>
|
||||
#include <libpeas.h>
|
||||
|
||||
/**
|
||||
* SECTION:calls-provider
|
||||
|
||||
@@ -29,11 +29,11 @@ subdir('dbus')
|
||||
src_include = include_directories('.')
|
||||
calls_includes = [ top_include, src_include ]
|
||||
|
||||
calls_deps = [ dependency('gobject-2.0', version: '>= 2.58'),
|
||||
calls_deps = [ dependency('gobject-2.0', version: '>= 2.74'),
|
||||
dependency('gtk4', version: '>= @0@'.format(gtk_version)),
|
||||
dependency('libadwaita-1', version: '>= 1.4'),
|
||||
dependency('libfeedback-0.0'),
|
||||
dependency('libpeas-1.0'),
|
||||
dependency('libpeas-2'),
|
||||
dependency('gom-1.0'),
|
||||
dependency('libebook-contacts-1.2'),
|
||||
dependency('folks'),
|
||||
|
||||
Reference in New Issue
Block a user