[gnome-software] trivial: Do the flatpak management plugin check in one place
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Do the flatpak management plugin check in one place
- Date: Thu, 1 Dec 2016 15:10:14 +0000 (UTC)
commit df4aaae5d5878da8ac5569da9c79bec62b1e2ae5
Author: Richard Hughes <richard hughsie com>
Date: Thu Dec 1 14:39:25 2016 +0000
trivial: Do the flatpak management plugin check in one place
src/plugins/gs-flatpak.c | 30 ------------------------------
src/plugins/gs-plugin-flatpak.c | 7 +++++++
2 files changed, 7 insertions(+), 30 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index 0e99ed1..b87ffb7 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -858,11 +858,6 @@ gs_flatpak_app_install_source (GsFlatpak *self, GsApp *app,
const gchar *branch;
g_autoptr(FlatpakRemote) xremote = NULL;
- /* only process this source if was created for this plugin */
- if (g_strcmp0 (gs_app_get_management_plugin (app),
- gs_plugin_get_name (self->plugin)) != 0)
- return TRUE;
-
/* does the remote already exist and is disabled */
xremote = flatpak_installation_get_remote_by_name (self->installation,
gs_app_get_id (app),
@@ -1834,11 +1829,6 @@ gs_flatpak_refine_app (GsFlatpak *self,
{
g_autoptr(AsProfileTask) ptask = NULL;
- /* only process this app if was created by this plugin */
- if (g_strcmp0 (gs_app_get_management_plugin (app),
- gs_plugin_get_name (self->plugin)) != 0)
- return TRUE;
-
/* profile */
ptask = as_profile_start (gs_plugin_get_profile (self->plugin),
"flatpak::refine{%s}",
@@ -1967,11 +1957,6 @@ gs_flatpak_launch (GsFlatpak *self,
GsApp *runtime;
const gchar *branch = NULL;
- /* only process this app if was created by this plugin */
- if (g_strcmp0 (gs_app_get_management_plugin (app),
- gs_plugin_get_name (self->plugin)) != 0)
- return TRUE;
-
branch = gs_app_get_flatpak_branch (app);
if (branch == NULL)
branch = "master";
@@ -2046,11 +2031,6 @@ gs_flatpak_app_remove (GsFlatpak *self,
GCancellable *cancellable,
GError **error)
{
- /* only process this app if was created by this plugin */
- if (g_strcmp0 (gs_app_get_management_plugin (app),
- gs_plugin_get_name (self->plugin)) != 0)
- return TRUE;
-
/* refine to get basics */
if (!gs_flatpak_refine_app (self, app,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
@@ -2098,11 +2078,6 @@ gs_flatpak_app_install (GsFlatpak *self,
{
g_autoptr(FlatpakInstalledRef) xref = NULL;
- /* only process this app if was created by this plugin */
- if (g_strcmp0 (gs_app_get_management_plugin (app),
- gs_plugin_get_name (self->plugin)) != 0)
- return TRUE;
-
/* ensure we have metadata and state */
if (!gs_flatpak_refine_app (self, app, 0, cancellable,
error))
@@ -2223,11 +2198,6 @@ gs_flatpak_update_app (GsFlatpak *self,
{
g_autoptr(FlatpakInstalledRef) xref = NULL;
- /* only process this app if was created by this plugin */
- if (g_strcmp0 (gs_app_get_management_plugin (app),
- gs_plugin_get_name (self->plugin)) != 0)
- return TRUE;
-
/* install */
gs_app_set_state (app, AS_APP_STATE_INSTALLING);
xref = flatpak_installation_update (self->installation,
diff --git a/src/plugins/gs-plugin-flatpak.c b/src/plugins/gs-plugin-flatpak.c
index 1c35846..9155cee 100644
--- a/src/plugins/gs-plugin-flatpak.c
+++ b/src/plugins/gs-plugin-flatpak.c
@@ -264,6 +264,13 @@ static GsFlatpak *
gs_plugin_flatpak_get_handler (GsPlugin *plugin, GsApp *app)
{
GsPluginData *priv = gs_plugin_get_data (plugin);
+
+ /* only process this app if was created by this plugin */
+ if (g_strcmp0 (gs_app_get_management_plugin (app),
+ gs_plugin_get_name (plugin)) != 0) {
+ return NULL;
+ }
+
for (guint i = 0; i < priv->flatpaks->len; i++) {
GsFlatpak *flatpak = g_ptr_array_index (priv->flatpaks, i);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]