[gnome-software] Drop "require-appdata" setting



commit 94bf297f52ebf47a15f658d7b8def29c1d49b56f
Author: Kalev Lember <klember redhat com>
Date:   Wed Sep 16 12:19:28 2015 +0200

    Drop "require-appdata" setting
    
    Apps without appdata aren't included in the metadata and the setting no
    longer does anything useful.

 data/org.gnome.software.gschema.xml |    5 ----
 src/gs-app.c                        |    2 -
 src/gs-app.h                        |    1 -
 src/gs-plugin-loader.c              |   37 -----------------------------------
 src/gs-plugin.h                     |    1 -
 src/gs-shell-extras.c               |    9 ++-----
 src/plugins/gs-plugin-appstream.c   |    1 -
 7 files changed, 3 insertions(+), 53 deletions(-)
---
diff --git a/data/org.gnome.software.gschema.xml b/data/org.gnome.software.gschema.xml
index fe43cb8..b676114 100644
--- a/data/org.gnome.software.gschema.xml
+++ b/data/org.gnome.software.gschema.xml
@@ -14,11 +14,6 @@
       <default>true</default>
       <summary>Whether it's the very first run of gnome-software</summary>
     </key>
-    <key name="require-appdata" type="b">
-      <default>true</default>
-      <summary>Applications require AppData to be shown in the search results</summary>
-      <description>If enabled applications require a long description before they are shown to the user in 
the search results.</description>
-    </key>
     <key name="prompt-for-nonfree" type="b">
       <default>true</default>
       <summary>Non-free applications show a warning dialog before install</summary>
diff --git a/src/gs-app.c b/src/gs-app.c
index 1eccc46..a01d553 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -213,8 +213,6 @@ gs_app_to_string (GsApp *app)
                g_string_append (str, "\tkudo:\tperfect-screenshots\n");
        if ((app->kudos & GS_APP_KUDO_HIGH_CONTRAST) > 0)
                g_string_append (str, "\tkudo:\thigh-contrast\n");
-       if ((app->kudos & GS_APP_KUDO_APPDATA_DESCRIPTION) > 0)
-               g_string_append (str, "\tkudo:\tappdata-description\n");
        g_string_append_printf (str, "\tkudo-percentage:\t%i\n",
                                gs_app_get_kudos_percentage (app));
        if (app->name != NULL)
diff --git a/src/gs-app.h b/src/gs-app.h
index af985bc..d37257a 100644
--- a/src/gs-app.h
+++ b/src/gs-app.h
@@ -72,7 +72,6 @@ typedef enum {
        GS_APP_KUDO_IBUS_HAS_SYMBOL             = 1 << 11,
        GS_APP_KUDO_PERFECT_SCREENSHOTS         = 1 << 12,
        GS_APP_KUDO_HIGH_CONTRAST               = 1 << 13,
-       GS_APP_KUDO_APPDATA_DESCRIPTION         = 1 << 14,
        GS_APP_KUDO_LAST
 } GsAppKudo;
 
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 5e910d9..15199cf 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -644,20 +644,6 @@ gs_plugin_loader_get_app_is_compatible (GsApp *app, gpointer user_data)
 }
 
 /**
- * gs_plugin_loader_get_app_has_appdata:
- */
-static gboolean
-gs_plugin_loader_get_app_has_appdata (GsApp *app, gpointer user_data)
-{
-       if (gs_app_get_state (app) != AS_APP_STATE_AVAILABLE)
-               return TRUE;
-       if (gs_app_get_kudos (app) & GS_APP_KUDO_APPDATA_DESCRIPTION)
-               return TRUE;
-       g_debug ("removing app with no AppData %s", gs_app_get_id (app));
-       return FALSE;
-}
-
-/**
  * gs_plugin_loader_run_action_plugin:
  **/
 static gboolean
