[gnome-software/gnome-3-22] Ensure that the cached runtimes' source is always set
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-22] Ensure that the cached runtimes' source is always set
- Date: Mon, 16 Jan 2017 14:35:21 +0000 (UTC)
commit afda77cdfe127a0d55bd075b0b02b18472e8ec09
Author: Joaquim Rocha <jrocha endlessm com>
Date: Fri Jan 13 01:00:40 2017 +0100
Ensure that the cached runtimes' source is always set
When gs-appstream creates a new runtime but returns a cached one instead
it must ensure that the cached runtime has a source set on it. Otherwise
it will later fail when GNOME Software uses any details about the
runtime.
https://phabricator.endlessm.com/T15042
src/plugins/gs-appstream.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/gs-appstream.c b/src/plugins/gs-appstream.c
index a712510..7743fc5 100644
--- a/src/plugins/gs-appstream.c
+++ b/src/plugins/gs-appstream.c
@@ -329,8 +329,14 @@ gs_appstream_create_runtime (GsPlugin *plugin,
/* search in the cache */
app_cache = gs_plugin_cache_lookup (plugin, gs_app_get_unique_id (app));
- if (app_cache != NULL)
+ if (app_cache != NULL) {
+ /* since the cached runtime can have been created somewhere else
+ * (we're using a global cache), we need to make sure that a
+ * source is set */
+ if (gs_app_get_source_default (app_cache) == NULL)
+ gs_app_add_source (app_cache, source);
return g_object_ref (app_cache);
+ }
/* save in the cache */
gs_plugin_cache_add (plugin, NULL, app);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]