summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-app.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-08-02 12:15:10 +0100
committerRichard Hughes <richard@hughsie.com>2016-08-02 12:15:10 +0100
commite4b8d2522b88d4e601b183a8da6276b634401fc6 (patch)
tree50e0a75821a0f201863e5c9a9534e85097e30ff7 /libappstream-glib/as-app.c
parent0e4f23ded03b21060c5ec7886cfd056031a20720 (diff)
downloadappstream-glib-e4b8d2522b88d4e601b183a8da6276b634401fc6.tar.gz
trivial: Add some initial self tests for AS_STORE_ADD_FLAG_USE_UNIQUE_ID
Diffstat (limited to 'libappstream-glib/as-app.c')
-rw-r--r--libappstream-glib/as-app.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c
index 951b4f6..69e220c 100644
--- a/libappstream-glib/as-app.c
+++ b/libappstream-glib/as-app.c
@@ -2976,6 +2976,16 @@ as_app_add_bundle (AsApp *app, AsBundle *bundle)
return;
}
}
+
+ /* set the architecture and branch */
+ if (as_bundle_get_kind (bundle) == AS_BUNDLE_KIND_FLATPAK) {
+ g_auto(GStrv) split = g_strsplit (as_bundle_get_id (bundle), "/", -1);
+ if (priv->architectures->len == 0)
+ as_app_add_arch (app, split[2]);
+ if (priv->branch == NULL)
+ as_app_set_branch (app, split[3]);
+ }
+
g_ptr_array_add (priv->bundles, g_object_ref (bundle));
}
@@ -3982,14 +3992,6 @@ as_app_node_parse_child (AsApp *app, GNode *n, AsAppParseFlags flags,
if (!as_bundle_node_parse (bu, n, ctx, error))
return FALSE;
as_app_add_bundle (app, bu);
-
- /* set the architecture and branch */
- if (as_bundle_get_kind (bu) == AS_BUNDLE_KIND_FLATPAK) {
- g_auto(GStrv) split = g_strsplit (as_bundle_get_id (bu), "/", -1);
- as_app_add_arch (app, split[2]);
- if (priv->branch == NULL)
- priv->branch = g_strdup (split[3]);
- }
break;
}