[gnome-software/wip/hughsie/flatpak-make-current: 18/18] flatpak:	Remove the 'Launch' button for non-current applications
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-software/wip/hughsie/flatpak-make-current: 18/18] flatpak:	Remove the 'Launch' button for non-current applications
- Date: Thu, 18 Jul 2019 11:45:54 +0000 (UTC)
commit 693a8140b31c697e291ba1375cd25be379efa813
Author: Richard Hughes <richard hughsie com>
Date:   Thu Feb 28 16:21:03 2019 +0000
    flatpak: Remove the 'Launch' button for non-current applications
 plugins/flatpak/gs-flatpak.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 673fcb45..318839aa 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1714,6 +1714,15 @@ gs_flatpak_refine_app_state_unlocked (GsFlatpak *self,
                gs_flatpak_set_metadata_installed (self, app, ref);
                if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN)
                        gs_app_set_state (app, AS_APP_STATE_INSTALLED);
+
+               /* flatpak only allows one installed app to be launchable */
+               if (flatpak_installed_ref_get_is_current (ref)) {
+                       gs_app_remove_quirk (app, GS_APP_QUIRK_NOT_LAUNCHABLE);
+               } else {
+                       g_debug ("%s is not current, and therefore not launchable",
+                                gs_app_get_unique_id (app));
+                       gs_app_add_quirk (app, GS_APP_QUIRK_NOT_LAUNCHABLE);
+               }
                return TRUE;
        }
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]