[gnome-software] Remove some more dead code



commit b315bc127803aa3c4db4095b4cf26d3c9758c7fc
Author: Richard Hughes <richard hughsie com>
Date:   Thu Mar 24 09:46:59 2016 +0000

    Remove some more dead code

 src/plugins/gs-plugin-epiphany.c |    2 --
 src/plugins/gs-plugin-fwupd.c    |    8 --------
 src/plugins/gs-plugin-limba.c    |   16 ++--------------
 src/plugins/gs-plugin-xdg-app.c  |    8 --------
 src/plugins/packagekit-common.c  |    2 +-
 5 files changed, 3 insertions(+), 33 deletions(-)
---
diff --git a/src/plugins/gs-plugin-epiphany.c b/src/plugins/gs-plugin-epiphany.c
index 74bcacd..d3ad55c 100644
--- a/src/plugins/gs-plugin-epiphany.c
+++ b/src/plugins/gs-plugin-epiphany.c
@@ -234,8 +234,6 @@ gs_plugin_app_remove (GsPlugin *plugin, GsApp *app,
        g_autoptr(GFile) file_app = NULL;
 
        /* only process this app if was created by this plugin */
-       if (g_strcmp0 (gs_app_get_management_plugin (app), "epiphany") != 0)
-               return TRUE;
        epi_desktop = gs_app_get_source_id_default (app);
        if (epi_desktop == NULL)
                return TRUE;
diff --git a/src/plugins/gs-plugin-fwupd.c b/src/plugins/gs-plugin-fwupd.c
index 11ec1f2..69d4ba5 100644
--- a/src/plugins/gs-plugin-fwupd.c
+++ b/src/plugins/gs-plugin-fwupd.c
@@ -647,10 +647,6 @@ gs_plugin_app_upgrade (GsPlugin *plugin,
        const gchar *device_id;
        const gchar *filename;
 
-       /* only process this app if was created by this plugin */
-       if (g_strcmp0 (gs_app_get_management_plugin (app), "fwupd") != 0)
-               return TRUE;
-
        filename = gs_app_get_source_id_default (app);
        device_id = gs_app_get_metadata_item (app, "fwupd::DeviceID");
        if (filename == NULL || device_id == NULL) {
@@ -702,10 +698,6 @@ gs_plugin_fwupd_install (GsPlugin *plugin,
        const gchar *filename;
        FwupdInstallFlags install_flags = 0;
 
-       /* only process this app if was created by this plugin */
-       if (g_strcmp0 (gs_app_get_management_plugin (app), "fwupd") != 0)
-               return TRUE;
-
        filename = gs_app_get_source_id_default (app);
        if (filename == NULL) {
                g_set_error (error,
diff --git a/src/plugins/gs-plugin-limba.c b/src/plugins/gs-plugin-limba.c
index 8cc4994..449e971 100644
--- a/src/plugins/gs-plugin-limba.c
+++ b/src/plugins/gs-plugin-limba.c
@@ -78,7 +78,7 @@ gs_plugin_refine_app (GsPlugin *plugin,
        g_autoptr(GError) error_local = NULL;
 
        /* not us */
-       if (g_strcmp0 (gs_app_get_management_plugin (app), "Limba") != 0)
+       if (g_strcmp0 (gs_app_get_management_plugin (app), "limba") != 0)
                return TRUE;
 
        ptask = as_profile_start_literal (plugin->profile, "limba::refine");
@@ -170,10 +170,6 @@ gs_plugin_app_remove (GsPlugin *plugin,
        GsPluginHelper helper;
        g_autoptr(GError) error_local = NULL;
 
-       /* not us */
-       if (g_strcmp0 (gs_app_get_management_plugin (app), "Limba") != 0)
-               return TRUE;
-
        mgr = li_manager_new ();
 
        /* set up progress forwarding */
@@ -216,10 +212,6 @@ gs_plugin_app_install (GsPlugin *plugin,
        GsPluginHelper helper;
        g_autoptr(GError) error_local = NULL;
 
-       /* not us */
-       if (g_strcmp0 (gs_app_get_management_plugin (app), "Limba") != 0)
-               return TRUE;
-
        /* create new installer and select remote package */
        inst = li_installer_new ();
        li_installer_open_remote (inst,
@@ -351,7 +343,7 @@ gs_plugin_add_updates (GsPlugin *plugin,
                        app = gs_app_new (li_pkg_info_get_name (old_pki));
                }
 
-               gs_app_set_management_plugin (app, "Limba");
+               gs_app_set_management_plugin (app, "limba");
                gs_app_set_state (app, AS_APP_STATE_UPDATABLE_LIVE);
                gs_app_set_kind (app, AS_APP_KIND_GENERIC);
                gs_plugin_add_app (list, app);
@@ -389,10 +381,6 @@ gs_plugin_app_update (GsPlugin *plugin,
        LiUpdateItem *uitem;
        g_autoptr(GError) error_local = NULL;
 
-       /* check if this update request is for us */
-       if (g_strcmp0 (gs_app_get_management_plugin (app), "Limba") != 0)
-               return TRUE;
-
        /* sanity check */
        if (gs_app_get_source_default (app) == NULL) {
                g_set_error (error,
diff --git a/src/plugins/gs-plugin-xdg-app.c b/src/plugins/gs-plugin-xdg-app.c
index 5c5d729..898785e 100644
--- a/src/plugins/gs-plugin-xdg-app.c
+++ b/src/plugins/gs-plugin-xdg-app.c
@@ -1226,10 +1226,6 @@ gs_plugin_app_remove (GsPlugin *plugin,
 {
        GsPluginHelper helper;
 
-       /* only process this app if was created by this plugin */
-       if (g_strcmp0 (gs_app_get_management_plugin (app), "xdg-app") != 0)
-               return TRUE;
-
        /* ensure we can set up the repo */
        if (!gs_plugin_ensure_installation (plugin, cancellable, error))
                return FALSE;
@@ -1261,10 +1257,6 @@ gs_plugin_app_install (GsPlugin *plugin,
        GsPluginHelper helper;
        g_autoptr(XdgAppInstalledRef) xref = NULL;
 
-       /* only process this app if was created by this plugin */
-       if (g_strcmp0 (gs_app_get_management_plugin (app), "xdg-app") != 0)
-               return TRUE;
-
        /* ensure we can set up the repo */
        if (!gs_plugin_ensure_installation (plugin, cancellable, error))
                return FALSE;
diff --git a/src/plugins/packagekit-common.c b/src/plugins/packagekit-common.c
index 4f3eecd..0c4be79 100644
--- a/src/plugins/packagekit-common.c
+++ b/src/plugins/packagekit-common.c
@@ -153,7 +153,7 @@ gs_plugin_packagekit_add_results (GsPlugin *plugin,
                gs_app_set_summary (app,
                                    GS_APP_QUALITY_LOWEST,
                                    pk_package_get_summary (package));
-               gs_app_set_management_plugin (app, "PackageKit");
+               gs_app_set_management_plugin (app, "packagekit");
                gs_app_set_version (app, pk_package_get_version (package));
                switch (pk_package_get_info (package)) {
                case PK_INFO_ENUM_INSTALLED:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]