Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: GNOME 45 #559

Merged
merged 9 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
name: Flatpak
runs-on: ubuntu-latest
container:
image: ghcr.io/andyholmes/flatter/gnome:44
image: ghcr.io/andyholmes/flatter/gnome:45
options: --privileged
permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ jobs:
needs: [pre-test]
runs-on: ubuntu-latest
container:
image: ghcr.io/andyholmes/flatter/gnome:44
image: ghcr.io/andyholmes/flatter/gnome:45
options: --privileged

steps:
Expand Down
14 changes: 5 additions & 9 deletions build-aux/flatpak/ca.andyholmes.Valent.Devel.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,23 +135,19 @@
"buildsystem" : "meson",
"builddir" : true,
"cleanup" : [
"/bin/*",
"/lib/peas-demo",
"/lib/libpeas-gtk*",
"/share/icons"
"/bin/*"
],
"config-opts" : [
"-Dpython3=true",
"-Dlua51=false",
"-Dpython3=false",
"-Dintrospection=true",
"-Ddemos=false",
"-Dglade_catalog=false",
"-Dwidgetry=false"
"-Dvapi=true"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libpeas.git",
"branch" : "1.36"
"branch" : "main"
}
]
},
Expand Down
29 changes: 14 additions & 15 deletions build-aux/flatpak/ca.andyholmes.Valent.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"app-id" : "ca.andyholmes.Valent",
"runtime" : "org.gnome.Platform",
"runtime-version" : "44",
"runtime-version" : "45",
"sdk" : "org.gnome.Sdk",
"command" : "valent",
"finish-args" : [
Expand Down Expand Up @@ -116,12 +116,14 @@
"-DCMAKE_BUILD_TYPE=Release",
"-DENABLE_DOT_LOCKING=OFF",
"-DENABLE_CANBERRA=OFF",
"-DENABLE_OAUTH2_WEBKITGTK4=OFF",
"-DENABLE_GTK=OFF",
"-DENABLE_GTK4=OFF",
"-DENABLE_GOA=OFF",
"-DENABLE_GOOGLE=OFF",
"-DENABLE_OAUTH2=OFF",
"-DENABLE_VALA_BINDINGS=ON",
"-DENABLE_WEATHER=OFF",
"-DENABLE_OAUTH2_WEBKITGTK4=OFF",
"-DWITH_OPENLDAP=OFF",
"-DWITH_LIBDB=OFF",
"-DENABLE_INTROSPECTION=ON",
Expand All @@ -135,8 +137,8 @@
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/evolution-data-server.git",
"commit" : "fe6cec8149323c292f78a088f3f08b86721e64b8",
"tag" : "3.48.4",
"commit" : "9233378a13d9054afd3c4bdd006393b220575e04",
"tag" : "3.50.0",
"x-checker-data" : {
"type" : "anitya",
"project-id" : 10935,
Expand All @@ -151,29 +153,26 @@
"buildsystem" : "meson",
"builddir" : true,
"cleanup" : [
"/bin/*",
"/lib/peas-demo",
"/lib/libpeas-gtk*",
"/share/icons"
"/bin/*"
],
"config-opts" : [
"-Dpython3=true",
"-Dgjs=false",
"-Dlua51=false",
"-Dpython3=false",
"-Dintrospection=true",
"-Ddemos=false",
"-Dglade_catalog=false",
"-Dwidgetry=false"
"-Dvapi=true"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libpeas.git",
"commit" : "7f245fa5158204621c3469756a951b68a651c4fe",
"tag" : "libpeas-1.36.0",
"commit" : "0733118ae8e7148a1de63616611c7b0fc092eced",
"tag" : "2.0.0",
"x-checker-data" : {
"type" : "anitya",
"project-id" : 6871,
"stable-only" : true,
"tag-template" : "libpeas-$version"
"tag-template" : "$version"
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions doc/sdk/valent.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies = [
"GObject-2.0",
"Gtk-4.0",
"Json-1.0",
"Peas-1.0",
"Peas-2",
"EBook-1.2",
]
devhelp = true
Expand All @@ -37,7 +37,7 @@ search_index = true
description = "A library for reading and parsing JSON"
docs_url = "https://gnome.pages.gitlab.gnome.org/json-glib/"

[dependencies."Peas-1.0"]
[dependencies."Peas-2"]
name = "Peas"
description = "A GObject-based plugin engine"
docs_url = "https://gnome.pages.gitlab.gnome.org/libpeas/libpeas-1.0/"
Expand Down
6 changes: 3 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,18 @@ glib_version = '>= 2.76.0'
gtk_version = '>= 4.10.0'
gnutls_version = '>= 3.1.3'
json_glib_version = '>= 1.6.0'
libpeas_version = '>= 1.22.0'
libpeas_version = '>= 2.0.0'
eds_version = '>= 3.34'
sqlite_version = '>= 3.24.0'
libadwaita_version = '>= 1.2.0'
libadwaita_version = '>= 1.4'
libportal_version = ['>= 0.6', '<= 0.7.1']

libm_dep = cc.find_library('m', required: true)
gio_dep = dependency('gio-2.0', version: glib_version)
gio_unix_dep = dependency('gio-unix-2.0', version: glib_version)
gnutls_dep = dependency('gnutls', version: gnutls_version)
json_glib_dep = dependency('json-glib-1.0', version: json_glib_version)
libpeas_dep = dependency('libpeas-1.0', version: libpeas_version)
libpeas_dep = dependency('libpeas-2', version: libpeas_version)
sqlite_dep = dependency('sqlite3', version: sqlite_version)

libportal_dep = dependency('libportal-gtk4',
Expand Down
2 changes: 1 addition & 1 deletion src/libvalent/clipboard/valent-clipboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "config.h"

#include <gio/gio.h>
#include <libpeas/peas.h>
#include <libpeas.h>
#include <libvalent-core.h>

#include "valent-clipboard.h"
Expand Down
2 changes: 1 addition & 1 deletion src/libvalent/contacts/valent-contacts.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "config.h"

#include <gio/gio.h>
#include <libpeas/peas.h>
#include <libpeas.h>
#include <libvalent-core.h>

#include "valent-contacts.h"
Expand Down
14 changes: 9 additions & 5 deletions src/libvalent/core/valent-application.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,18 +307,22 @@ valent_application_constructed (GObject *object)
{
ValentApplication *self = VALENT_APPLICATION (object);
PeasEngine *engine = NULL;
const GList *plugins = NULL;
unsigned int n_plugins = 0;

self->plugins = g_hash_table_new_full (NULL, NULL, NULL, valent_plugin_free);
self->plugins_context = valent_context_new (NULL, "application", NULL);

engine = valent_get_plugin_engine ();
plugins = peas_engine_get_plugin_list (engine);
n_plugins = g_list_model_get_n_items (G_LIST_MODEL (engine));

for (const GList *iter = plugins; iter; iter = iter->next)
for (unsigned int i = 0; i < n_plugins; i++)
{
if (peas_plugin_info_is_loaded (iter->data))
on_load_plugin (engine, iter->data, self);
g_autoptr (PeasPluginInfo) info = NULL;

info = g_list_model_get_item (G_LIST_MODEL (engine), i);

if (peas_plugin_info_is_loaded (info))
on_load_plugin (engine, info, self);
}

g_signal_connect_object (engine,
Expand Down
4 changes: 2 additions & 2 deletions src/libvalent/core/valent-component-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ valent_plugin_new (gpointer parent,

plugin = g_new0 (ValentPlugin, 1);
plugin->parent = parent;
plugin->info = info;
plugin->info = g_object_ref (info);
plugin->context = valent_context_get_plugin_context (parent_context, info);
plugin->settings = valent_context_create_settings (plugin->context,
VALENT_PLUGIN_SCHEMA);
Expand Down Expand Up @@ -108,7 +108,7 @@ valent_plugin_free (gpointer data)
g_signal_handlers_disconnect_by_data (plugin->settings, plugin);

plugin->parent = NULL;
plugin->info = NULL;
g_clear_object (&plugin->info);
g_clear_object (&plugin->cancellable);
g_clear_object (&plugin->context);
g_clear_object (&plugin->extension);
Expand Down
16 changes: 10 additions & 6 deletions src/libvalent/core/valent-component.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "config.h"

#include <gio/gio.h>
#include <libpeas/peas.h>
#include <libpeas.h>

#include "valent-component.h"
#include "valent-component-private.h"
Expand Down Expand Up @@ -420,7 +420,7 @@ valent_component_constructed (GObject *object)
{
ValentComponent *self = VALENT_COMPONENT (object);
ValentComponentPrivate *priv = valent_component_get_instance_private (self);
const GList *plugins = NULL;
unsigned int n_plugins = 0;

g_assert (priv->plugin_domain != NULL);
g_assert (priv->plugin_type != G_TYPE_NONE);
Expand All @@ -439,12 +439,16 @@ valent_component_constructed (GObject *object)
}

/* Setup PeasEngine */
plugins = peas_engine_get_plugin_list (priv->engine);
n_plugins = g_list_model_get_n_items (G_LIST_MODEL (priv->engine));

for (const GList *iter = plugins; iter; iter = iter->next)
for (unsigned int i = 0; i < n_plugins; i++)
{
if (peas_plugin_info_is_loaded (iter->data))
on_load_plugin (priv->engine, iter->data, self);
g_autoptr (PeasPluginInfo) info = NULL;

info = g_list_model_get_item (G_LIST_MODEL (priv->engine), i);

if (peas_plugin_info_is_loaded (info))
on_load_plugin (priv->engine, info, self);
}

g_signal_connect_object (priv->engine,
Expand Down
2 changes: 1 addition & 1 deletion src/libvalent/core/valent-component.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#endif

#include <gio/gio.h>
#include <libpeas/peas.h>
#include <libpeas.h>

#include "valent-object.h"

Expand Down
2 changes: 1 addition & 1 deletion src/libvalent/core/valent-context.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "config.h"

#include <gio/gio.h>
#include <libpeas/peas.h>
#include <libpeas.h>

#include "valent-context.h"
#include "valent-debug.h"
Expand Down
2 changes: 1 addition & 1 deletion src/libvalent/core/valent-context.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# error "Only <valent.h> can be included directly."
#endif

#include <libpeas/peas.h>
#include <libpeas.h>

#include "valent-object.h"

Expand Down
21 changes: 11 additions & 10 deletions src/libvalent/core/valent-extension.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "config.h"

#include <gio/gio.h>
#include <libpeas/peas.h>
#include <libpeas.h>

#include "valent-context.h"
#include "valent-core-enums.h"
Expand Down Expand Up @@ -353,6 +353,7 @@ valent_extension_finalize (GObject *object)
g_clear_error (&priv->plugin_error);
g_clear_pointer (&priv->actions, g_hash_table_unref);
g_clear_object (&priv->context);
g_clear_object (&priv->plugin_info);
g_clear_object (&priv->settings);

G_OBJECT_CLASS (valent_extension_parent_class)->finalize (object);
Expand All @@ -378,7 +379,7 @@ valent_extension_get_property (GObject *object,
break;

case PROP_PLUGIN_INFO:
g_value_set_boxed (value, priv->plugin_info);
g_value_set_object (value, priv->plugin_info);
break;

case PROP_PLUGIN_STATE:
Expand Down Expand Up @@ -414,7 +415,7 @@ valent_extension_set_property (GObject *object,
break;

case PROP_PLUGIN_INFO:
priv->plugin_info = g_value_get_boxed (value);
priv->plugin_info = g_value_dup_object (value);
break;

default:
Expand Down Expand Up @@ -467,17 +468,17 @@ valent_extension_class_init (ValentExtensionClass *klass)
/**
* ValentExtension:plugin-info:
*
* The [struct@Peas.PluginInfo] describing this plugin.
* The [class@Peas.PluginInfo] describing this plugin.
*
* Since: 1.0
*/
properties [PROP_PLUGIN_INFO] =
g_param_spec_boxed ("plugin-info", NULL, NULL,
PEAS_TYPE_PLUGIN_INFO,
(G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_EXPLICIT_NOTIFY |
G_PARAM_STATIC_STRINGS));
g_param_spec_object ("plugin-info", NULL, NULL,
PEAS_TYPE_PLUGIN_INFO,
(G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_EXPLICIT_NOTIFY |
G_PARAM_STATIC_STRINGS));

/**
* ValentExtension:plugin-state:
Expand Down
Loading