Skip to content
Commits on Source (18)
Version 41.5
~~~~~~~~~~~~
Released: 2022-03-18
This is a stable release with the following changes:
* Disable scroll-by-mouse-wheel on featured carousel
* Ensure details page shows app provided on command line
* Added several appstream-related fixes
This release also updates translation:
* Catalan
Version 41.4
~~~~~~~~~~~~
Released: 2022-02-10
......
......@@ -66,6 +66,20 @@
Validate with `appstreamcli validate *.appdata.xml`
-->
<releases>
<release date="2022-03-18" version="41.5" type="stable">
<description>
<p>This is a stable release with the following changes:</p>
<ul>
<li>Disable scroll-by-mouse-wheel on featured carousel</li>
<li>Ensure details page shows app provided on command line</li>
<li>Added several appstream-related fixes</li>
</ul>
<p>This release also updates translation:</p>
<ul>
<li>Catalan</li>
</ul>
</description>
</release>
<release date="2022-02-10" version="41.4" type="stable">
<description>
<p>This is a stable release which only updates translations:</p>
......
......@@ -889,6 +889,16 @@ gs_appstream_refine_app (GsPlugin *plugin,
}
}
/* set id kind */
if (gs_app_get_kind (app) == AS_COMPONENT_KIND_UNKNOWN ||
gs_app_get_kind (app) == AS_COMPONENT_KIND_GENERIC) {
AsComponentKind kind;
tmp = xb_node_get_attr (component, "type");
kind = as_component_kind_from_string (tmp);
if (kind != AS_COMPONENT_KIND_UNKNOWN)
gs_app_set_kind (app, kind);
}
/* types we can never launch */
switch (gs_app_get_kind (app)) {
case AS_COMPONENT_KIND_ADDON:
......@@ -938,7 +948,9 @@ gs_appstream_refine_app (GsPlugin *plugin,
gs_app_set_id (app, tmp);
/* set source */
tmp = xb_node_query_text (component, "../info/filename", NULL);
tmp = xb_node_query_text (component, "info/filename", NULL);
if (tmp == NULL)
tmp = xb_node_query_text (component, "../info/filename", NULL);
if (tmp != NULL && gs_app_get_metadata_item (app, "appstream::source-file") == NULL) {
gs_app_set_metadata (app, "appstream::source-file", tmp);
}
......@@ -1071,16 +1083,6 @@ gs_appstream_refine_app (GsPlugin *plugin,
gs_app_set_developer_name (app, tmp);
}
/* set id kind */
if (gs_app_get_kind (app) == AS_COMPONENT_KIND_UNKNOWN ||
gs_app_get_kind (app) == AS_COMPONENT_KIND_GENERIC) {
AsComponentKind kind;
tmp = xb_node_get_attr (component, "type");
kind = as_component_kind_from_string (tmp);
if (kind != AS_COMPONENT_KIND_UNKNOWN)
gs_app_set_kind (app, kind);
}
/* set the release date */
timestamp = component_get_release_timestamp (component);
if (timestamp != G_MAXUINT64)
......@@ -1824,3 +1826,22 @@ gs_appstream_component_add_extra_info (XbBuilderNode *component)
break;
}
}
/* Resolve any media URIs which are actually relative
* paths against the media_baseurl property */
void
gs_appstream_component_fix_url (XbBuilderNode *component, const gchar *baseurl)
{
const gchar *text = xb_builder_node_get_text (component);
g_autofree gchar *url = NULL;
if (text == NULL)
return;
if (g_str_has_prefix (text, "http:") ||
g_str_has_prefix (text, "https:"))
return;
url = g_strconcat (baseurl, "/", text, NULL);
xb_builder_node_set_text (component, url , -1);
}
......@@ -72,5 +72,7 @@ void gs_appstream_component_add_icon (XbBuilderNode *component,
const gchar *str);
void gs_appstream_component_add_provide (XbBuilderNode *component,
const gchar *str);
void gs_appstream_component_fix_url (XbBuilderNode *component,
const gchar *baseurl);
G_END_DECLS
......@@ -465,7 +465,7 @@ gs_fedora_third_party_list_sync (GsFedoraThirdParty *self,
}
self->last_update = g_get_real_time () / G_USEC_PER_SEC;
}
success = self->repos != NULL && g_hash_table_size (self->repos) != 0;
success = self->repos != NULL;
if (success && out_repos)
*out_repos = g_hash_table_ref (self->repos);
g_mutex_unlock (&self->lock);
......
project('gnome-software', 'c',
version : '41.4',
version : '41.5',
license : 'GPL-2.0+',
default_options : ['warning_level=1', 'c_std=c11'],
meson_version : '>=0.47.0'
......
......@@ -69,6 +69,8 @@ gs_plugin_appstream_convert_component_kind (const gchar *kind)
{
if (g_strcmp0 (kind, "webapp") == 0)
return "web-application";
if (g_strcmp0 (kind, "desktop") == 0)
return "desktop-application";
return kind;
}
......@@ -133,6 +135,60 @@ gs_plugin_appstream_add_origin_keyword_cb (XbBuilderFixup *self,
return TRUE;
}
static void
gs_plugin_appstream_media_baseurl_free (gpointer user_data)
{
g_string_free ((GString *) user_data, TRUE);
}
static gboolean
gs_plugin_appstream_media_baseurl_cb (XbBuilderFixup *self,
XbBuilderNode *bn,
gpointer user_data,
GError **error)
{
GString *baseurl = user_data;
if (g_strcmp0 (xb_builder_node_get_element (bn), "components") == 0) {
const gchar *url = xb_builder_node_get_attr (bn, "media_baseurl");
if (url == NULL) {
g_string_truncate (baseurl, 0);
return TRUE;
}
g_string_assign (baseurl, url);
return TRUE;
}
if (baseurl->len == 0)
return TRUE;
if (g_strcmp0 (xb_builder_node_get_element (bn), "icon") == 0) {
const gchar *type = xb_builder_node_get_attr (bn, "type");
if (g_strcmp0 (type, "remote") != 0)
return TRUE;
gs_appstream_component_fix_url (bn, baseurl->str);
} else if (g_strcmp0 (xb_builder_node_get_element (bn), "screenshots") == 0) {
GPtrArray *screenshots = xb_builder_node_get_children (bn);
for (guint i = 0; i < screenshots->len; i++) {
XbBuilderNode *screenshot = g_ptr_array_index (screenshots, i);
GPtrArray *children = NULL;
/* Type-check for security */
if (g_strcmp0 (xb_builder_node_get_element (screenshot), "screenshot") != 0) {
continue;
}
children = xb_builder_node_get_children (screenshot);
for (guint j = 0; j < children->len; j++) {
XbBuilderNode *child = g_ptr_array_index (children, j);
const gchar *element = xb_builder_node_get_element (child);
if (g_strcmp0 (element, "image") != 0 &&
g_strcmp0 (element, "video") != 0)
continue;
gs_appstream_component_fix_url (child, baseurl->str);
}
}
}
return TRUE;
}
static gboolean
gs_plugin_appstream_load_appdata_fn (GsPlugin *plugin,
XbBuilder *builder,
......@@ -398,6 +454,8 @@ gs_plugin_appstream_load_appstream_fn (GsPlugin *plugin,
#if LIBXMLB_CHECK_VERSION(0,3,1)
g_autoptr(XbBuilderFixup) fixup4 = NULL;
#endif
g_autoptr(XbBuilderFixup) fixup5 = NULL;
GString *media_baseurl = g_string_new (NULL);
g_autoptr(XbBuilderSource) source = xb_builder_source_new ();
/* add support for DEP-11 files */
......@@ -453,6 +511,14 @@ gs_plugin_appstream_load_appstream_fn (GsPlugin *plugin,
xb_builder_source_add_fixup (source, fixup4);
#endif
/* prepend media_baseurl to remote relative URLs */
fixup5 = xb_builder_fixup_new ("MediaBaseUrl",
gs_plugin_appstream_media_baseurl_cb,
media_baseurl,
gs_plugin_appstream_media_baseurl_free);
xb_builder_fixup_set_max_depth (fixup5, 3);
xb_builder_source_add_fixup (source, fixup5);
/* success */
xb_builder_import_source (builder, source);
return TRUE;
......@@ -828,10 +894,10 @@ gs_plugin_refine_from_id (GsPlugin *plugin,
/* look in AppStream then fall back to AppData */
if (origin && *origin) {
xb_string_append_union (xpath, "components[@origin='%s']/component/id[text()='%s']/../pkgname/..", origin, id);
xb_string_append_union (xpath, "components[@origin='%s']/component[@type='webapp']/id[text()='%s']/..", origin, id);
xb_string_append_union (xpath, "components[@origin='%s']/component[@type='web-application']/id[text()='%s']/..", origin, id);
} else {
xb_string_append_union (xpath, "components/component/id[text()='%s']/../pkgname/..", id);
xb_string_append_union (xpath, "components/component[@type='webapp']/id[text()='%s']/..", id);
xb_string_append_union (xpath, "components/component[@type='web-application']/id[text()='%s']/..", id);
}
xb_string_append_union (xpath, "component/id[text()='%s']/..", id);
components = xb_silo_query (priv->silo, xpath->str, 0, &error_local);
......@@ -886,9 +952,9 @@ gs_plugin_refine_from_pkgname (GsPlugin *plugin,
locker = g_rw_lock_reader_locker_new (&priv->silo_lock);
/* prefer actual apps and then fallback to anything else */
xb_string_append_union (xpath, "components/component[@type='desktop']/pkgname[text()='%s']/..", pkgname);
xb_string_append_union (xpath, "components/component[@type='console']/pkgname[text()='%s']/..", pkgname);
xb_string_append_union (xpath, "components/component[@type='webapp']/pkgname[text()='%s']/..", pkgname);
xb_string_append_union (xpath, "components/component[@type='desktop-application']/pkgname[text()='%s']/..", pkgname);
xb_string_append_union (xpath, "components/component[@type='console-application']/pkgname[text()='%s']/..", pkgname);
xb_string_append_union (xpath, "components/component[@type='web-application']/pkgname[text()='%s']/..", pkgname);
xb_string_append_union (xpath, "components/component/pkgname[text()='%s']/..", pkgname);
component = xb_silo_query_first (priv->silo, xpath->str, &error_local);
if (component == NULL) {
......
......@@ -1643,6 +1643,7 @@ gs_details_page_url_to_app_cb (GObject *source,
gs_shell_set_mode (self->shell, GS_SHELL_MODE_OVERVIEW);
} else {
GsApp *app = gs_app_list_index (list, 0);
g_set_object (&self->app_local_file, app);
_set_app (self, app);
gs_details_page_load_stage2 (self);
}
......@@ -1690,12 +1691,16 @@ static void
gs_details_page_load_stage1 (GsDetailsPage *self)
{
g_autoptr(GsPluginJob) plugin_job = NULL;
g_autoptr(GCancellable) cancellable = g_cancellable_new ();
/* update UI */
gs_page_switch_to (GS_PAGE (self));
gs_page_scroll_up (GS_PAGE (self));
gs_details_page_set_state (self, GS_DETAILS_PAGE_STATE_LOADING);
g_cancellable_cancel (self->cancellable);
g_set_object (&self->cancellable, cancellable);
/* get extra details about the app */
plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
"app", self->app,
......@@ -2095,7 +2100,7 @@ gs_details_page_setup (GsPage *page,
self->shell = shell;
self->plugin_loader = g_object_ref (plugin_loader);
self->cancellable = g_object_ref (cancellable);
self->cancellable = g_cancellable_new ();
/* hide some UI when offline */
g_signal_connect_object (self->plugin_loader, "notify::network-available",
......
......@@ -192,6 +192,12 @@ gs_featured_carousel_init (GsFeaturedCarousel *self)
gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
gtk_widget_init_template (GTK_WIDGET (self));
#if HDY_CHECK_VERSION(1, 3, 0)
/* Disable scrolling through the carousel, as it’s typically used
* in category pages which are themselves scrollable. */
hdy_carousel_set_allow_scroll_wheel (HDY_CAROUSEL (self->carousel), FALSE);
#endif
/* Ensure the text directions are up to date */
next_button_direction_changed_cb (GTK_WIDGET (self->next_button_image), GTK_TEXT_DIR_NONE, self);
previous_button_direction_changed_cb (GTK_WIDGET (self->previous_button_image), GTK_TEXT_DIR_NONE, self);
......