summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-06-13 10:47:29 +0100
committerRichard Hughes <richard@hughsie.com>2016-06-13 10:47:47 +0100
commita6690f229ffb6146c26f2b2ce31be9cb38da1d3d (patch)
tree67aa72f338ca92798895268fd379d5672ccdd68d /client
parent30f849c30b55b9748997f3755875ba4da6e4caea (diff)
downloadappstream-glib-a6690f229ffb6146c26f2b2ce31be9cb38da1d3d.tar.gz
Load metainfo files if present
/usr/share/appdata is the old location, but will be supported for a long time. Replaces https://github.com/hughsie/appstream-glib/pull/112
Diffstat (limited to 'client')
-rw-r--r--client/as-compose.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/client/as-compose.c b/client/as-compose.c
index eed5325..35356e4 100644
--- a/client/as-compose.c
+++ b/client/as-compose.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2014-2015 Richard Hughes <richard@hughsie.com>
+ * Copyright (C) 2014-2016 Richard Hughes <richard@hughsie.com>
* Copyright (C) 2016 Alexander Larsson <alexl@redhat.com>
*
* Licensed under the GNU General Public License Version 2
@@ -261,9 +261,18 @@ load_appdata (const gchar *prefix, const gchar *app_name, GError **error)
NULL);
appdata_path = g_build_filename (prefix,
"share",
- "appdata",
+ "metainfo",
appdata_basename,
NULL);
+ /* fall back to the legacy path */
+ if (!g_file_test (appdata_path, G_FILE_TEST_EXISTS)) {
+ g_free (appdata_path);
+ appdata_path = g_build_filename (prefix,
+ "share",
+ "appdata",
+ appdata_basename,
+ NULL);
+ }
g_debug ("Looking for %s", appdata_path);
app = as_app_new ();