[gnome-software/wip/hughsie/flatpak3: 6/9] trivial: Fix the runtime fallbacks to be more sane
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/hughsie/flatpak3: 6/9] trivial: Fix the runtime fallbacks to be more sane
- Date: Fri, 14 Jul 2017 14:55:07 +0000 (UTC)
commit df80cea52a1f92a247e0d0a1b986c3efb3b8df8a
Author: Richard Hughes <richard hughsie com>
Date: Thu Jul 13 18:24:36 2017 +0100
trivial: Fix the runtime fallbacks to be more sane
lib/gs-app.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index 03488f3..d63654a 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -1645,8 +1645,7 @@ gs_app_set_content_rating (GsApp *app, AsContentRating *content_rating)
* gs_app_get_runtime:
* @app: a #GsApp
*
- * Gets the runtime for the installed application if the application is already
- * installed, or the runtime for the available application otherwise.
+ * Gets the runtime for the installed application.
*
* Returns: (transfer none): a #GsApp, or %NULL for unset
*
@@ -1657,7 +1656,7 @@ gs_app_get_runtime (GsApp *app)
{
GsAppPrivate *priv = gs_app_get_instance_private (app);
g_return_val_if_fail (GS_IS_APP (app), NULL);
- if (gs_app_is_installed (app))
+ if (priv->runtime != NULL)
return priv->runtime;
return priv->update_runtime;
}
@@ -1696,7 +1695,9 @@ gs_app_get_update_runtime (GsApp *app)
{
GsAppPrivate *priv = gs_app_get_instance_private (app);
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return priv->update_runtime;
+ if (priv->update_runtime != NULL)
+ return priv->update_runtime;
+ return priv->runtime;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]