summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2019-01-21 19:12:35 +0000
committerRichard Hughes <richard@hughsie.com>2019-01-23 15:56:25 +0000
commita8a11b27835b04c224d31a8bf48cb7e065484bfb (patch)
tree08bac7b6110c2a97e4773d5c345c155372c728fa
parent872cdc8955cbf32ebb47f71f3f1108664a78913c (diff)
downloadappstream-glib-a8a11b27835b04c224d31a8bf48cb7e065484bfb.tar.gz
as-content-rating: Make as_content_rating_attribute_to_csm_age() public
This will allow it to be tested in a unit test. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://github.com/hughsie/appstream-glib/issues/280
-rw-r--r--libappstream-glib/as-content-rating.c12
-rw-r--r--libappstream-glib/as-content-rating.h3
2 files changed, 9 insertions, 6 deletions
diff --git a/libappstream-glib/as-content-rating.c b/libappstream-glib/as-content-rating.c
index d3d264f..a250af6 100644
--- a/libappstream-glib/as-content-rating.c
+++ b/libappstream-glib/as-content-rating.c
@@ -205,18 +205,18 @@ as_content_rating_value_from_string (const gchar *value)
}
/**
- * as_content_rating_id_value_to_csm_age:
- * @id: the subsection ID e.g. "violence-cartoon"
+ * as_content_rating_attribute_to_csm_age:
+ * @id: the subsection ID e.g. `violence-cartoon`
* @value: the #AsContentRatingValue, e.g. %AS_CONTENT_RATING_VALUE_INTENSE
*
* Gets the Common Sense Media approved age for a specific rating level.
*
* Returns: The age in years, or 0 for no details.
*
- * Since: 0.5.12
+ * Since: 0.7.15
**/
-static guint
-as_content_rating_id_value_to_csm_age (const gchar *id, AsContentRatingValue value)
+guint
+as_content_rating_attribute_to_csm_age (const gchar *id, AsContentRatingValue value)
{
/* The struct definition below assumes we don’t grow more
* #AsContentRating values. */
@@ -328,7 +328,7 @@ as_content_rating_get_minimum_age (AsContentRating *content_rating)
AsContentRatingKey *key;
guint csm_tmp;
key = g_ptr_array_index (priv->keys, i);
- csm_tmp = as_content_rating_id_value_to_csm_age (key->id, key->value);
+ csm_tmp = as_content_rating_attribute_to_csm_age (key->id, key->value);
if (csm_tmp > 0 && csm_tmp > csm_age)
csm_age = csm_tmp;
}
diff --git a/libappstream-glib/as-content-rating.h b/libappstream-glib/as-content-rating.h
index 2883bb8..8ba3d7c 100644
--- a/libappstream-glib/as-content-rating.h
+++ b/libappstream-glib/as-content-rating.h
@@ -84,6 +84,9 @@ void as_content_rating_add_attribute(AsContentRating *content_rating,
const gchar **as_content_rating_get_rating_ids (AsContentRating *content_rating);
+guint as_content_rating_attribute_to_csm_age (const gchar *id,
+ AsContentRatingValue value);
+
/* setters */
void as_content_rating_set_kind (AsContentRating *content_rating,
const gchar *kind);