Skip to content

Commit

Permalink
[appstream-1-0] More AppStream 1.0 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bobby285271 committed Dec 3, 2023
1 parent 2342ea5 commit ff77f89
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/Core/FlatpakBackend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ public class AppCenterCore.FlatpakBackend : Backend, Object {
var category_array = new GLib.GenericArray<AppStream.Category> ();
category_array.add (category);
#if HAS_APPSTREAM_1_0
AppStream.utils_sort_components_into_categories (user_appstream_pool.get_components ().array (), category_array, false);
AppStream.utils_sort_components_into_categories (system_appstream_pool.get_components ().array (), category_array, false);
AppStream.utils_sort_components_into_categories (user_appstream_pool.get_components ().as_array (), category_array, false);
AppStream.utils_sort_components_into_categories (system_appstream_pool.get_components ().as_array (), category_array, false);
#else
AppStream.utils_sort_components_into_categories (user_appstream_pool.get_components (), category_array, false);
AppStream.utils_sort_components_into_categories (system_appstream_pool.get_components (), category_array, false);
Expand All @@ -423,7 +423,7 @@ public class AppCenterCore.FlatpakBackend : Backend, Object {
var comps = user_appstream_pool.search (query);
if (category == null) {
#if HAS_APPSTREAM_1_0
comps.array ().foreach ((comp) => {
comps.as_array ().foreach ((comp) => {
#else
comps.foreach ((comp) => {
#endif
Expand All @@ -433,7 +433,7 @@ public class AppCenterCore.FlatpakBackend : Backend, Object {
} else {
var cat_packages = get_applications_for_category (category);
#if HAS_APPSTREAM_1_0
comps.array ().foreach ((comp) => {
comps.as_array ().foreach ((comp) => {
#else
comps.foreach ((comp) => {
#endif
Expand All @@ -449,7 +449,7 @@ public class AppCenterCore.FlatpakBackend : Backend, Object {
comps = system_appstream_pool.search (query);
if (category == null) {
#if HAS_APPSTREAM_1_0
comps.array ().foreach ((comp) => {
comps.as_array ().foreach ((comp) => {
#else
comps.foreach ((comp) => {
#endif
Expand All @@ -459,7 +459,7 @@ public class AppCenterCore.FlatpakBackend : Backend, Object {
} else {
var cat_packages = get_applications_for_category (category);
#if HAS_APPSTREAM_1_0
comps.array ().foreach ((comp) => {
comps.as_array ().foreach ((comp) => {
#else
comps.foreach ((comp) => {
#endif
Expand Down Expand Up @@ -1121,7 +1121,7 @@ public class AppCenterCore.FlatpakBackend : Backend, Object {
} finally {
var comp_validator = ComponentValidator.get_default ();
#if HAS_APPSTREAM_1_0
user_appstream_pool.get_components ().array ().foreach ((comp) => {
user_appstream_pool.get_components ().as_array ().foreach ((comp) => {
#else
user_appstream_pool.get_components ().foreach ((comp) => {
#endif
Expand Down Expand Up @@ -1163,7 +1163,7 @@ public class AppCenterCore.FlatpakBackend : Backend, Object {
} finally {
var comp_validator = ComponentValidator.get_default ();
#if HAS_APPSTREAM_1_0
system_appstream_pool.get_components ().array ().foreach ((comp) => {
system_appstream_pool.get_components ().as_array ().foreach ((comp) => {
#else
system_appstream_pool.get_components ().foreach ((comp) => {
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/Core/PackageKitBackend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public class AppCenterCore.PackageKitBackend : Backend, Object {
var new_package_list = new Gee.HashMap<string, Package> ();
var comp_validator = ComponentValidator.get_default ();
#if HAS_APPSTREAM_1_0
appstream_pool.get_components ().array ().foreach ((comp) => {
appstream_pool.get_components ().as_array ().foreach ((comp) => {
#else
appstream_pool.get_components ().foreach ((comp) => {
#endif
Expand Down Expand Up @@ -461,7 +461,7 @@ public class AppCenterCore.PackageKitBackend : Backend, Object {
var category_array = new GLib.GenericArray<AppStream.Category> ();
category_array.add (category);
#if HAS_APPSTREAM_1_0
AppStream.utils_sort_components_into_categories (appstream_pool.get_components ().array (), category_array, true);
AppStream.utils_sort_components_into_categories (appstream_pool.get_components ().as_array (), category_array, true);
#else
AppStream.utils_sort_components_into_categories (appstream_pool.get_components (), category_array, true);
#endif
Expand All @@ -483,7 +483,7 @@ public class AppCenterCore.PackageKitBackend : Backend, Object {
var comps = appstream_pool.search (query);
if (category == null) {
#if HAS_APPSTREAM_1_0
comps.array ().foreach ((comp) => {
comps.as_array ().foreach ((comp) => {
#else
comps.foreach ((comp) => {
#endif
Expand All @@ -495,7 +495,7 @@ public class AppCenterCore.PackageKitBackend : Backend, Object {
} else {
var cat_packages = get_applications_for_category (category);
#if HAS_APPSTREAM_1_0
comps.array ().foreach ((comp) => {
comps.as_array ().foreach ((comp) => {
#else
comps.foreach ((comp) => {
#endif
Expand Down

0 comments on commit ff77f89

Please sign in to comment.