[gnome-software] Support ratings depending on the Appstream version



commit 1872b76bf894b4e6c239997c6ce316484449ff17
Author: Joaquim Rocha <jrocha endless com>
Date:   Wed Mar 16 13:50:29 2016 +0100

    Support ratings depending on the Appstream version
    
    The OARS support at this point needs an unreleased version of
    appstream-glib. Since this is not a vital feature for using GNOME
    Software, this patch does not compiles the ratings feature if
    the appstream-glib installed does not support it.

 configure.ac   |    2 +-
 src/gs-utils.c |    2 ++
 src/gs-utils.h |    2 ++
 3 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 99110bb..0987644 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,7 @@ dnl ---------------------------------------------------------------------------
 dnl - Check library dependencies
 dnl ---------------------------------------------------------------------------
 PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.18.2 gio-unix-2.0 gtkspell3-3.0)
-PKG_CHECK_MODULES(APPSTREAM, appstream-glib >= 0.5.12)
+PKG_CHECK_MODULES(APPSTREAM, appstream-glib >= 0.5.11)
 PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= 2.31.5)
 PKG_CHECK_MODULES(JSON_GLIB, json-glib-1.0 >= 1.1.1)
 PKG_CHECK_MODULES(SQLITE, sqlite3)
diff --git a/src/gs-utils.c b/src/gs-utils.c
index 0fa1c4a..fb24e69 100644
--- a/src/gs-utils.c
+++ b/src/gs-utils.c
@@ -490,6 +490,7 @@ gs_utils_get_permission (const gchar *id)
 #endif
 }
 
+#if AS_CHECK_VERSION(0,5,12)
 /**
  * gs_utils_get_content_rating:
  *
@@ -708,5 +709,6 @@ gs_utils_get_content_rating (void)
        { NULL, 0, NULL } };
        return content_rating_oars[0].desc;
 }
+#endif
 
 /* vim: set noexpandtab: */
diff --git a/src/gs-utils.h b/src/gs-utils.h
index 81e0a96..9b6bb3c 100644
--- a/src/gs-utils.h
+++ b/src/gs-utils.h
@@ -61,7 +61,9 @@ gchar         *gs_utils_get_cachedir          (const gchar    *kind,
                                                 GError         **error);
 gchar          *gs_utils_get_user_hash         (GError         **error);
 GPermission    *gs_utils_get_permission        (const gchar    *id);
+#if AS_CHECK_VERSION(0,5,12)
 const gchar    *gs_utils_get_content_rating    (void);
+#endif
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]