Merge lp:~donadigo/appcenter/object-creation-on-end into lp:~elementary-apps/appcenter/appcenter

Proposed by Adam Bieńkowski
Status: Merged
Approved by: Corentin Noël
Approved revision: 211
Merged at revision: 211
Proposed branch: lp:~donadigo/appcenter/object-creation-on-end
Merge into: lp:~elementary-apps/appcenter/appcenter
Diff against target: 22 lines (+5/-1)
1 file modified
src/Core/Package.vala (+5/-1)
To merge this branch: bzr merge lp:~donadigo/appcenter/object-creation-on-end
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+298055@code.launchpad.net

Commit message

* Fix object creation in get_icon ().

Description of the change

Fix lp:~donadigo/appcenter/prefer-stock object creation, initialize the variable with null and then create the object if there is no icon found.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Core/Package.vala'
2--- src/Core/Package.vala 2016-06-21 17:43:40 +0000
3+++ src/Core/Package.vala 2016-06-21 18:21:02 +0000
4@@ -142,7 +142,7 @@
5 }
6
7 public GLib.Icon get_icon (uint size = 32) {
8- GLib.Icon icon = new ThemedIcon ("application-default-icon");
9+ GLib.Icon? icon = null;
10 uint current_size = 0;
11
12 bool is_stock = false;
13@@ -179,6 +179,10 @@
14 }
15 });
16
17+ if (icon == null) {
18+ icon = new ThemedIcon ("application-default-icon");
19+ }
20+
21 return icon;
22 }
23

Subscribers

People subscribed via source and target branches