[gnome-software/wip/hughsie/flatpak-origin-state: 4/4] flathub: Remove the 'Launch' button for non-current applications



commit 27f8c060a8cad3a9bc29deb268c530d87319ac82
Author: Richard Hughes <richard hughsie com>
Date:   Thu Feb 28 16:21:03 2019 +0000

    flathub: 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 47856988..56630116 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1702,6 +1702,15 @@ gs_flatpak_refine_app_state (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]