[gnome-software/1021-please-add-a-way-to-show-only-open-source-apps: 2/6] gs-shell: Add gs_shell_get_list_apps_flags()




commit 198ab10f089ed930ec1e4c90d7fa528784cb68b5
Author: Milan Crha <mcrha redhat com>
Date:   Fri Oct 14 08:24:04 2022 +0200

    gs-shell: Add gs_shell_get_list_apps_flags()
    
    To be used in the following commits, to have a central place,
    where the "default" list-apps job flags will be provided from.

 src/gs-shell.c | 9 +++++++++
 src/gs-shell.h | 2 ++
 2 files changed, 11 insertions(+)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 91946ee07..4d58ec236 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -2723,3 +2723,12 @@ gs_shell_new (void)
 {
        return GS_SHELL (g_object_new (GS_TYPE_SHELL, NULL));
 }
+
+GsPluginListAppsFlags
+gs_shell_get_list_apps_flags (GsShell *self)
+{
+       g_return_val_if_fail (GS_IS_SHELL (self), GS_PLUGIN_LIST_APPS_FLAGS_NONE);
+       if (g_settings_get_boolean (self->settings, "show-only-free-apps"))
+               return GS_PLUGIN_LIST_APPS_FILTER_FREELY_LICENSED;
+       return GS_PLUGIN_LIST_APPS_FLAGS_NONE;
+}
diff --git a/src/gs-shell.h b/src/gs-shell.h
index 7689777aa..d0686f0f7 100644
--- a/src/gs-shell.h
+++ b/src/gs-shell.h
@@ -88,5 +88,7 @@ void           gs_shell_show_notification     (GsShell        *shell,
 gboolean        gs_shell_get_is_narrow         (GsShell        *shell);
 void            gs_shell_show_metainfo         (GsShell        *shell,
                                                 GFile          *file);
+GsPluginListAppsFlags
+                gs_shell_get_list_apps_flags   (GsShell        *self);
 
 G_END_DECLS


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