[gnome-software] Allow Fedora lang-packs to show in the software center



commit 2a8ac792b518863970611536ca25956143b05787
Author: Richard Hughes <richard hughsie com>
Date:   Mon Feb 29 11:56:31 2016 +0000

    Allow Fedora lang-packs to show in the software center
    
    We're discussing a component type on the AppStream mailing list now.

 src/plugins/gs-plugin-appstream.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 5ae3d21..8fec2fd 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -220,6 +220,26 @@ gs_plugin_appstream_startup (GsPlugin *plugin, GError **error)
                }
        }
 
+       /* fix up these */
+       for (i = 0; i < items->len; i++) {
+               app = g_ptr_array_index (items, i);
+               if (as_app_get_kind (app) == AS_APP_KIND_GENERIC &&
+                   g_str_has_prefix (as_app_get_id (app),
+                                     "org.fedoraproject.LangPack-")) {
+                       g_autoptr(AsIcon) icon = NULL;
+
+                       /* add icon */
+                       icon = as_icon_new ();
+                       as_icon_set_kind (icon, AS_ICON_KIND_STOCK);
+                       as_icon_set_name (icon, "accessories-dictionary-symbolic");
+                       as_app_add_icon (app, icon);
+
+                       /* add categories */
+                       as_app_add_category (app, "Addons");
+                       as_app_add_category (app, "Localization");
+               }
+       }
+
        /* rely on the store keeping itself updated */
        plugin->priv->done_init = TRUE;
        return TRUE;


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