Merge lp:~donadigo/appcenter/async-check-updates into lp:~elementary-apps/appcenter/appcenter

Proposed by Adam Bieńkowski
Status: Merged
Approved by: Danielle Foré
Approved revision: 220
Merged at revision: 220
Proposed branch: lp:~donadigo/appcenter/async-check-updates
Merge into: lp:~elementary-apps/appcenter/appcenter
Diff against target: 12 lines (+1/-1)
1 file modified
src/Core/Client.vala (+1/-1)
To merge this branch: bzr merge lp:~donadigo/appcenter/async-check-updates
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+298425@code.launchpad.net

Commit message

* Fix synchronous checking for updates.

Description of the change

This branch fixes synchronous checking for updates which is currently freezing the application for a while, and then after all updates are checked and the notification is sent the UI is unfreezed.

get_updates is now called as an asynchronous method which solves the issue.

To post a comment you must log in.
220. By Adam Bieńkowski

Do not block main thread for checking updates

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Core/Client.vala'
2--- src/Core/Client.vala 2016-06-24 17:12:09 +0000
3+++ src/Core/Client.vala 2016-06-27 14:12:43 +0000
4@@ -330,7 +330,7 @@
5 public async void refresh_updates () {
6 var update_task = new AppCenter.Task ();
7 try {
8- Pk.Results result = update_task.get_updates_sync (0, null, (t, p) => { });
9+ Pk.Results result = yield update_task.get_updates_async (0, null, (t, p) => {});
10 bool was_empty = updates_number == 0U;
11 updates_number = get_package_count (result.get_package_array ());
12 if (was_empty && updates_number != 0U) {

Subscribers

People subscribed via source and target branches