[gnome-software/wip/async-plugin-repo-funcs: 5/29] gs-repo-row: Change how checks whether plugin supports repository operation
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/async-plugin-repo-funcs: 5/29] gs-repo-row: Change how checks whether plugin supports repository operation
- Date: Tue, 28 Jun 2022 15:44:23 +0000 (UTC)
commit 6b34bb6335c19153a11084a4426c80cf1019d5e3
Author: Milan Crha <mcrha redhat com>
Date: Tue Jun 14 15:20:20 2022 +0200
gs-repo-row: Change how checks whether plugin supports repository operation
Use the async methods existence to check whether plugin supports
certain repository operation, instead of using the obsolete plugin
actions, which require function definitions.
src/gs-repo-row.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/gs-repo-row.c b/src/gs-repo-row.c
index 9f871eb04..0a3a3b9cb 100644
--- a/src/gs-repo-row.c
+++ b/src/gs-repo-row.c
@@ -207,10 +207,16 @@ gs_repo_row_set_repo (GsRepoRow *self, GsApp *repo)
self, 0);
plugin = gs_app_dup_management_plugin (repo);
- priv->supports_remove = plugin != NULL && gs_plugin_get_action_supported (plugin,
GS_PLUGIN_ACTION_REMOVE_REPO);
- priv->supports_enable_disable = plugin != NULL &&
- gs_plugin_get_action_supported (plugin, GS_PLUGIN_ACTION_ENABLE_REPO) &&
- gs_plugin_get_action_supported (plugin, GS_PLUGIN_ACTION_DISABLE_REPO);
+ if (plugin) {
+ GsPluginClass *plugin_class = GS_PLUGIN_GET_CLASS (plugin);
+ priv->supports_remove = plugin_class != NULL && plugin_class->remove_repository_async != NULL;
+ priv->supports_enable_disable = plugin_class != NULL &&
+ plugin_class->enable_repository_async != NULL &&
+ plugin_class->disable_repository_async != NULL;
+ } else {
+ priv->supports_remove = FALSE;
+ priv->supports_enable_disable = FALSE;
+ }
gtk_label_set_label (GTK_LABEL (priv->name_label), gs_app_get_name (repo));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]