Skip to content

Commit

Permalink
Merge review comments, with minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Feb 6, 2024
1 parent 721ece3 commit d0bde20
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Core/Package.vala
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ public class AppCenterCore.Package : Object {

try {
#if HAS_APPSTREAM_1_0
description = AppStream.markup_convert (description, AppStream.MarkupKind.XML);
description = AppStream.markup_convert (description, TEXT);
#else
description = AppStream.markup_convert_simple (description);
#endif
Expand Down
13 changes: 5 additions & 8 deletions src/Views/AppInfoView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,14 @@ public class AppCenter.Views.AppInfoView : AppCenter.AbstractAppContainer {
#endif

#if HAS_APPSTREAM_1_0
var active_locale = "en_US";
var languages = package_component.get_languages ();
if (languages.length () > 0) {
active_locale = languages.nth_data (0);
var active_locale = "en-US";
if (package_component.get_context () != null) {
active_locale = package_component.get_context ().get_locale () ?? "en-US";
}
#else
var active_locale = package_component.get_active_locale ();
#endif
if (active_locale != "en_US") {
if (active_locale != "en_US" && active_locale != "en-US") {
var percent_translated = package_component.get_language (
// Expects language without locale
active_locale.split ("_")[0]
Expand Down Expand Up @@ -1067,9 +1066,7 @@ public class AppCenter.Views.AppInfoView : AppCenter.AbstractAppContainer {
release_carousel.add (release_row);

#if HAS_APPSTREAM_1_0
var release_version = new AppStream.Relation ();
release_version.set_version (release.get_version ());
if (package.installed && release_version.version_compare (package.get_version ())) {
if (package.installed && AppStream.vercmp_simple (release.get_version (), package.get_version ()) <= 0) {
#else
if (package.installed && AppStream.utils_compare_versions (release.get_version (), package.get_version ()) <= 0) {
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/ReleaseRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public class AppCenter.Widgets.ReleaseRow : Gtk.Box {
if (description != null) {
try {
#if HAS_APPSTREAM_1_0
var markup = AppStream.markup_convert (description, AppStream.MarkupKind.XML);
var markup = AppStream.markup_convert (description, TEXT);
#else
var markup = AppStream.markup_convert_simple (description);
#endif
Expand Down

0 comments on commit d0bde20

Please sign in to comment.