[gnome-software/gnome-3-22] trivial: Fall back to the update runtime if the app is not installed



commit d322368cffa0d9c999bc7cd2b0b492c796f532ba
Author: Richard Hughes <richard hughsie com>
Date:   Mon Jan 9 16:50:47 2017 +0000

    trivial: Fall back to the update runtime if the app is not installed

 src/gs-app.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index bb58b05..30362ac 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -1418,7 +1418,8 @@ gs_app_set_local_file (GsApp *app, GFile *local_file)
  * gs_app_get_runtime:
  * @app: a #GsApp
  *
- * Gets the runtime for the installed application.
+ * Gets the runtime for the installed application if the application is already
+ * installed, or the runtime for the available application otherwise.
  *
  * Returns: (transfer none): a #GsApp, or %NULL for unset
  *
@@ -1428,7 +1429,9 @@ GsApp *
 gs_app_get_runtime (GsApp *app)
 {
        g_return_val_if_fail (GS_IS_APP (app), NULL);
-       return app->runtime;
+       if (gs_app_is_installed (app))
+               return app->runtime;
+       return app->update_runtime;
 }
 
 /**


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