Skip to content

Commit 817dbc8

Browse files
carnizleolost2605
andauthored
Let PackageKit trigger check_for_updates (#234)
* Update the state to UP_TO_DATE when PackageKit reports no offline updates available * Just let the update-monitor fire check_for_updates() * Add missing line break Co-authored-by: Leonhard <leo.kargl@proton.me> --------- Co-authored-by: Leonhard <leo.kargl@proton.me>
1 parent d1523a5 commit 817dbc8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/Backends/SystemUpdate.vala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class SettingsDaemon.Backends.SystemUpdate : Object {
2525
private Pk.Task task;
2626
private Pk.PackageSack? available_updates = null;
2727
private GLib.Cancellable cancellable;
28+
private GLib.FileMonitor? prepared_update_monitor = null;
2829

2930
construct {
3031
current_state = {
@@ -58,6 +59,13 @@ public class SettingsDaemon.Backends.SystemUpdate : Object {
5859
} catch (Error e) {
5960
warning ("Couldn't determine last offline results: %s", e.message);
6061
}
62+
63+
try {
64+
prepared_update_monitor = Pk.offline_get_prepared_monitor ();
65+
prepared_update_monitor.changed.connect (() => check_for_updates.begin (true, true));
66+
} catch (Error e) {
67+
warning ("Couldn't monitor prepared offline updates: %s", e.message);
68+
}
6169
}
6270

6371
public async void check_for_updates (bool force, bool notify) throws DBusError, IOError {

0 commit comments

Comments
 (0)