[gnome-software] Tag nightly app builds with a folder label in the search results



commit 050a1cedfef357350ade764bc43d24297cded76f
Author: Richard Hughes <richard hughsie com>
Date:   Thu Feb 18 09:05:40 2016 +0000

    Tag nightly app builds with a folder label in the search results

 src/gs-app-row.c                  |    5 +++++
 src/plugins/gs-plugin-appstream.c |    4 +++-
 2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index 4dfb5eb..a0bf3c0 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -211,6 +211,11 @@ gs_app_row_refresh (GsAppRow *app_row)
                folder = gs_folders_get_app_folder (folders, gs_app_get_id (priv->app), gs_app_get_categories 
(priv->app));
                if (folder)
                        folder = gs_folders_get_folder_name (folders, folder);
+
+               /* we overwrite this for some apps */
+               if (folder == NULL)
+                       folder = gs_app_get_metadata_item (priv->app, "X-XdgApp-Tags");
+
                gtk_label_set_label (GTK_LABEL (priv->folder_label), folder);
                gtk_widget_set_visible (priv->folder_label, folder != NULL);
        }
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 9ea8954..3143769 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -567,8 +567,10 @@ gs_plugin_refine_item (GsPlugin *plugin, GsApp *app, AsApp *item, GError **error
        /* set name */
        tmp = as_app_get_name (item, NULL);
        if (tmp != NULL) {
-               if (g_str_has_prefix (tmp, "(Nightly) "))
+               if (g_str_has_prefix (tmp, "(Nightly) ")) {
                        tmp += 10;
+                       gs_app_set_metadata (app, "X-XdgApp-Tags", "Nightly");
+               }
                gs_app_set_name (app, GS_APP_QUALITY_HIGHEST, tmp);
        }
 


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