summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2017-05-23 11:10:55 +0100
committerRichard Hughes <richard@hughsie.com>2017-05-23 11:33:10 +0100
commite1e6fa7ac968e96f3a8e67096ab208aa2f892dbd (patch)
tree4b90a88c2cd84ea92285d3a5f45a3a2640219417
parenteac31e3078d6447747c9922197ced6865bd268e1 (diff)
downloadappstream-glib-e1e6fa7ac968e96f3a8e67096ab208aa2f892dbd.tar.gz
Show a warning if adding keywords after the keyword cache was created
-rw-r--r--libappstream-glib/as-app.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c
index bb8039f..5ad2057 100644
--- a/libappstream-glib/as-app.c
+++ b/libappstream-glib/as-app.c
@@ -2888,6 +2888,14 @@ as_app_add_keyword (AsApp *app,
return;
}
g_ptr_array_add (tmp, as_ref_string_new (keyword));
+
+ /* cache already populated */
+ if (priv->token_cache_valid) {
+ g_warning ("%s has token cache, invaliding as %s was added",
+ as_app_get_unique_id (app), keyword);
+ g_hash_table_remove_all (priv->token_cache);
+ priv->token_cache_valid = FALSE;
+ }
}
/**