[gnome-software] Show a warning when new jhbuild users have no sample data



commit 82f04ef962b8c3b22963ca672decc81f39b9247e
Author: Richard Hughes <richard hughsie com>
Date:   Thu Sep 5 09:49:45 2013 +0100

    Show a warning when new jhbuild users have no sample data

 src/plugins/gs-plugin-appstream.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 3d6c656..5ab9e21 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -132,8 +132,6 @@ gs_plugin_initialize (GsPlugin *plugin)
        /* create private area */
        plugin->priv = GS_PLUGIN_GET_PRIVATE (GsPluginPrivate);
        plugin->priv->cache = appstream_cache_new ();
-
-       /* this is per-user */
        plugin->priv->cachedir = g_build_filename (DATADIR,
                                                   "app-info",
                                                   "icons",
@@ -175,6 +173,11 @@ gs_plugin_startup (GsPlugin *plugin, GError **error)
        if (!ret)
                goto out;
        size = appstream_cache_get_size (plugin->priv->cache);
+       if (size == 0) {
+               g_warning ("No AppStream data, try 'make install-sample-data' in data/");
+               g_assert_not_reached ();
+               goto out;
+       }
        g_debug ("Parsed %i entries of XML\t:%.1fms", size,
                 g_timer_elapsed (timer, NULL) * 1000);
 out:


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