Merge lp:~donadigo/appcenter/fix-1609292-update-cache-ui into lp:~elementary-apps/appcenter/appcenter

Proposed by Adam Bieńkowski
Status: Merged
Approved by: Danielle Foré
Approved revision: 265
Merged at revision: 281
Proposed branch: lp:~donadigo/appcenter/fix-1609292-update-cache-ui
Merge into: lp:~elementary-apps/appcenter/appcenter
Diff against target: 53 lines (+5/-6)
2 files modified
src/Application.vala (+3/-1)
src/Core/Client.vala (+2/-5)
To merge this branch: bzr merge lp:~donadigo/appcenter/fix-1609292-update-cache-ui
Reviewer Review Type Date Requested Status
Jeremy Wootten code Approve
Review via email: mp+302406@code.launchpad.net

Commit message

* Update count badge on launch.

Description of the change

Fixes bug #1609292: "Notification for AppCenter indicates new packages though there are none".

This branch fixes that the UpdateView updates and shows no updates while the count badge is still there not updating how many updates there are remaining.

To post a comment you must log in.
Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

Approved (code - function not tested)

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Application.vala'
--- src/Application.vala 2016-06-19 21:09:16 +0000
+++ src/Application.vala 2016-08-09 13:00:13 +0000
@@ -57,13 +57,15 @@
5757
58 public override void activate () {58 public override void activate () {
59 if (silent) {59 if (silent) {
60 AppCenterCore.Client.get_default ().update_cache.begin ();
60 silent = false;61 silent = false;
61 AppCenterCore.Client.get_default ();
62 hold ();62 hold ();
63 return;63 return;
64 }64 }
6565
66 if (main_window == null) {66 if (main_window == null) {
67 AppCenterCore.Client.get_default ().update_cache.begin (true);
68
67 main_window = new MainWindow (this);69 main_window = new MainWindow (this);
68 main_window.destroy.connect (() => {70 main_window.destroy.connect (() => {
69 main_window = null;71 main_window = null;
7072
=== modified file 'src/Core/Client.vala'
--- src/Core/Client.vala 2016-07-18 17:20:11 +0000
+++ src/Core/Client.vala 2016-08-09 13:00:13 +0000
@@ -40,8 +40,6 @@
40 } catch (Error e) {40 } catch (Error e) {
41 error (e.message);41 error (e.message);
42 }42 }
43
44 update_cache.begin ();
45 }43 }
4644
47 construct {45 construct {
@@ -338,7 +336,6 @@
338 return package;336 return package;
339 }337 }
340338
341
342 public async void refresh_updates () {339 public async void refresh_updates () {
343 var update_task = new AppCenter.Task ();340 var update_task = new AppCenter.Task ();
344 try {341 try {
@@ -387,9 +384,9 @@
387 return size;384 return size;
388 }385 }
389386
390 public async void update_cache () {387 public async void update_cache (bool force = false) {
391 // One cache update a day, keeps the doctor away!388 // One cache update a day, keeps the doctor away!
392 if (last_cache_update == null || (new DateTime.now_local ()).difference (last_cache_update) >= GLib.TimeSpan.DAY) {389 if (force || last_cache_update == null || (new DateTime.now_local ()).difference (last_cache_update) >= GLib.TimeSpan.DAY) {
393 var refresh_task = new AppCenter.Task ();390 var refresh_task = new AppCenter.Task ();
394 try {391 try {
395 yield refresh_task.refresh_cache_async (false, null, (t, p) => { });392 yield refresh_task.refresh_cache_async (false, null, (t, p) => { });

Subscribers

People subscribed via source and target branches