@@ -1483,12 +1469,6 @@ gs_plugin_loader_search_thread_cb (GTask *task,
        gs_plugin_list_filter (&state->list, gs_plugin_loader_app_is_valid, state);
        gs_plugin_list_filter (&state->list, gs_plugin_loader_filter_qt_for_gtk, NULL);
        gs_plugin_list_filter (&state->list, gs_plugin_loader_get_app_is_compatible, plugin_loader);
-       if (((state->flags & GS_PLUGIN_REFINE_FLAGS_ALLOW_NO_APPDATA) == 0) &&
-           g_settings_get_boolean (priv->settings, "require-appdata")) {
-               gs_plugin_list_filter (&state->list,
-                                      gs_plugin_loader_get_app_has_appdata,
-                                      plugin_loader);
-       }
        if (state->list == NULL) {
                g_task_return_new_error (task,
                                         GS_PLUGIN_LOADER_ERROR,
@@ -1652,12 +1632,6 @@ gs_plugin_loader_search_files_thread_cb (GTask *task,
        gs_plugin_list_filter (&state->list, gs_plugin_loader_app_is_non_installed, NULL);
        gs_plugin_list_filter (&state->list, gs_plugin_loader_filter_qt_for_gtk, NULL);
        gs_plugin_list_filter (&state->list, gs_plugin_loader_get_app_is_compatible, plugin_loader);
-       if (((state->flags & GS_PLUGIN_REFINE_FLAGS_ALLOW_NO_APPDATA) == 0) &&
-           g_settings_get_boolean (priv->settings, "require-appdata")) {
-               gs_plugin_list_filter (&state->list,
-                                      gs_plugin_loader_get_app_has_appdata,
-                                      plugin_loader);
-       }
        if (state->list == NULL) {
                g_task_return_new_error (task,
                                         GS_PLUGIN_LOADER_ERROR,
@@ -1821,12 +1795,6 @@ gs_plugin_loader_search_what_provides_thread_cb (GTask *task,
        gs_plugin_list_filter (&state->list, gs_plugin_loader_app_is_non_installed, NULL);
        gs_plugin_list_filter (&state->list, gs_plugin_loader_filter_qt_for_gtk, NULL);
        gs_plugin_list_filter (&state->list, gs_plugin_loader_get_app_is_compatible, plugin_loader);
-       if (((state->flags & GS_PLUGIN_REFINE_FLAGS_ALLOW_NO_APPDATA) == 0) &&
-           g_settings_get_boolean (priv->settings, "require-appdata")) {
-               gs_plugin_list_filter (&state->list,
-                                      gs_plugin_loader_get_app_has_appdata,
-                                      plugin_loader);
-       }
        if (state->list == NULL) {
                g_task_return_new_error (task,
                                         GS_PLUGIN_LOADER_ERROR,
@@ -2111,11 +2079,6 @@ gs_plugin_loader_get_category_apps_thread_cb (GTask *task,
        gs_plugin_list_filter (&state->list, gs_plugin_loader_app_is_valid, state);
        gs_plugin_list_filter (&state->list, gs_plugin_loader_filter_qt_for_gtk, NULL);
        gs_plugin_list_filter (&state->list, gs_plugin_loader_get_app_is_compatible, plugin_loader);
-       if (g_settings_get_boolean (priv->settings, "require-appdata")) {
-               gs_plugin_list_filter (&state->list,
-                                      gs_plugin_loader_get_app_has_appdata,
-                                      plugin_loader);
-       }
        if (state->list == NULL) {
                g_task_return_new_error (task,
                                         GS_PLUGIN_LOADER_ERROR,
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index 78971b4..0b31e83 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -100,7 +100,6 @@ typedef enum {
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_MENU_PATH        = 1 << 12,
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS           = 1 << 13,
        GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES           = 1 << 14,
-       GS_PLUGIN_REFINE_FLAGS_ALLOW_NO_APPDATA         = 1 << 15,
        GS_PLUGIN_REFINE_FLAGS_LAST
 } GsPluginRefineFlags;
 
diff --git a/src/gs-shell-extras.c b/src/gs-shell-extras.c
index 70dc6fd..24e31b0 100644
--- a/src/gs-shell-extras.c
+++ b/src/gs-shell-extras.c
@@ -698,8 +698,7 @@ gs_shell_extras_load (GsShellExtras *self, GPtrArray *array_search_data)
                                                             search_data->search_filename,
                                                             GS_PLUGIN_REFINE_FLAGS_DEFAULT |
                                                             GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
-                                                            GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES |
-                                                            GS_PLUGIN_REFINE_FLAGS_ALLOW_NO_APPDATA,
+                                                            GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES,
                                                             self->search_cancellable,
                                                             search_files_cb,
                                                             search_data);
@@ -709,8 +708,7 @@ gs_shell_extras_load (GsShellExtras *self, GPtrArray *array_search_data)
                                                                search_data->package_filename,
                                                                GS_PLUGIN_REFINE_FLAGS_DEFAULT |
                                                                GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
-                                                               GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES |
-                                                               GS_PLUGIN_REFINE_FLAGS_ALLOW_NO_APPDATA,
+                                                               GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES,
                                                                self->search_cancellable,
                                                                filename_to_app_cb,
                                                                search_data);
@@ -724,8 +722,7 @@ gs_shell_extras_load (GsShellExtras *self, GPtrArray *array_search_data)
                                                                     
GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION |
                                                                     
GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION |
                                                                     GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
-                                                                    GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES |
-                                                                    GS_PLUGIN_REFINE_FLAGS_ALLOW_NO_APPDATA,
+                                                                    GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES,
                                                                     self->search_cancellable,
                                                                     get_search_what_provides_cb,
                                                                     search_data);
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 50be3d2..3b2b79a 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -562,7 +562,6 @@ gs_plugin_refine_item (GsPlugin *plugin,
                        g_prefix_error (error, "trying to parse '%s': ", tmp);
                        return FALSE;
                }
-               gs_app_add_kudo (app, GS_APP_KUDO_APPDATA_DESCRIPTION);
                gs_app_set_description (app,
                                        GS_APP_QUALITY_HIGHEST,
                                        from_xml);


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