diff --git a/src/Core/Package.vala b/src/Core/Package.vala index ed1412926..de051201d 100644 --- a/src/Core/Package.vala +++ b/src/Core/Package.vala @@ -106,7 +106,6 @@ public class AppCenterCore.Package : Object { X11 } - public const string OS_UPDATES_ID = "xxx-os-updates"; public const string RUNTIME_UPDATES_ID = "xxx-runtime-updates"; public const string LOCAL_ID_SUFFIX = ".appcenter-local"; public const string DEFAULT_PRICE_DOLLARS = "1"; @@ -127,7 +126,7 @@ public class AppCenterCore.Package : Object { private bool _installed = false; public bool installed { get { - if (is_os_updates || is_runtime_updates) { + if (is_runtime_updates) { return true; } @@ -207,12 +206,6 @@ public class AppCenterCore.Package : Object { } } - public bool is_os_updates { - get { - return component.id == OS_UPDATES_ID; - } - } - public bool is_runtime_updates { get { return component.id == RUNTIME_UPDATES_ID; @@ -233,7 +226,7 @@ public class AppCenterCore.Package : Object { public bool is_shareable { get { - return is_native && component.get_kind () != AppStream.ComponentKind.DRIVER && !is_os_updates && !is_runtime_updates; + return is_native && component.get_kind () != AppStream.ComponentKind.DRIVER && !is_runtime_updates; } } @@ -874,7 +867,7 @@ public class AppCenterCore.Package : Object { } private string convert_version (string version) { - if (is_os_updates || is_runtime_updates) { + if (is_runtime_updates) { return version; } @@ -965,7 +958,7 @@ public class AppCenterCore.Package : Object { } private void populate_backend_details_sync () { - if (is_os_updates || is_runtime_updates || is_local) { + if (is_runtime_updates || is_local) { backend_details = new PackageDetails (); return; } diff --git a/src/Core/UpdateManager.vala b/src/Core/UpdateManager.vala index 348d916be..79eb02d66 100644 --- a/src/Core/UpdateManager.vala +++ b/src/Core/UpdateManager.vala @@ -19,7 +19,6 @@ public class AppCenterCore.UpdateManager : Object { public bool restart_required { public get; private set; default = false; } - public Package os_updates { public get; private set; } public Package runtime_updates { public get; private set; } public int unpaid_apps_number { get; private set; default = 0; } public uint64 updates_size { get; private set; default = 0ULL; } @@ -32,18 +31,6 @@ public class AppCenterCore.UpdateManager : Object { construct { restart_file = File.new_for_path (RESTART_REQUIRED_FILE); - var os_icon = new AppStream.Icon (); - os_icon.set_name ("distributor-logo"); - os_icon.set_kind (AppStream.IconKind.STOCK); - - var os_updates_component = new AppStream.Component (); - os_updates_component.id = AppCenterCore.Package.OS_UPDATES_ID; - os_updates_component.name = _("Operating System Updates"); - os_updates_component.summary = _("Updates to system components"); - os_updates_component.add_icon (os_icon); - - os_updates = new AppCenterCore.Package (BackendAggregator.get_default (), os_updates_component); - var runtime_icon = new AppStream.Icon (); runtime_icon.set_name ("application-vnd.flatpak"); runtime_icon.set_kind (AppStream.IconKind.STOCK); @@ -71,10 +58,6 @@ public class AppCenterCore.UpdateManager : Object { installed_package.update_state (); } - - uint os_count = 0; - string os_desc = ""; - #if PACKAGEKIT_BACKEND Pk.Results pk_updates; unowned PackageKitBackend client = PackageKitBackend.get_default (); @@ -84,28 +67,8 @@ public class AppCenterCore.UpdateManager : Object { warning ("Unable to get updates from PackageKit backend: %s", e.message); return 0; } - - var package_array = pk_updates.get_package_array (); - debug ("PackageKit backend reports %d updates", package_array.length); - - package_array.foreach ((pk_package) => { - var pkg_name = pk_package.get_name (); - debug ("Added %s to OS updates", pkg_name); - os_count++; - unowned string pkg_summary = pk_package.get_summary (); - unowned string pkg_version = pk_package.get_version (); - os_desc += Markup.printf_escaped ( - " • %s\n\t%s\n\t%s\n", - pkg_name, - pkg_summary, - _("Version: %s").printf (pkg_version) - ); - }); #endif - os_updates.component.set_pkgnames ({}); - os_updates.change_information.clear_update_info (); - uint runtime_count = 0; string runtime_desc = ""; @@ -177,18 +140,6 @@ public class AppCenterCore.UpdateManager : Object { } } - if (os_count == 0) { - debug ("No OS updates found"); - var latest_version = _("No components with updates"); - os_updates.latest_version = latest_version; - os_updates.description = GLib.Markup.printf_escaped ("%s\n", latest_version); - } else { - debug ("%u OS updates found", os_count); - var latest_version = ngettext ("%u component with updates", "%u components with updates", os_count).printf (os_count); - os_updates.latest_version = latest_version; - os_updates.description = "%s\n%s\n".printf (GLib.Markup.printf_escaped (_("%s:"), latest_version), os_desc); - } - if (runtime_count == 0) { debug ("No runtime updates found"); var latest_version = _("No runtimes with updates"); @@ -202,34 +153,11 @@ public class AppCenterCore.UpdateManager : Object { } debug ("%u app updates found", count); - if (os_count > 0) { - count += 1; - } if (runtime_count > 0) { count += 1; } -#if PACKAGEKIT_BACKEND - pk_updates.get_details_array ().foreach ((pk_detail) => { - var pk_package = new Pk.Package (); - try { - pk_package.set_id (pk_detail.get_package_id ()); - var pkg_name = pk_package.get_name (); - - var pkgnames = os_updates.component.pkgnames; - pkgnames += pkg_name; - os_updates.component.pkgnames = pkgnames; - - os_updates.change_information.updatable_packages.@set (client, pk_package.get_id ()); - os_updates.change_information.size += pk_detail.size; - } catch (Error e) { - critical (e.message); - } - }); -#endif - - os_updates.update_state (); runtime_updates.update_state (); return count; } diff --git a/src/Views/AppInfoView.vala b/src/Views/AppInfoView.vala index bef37f0ec..e35b67a3b 100644 --- a/src/Views/AppInfoView.vala +++ b/src/Views/AppInfoView.vala @@ -143,7 +143,7 @@ public class AppCenter.Views.AppInfoView : AppCenter.AbstractAppContainer { } else { app_icon.gicon = package.get_icon (app_icon.pixel_size, scale_factor); - if (package.is_os_updates || package.is_runtime_updates) { + if (package.is_runtime_updates) { badge_image.icon_name = "system-software-update"; app_icon_overlay.add_overlay (badge_image); } @@ -298,7 +298,7 @@ public class AppCenter.Views.AppInfoView : AppCenter.AbstractAppContainer { maximum_size = MAX_WIDTH }; - if (!package.is_os_updates && !package.is_runtime_updates) { + if (!package.is_runtime_updates) { #if CURATED if (!package.is_native) { var uncurated = new ContentType ( @@ -852,10 +852,10 @@ public class AppCenter.Views.AppInfoView : AppCenter.AbstractAppContainer { uninstall_button_revealer.reveal_child = false; break; case AppCenterCore.Package.State.INSTALLED: - uninstall_button_revealer.reveal_child = !package.is_os_updates && !package.is_runtime_updates && !package.is_compulsory; + uninstall_button_revealer.reveal_child = !package.is_runtime_updates && !package.is_compulsory; break; case AppCenterCore.Package.State.UPDATE_AVAILABLE: - uninstall_button_revealer.reveal_child = !package.is_os_updates && !package.is_runtime_updates && !package.is_compulsory; + uninstall_button_revealer.reveal_child = !package.is_runtime_updates && !package.is_compulsory; break; default: break; diff --git a/src/Views/AppListUpdateView.vala b/src/Views/AppListUpdateView.vala index 2aa618c7b..86621831c 100644 --- a/src/Views/AppListUpdateView.vala +++ b/src/Views/AppListUpdateView.vala @@ -266,12 +266,6 @@ namespace AppCenter.Views { if (!refresh_cancellable.is_cancelled ()) { clear (); - var os_updates = AppCenterCore.UpdateManager.get_default ().os_updates; - var os_updates_size = yield os_updates.get_download_size_including_deps (); - if (os_updates_size > 0) { - updates_liststore.insert_sorted (os_updates, compare_package_func); - } - var runtime_updates = AppCenterCore.UpdateManager.get_default ().runtime_updates; var runtime_updates_size = yield runtime_updates.get_download_size_including_deps (); if (runtime_updates_size > 0) { @@ -316,7 +310,6 @@ namespace AppCenter.Views { string a_package_name = ""; if (package1 != null) { a_is_driver = package1.kind == AppStream.ComponentKind.DRIVER; - a_is_os = package1.is_os_updates; a_is_runtime = package1.is_runtime_updates; a_is_updating = package1.is_updating; a_package_name = package1.get_name (); @@ -329,7 +322,6 @@ namespace AppCenter.Views { string b_package_name = ""; if (package2 != null) { b_is_driver = package2.kind == AppStream.ComponentKind.DRIVER; - b_is_os = package2.is_os_updates; b_is_runtime = package2.is_runtime_updates; b_is_updating = package2.is_updating; b_package_name = package2.get_name (); diff --git a/src/Widgets/AppContainers/AbstractAppContainer.vala b/src/Widgets/AppContainers/AbstractAppContainer.vala index 6dd833e7f..5c12d926f 100644 --- a/src/Widgets/AppContainers/AbstractAppContainer.vala +++ b/src/Widgets/AppContainers/AbstractAppContainer.vala @@ -163,7 +163,7 @@ public abstract class AppCenter.AbstractAppContainer : Gtk.Box { } protected void update_action () { - if (package == null || package.component == null || !package.is_native || package.is_os_updates || package.is_runtime_updates) { + if (package == null || package.component == null || !package.is_native || package.is_runtime_updates) { action_button.can_purchase = false; } else { var can_purchase = package.get_payments_key () != null; @@ -191,7 +191,7 @@ public abstract class AppCenter.AbstractAppContainer : Gtk.Box { action_button.amount = 0; } - action_button_revealer.reveal_child = !(package.is_os_updates || package.is_runtime_updates); + action_button_revealer.reveal_child = !package.is_runtime_updates; open_button_revealer.reveal_child = false; break; @@ -204,10 +204,6 @@ public abstract class AppCenter.AbstractAppContainer : Gtk.Box { case AppCenterCore.Package.State.UPDATE_AVAILABLE: action_button.free_string = _("Update"); - if (package.is_os_updates) { - action_button.free_string = _("Download"); - } - if (!package.should_pay) { action_button.amount = 0; } diff --git a/src/Widgets/AppContainers/AbstractPackageRowGrid.vala b/src/Widgets/AppContainers/AbstractPackageRowGrid.vala index fc8eb633e..dfedbe546 100644 --- a/src/Widgets/AppContainers/AbstractPackageRowGrid.vala +++ b/src/Widgets/AppContainers/AbstractPackageRowGrid.vala @@ -53,7 +53,7 @@ public abstract class AppCenter.Widgets.AbstractPackageRowGrid : AbstractAppCont } else { app_icon.gicon = package.get_icon (app_icon.pixel_size, scale_factor); - if (package.is_os_updates || package.is_runtime_updates) { + if (package.is_runtime_updates) { badge_image.icon_name = "system-software-update"; app_icon_overlay.add_overlay (badge_image); }