Merge lp:~donadigo/appcenter/fix-steam-install into lp:~elementary-apps/appcenter/appcenter

Proposed by Adam Bieńkowski
Status: Work in progress
Proposed branch: lp:~donadigo/appcenter/fix-steam-install
Merge into: lp:~elementary-apps/appcenter/appcenter
Diff against target: 43 lines (+12/-8)
1 file modified
src/Core/Client.vala (+12/-8)
To merge this branch: bzr merge lp:~donadigo/appcenter/fix-steam-install
Reviewer Review Type Date Requested Status
Cody Garver (community) testing Needs Fixing
Review via email: mp+305421@code.launchpad.net

Commit message

* Fix steam installation
* Use search_names_async method

Description of the change

Instead of using resolve_async use search_names_async and take first package from the list (the main one).

Sorry for the mess, I actually introduced this issue by proposing branch to change search_names_async to resolve_async ;P

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

Seems to work fine. Once it's merged I will backport it to Loki stable.

review: Approve (testing)
Revision history for this message
Corentin Noël (tintou) wrote :

Some inline comments

Revision history for this message
Corentin Noël (tintou) wrote :

Also this seems to only revert the changes made here
http://bazaar.launchpad.net/~elementary-apps/appcenter/appcenter/revision/248

Revision history for this message
Cody Garver (codygarver) wrote :

I have reverted this commit to trunk and set the status back to Needs Review since there were questions about the code and it didn't seem to fix Steam installation.

Revision history for this message
Cody Garver (codygarver) :
review: Needs Fixing (testing)

Unmerged revisions

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-08-28 20:15:43 +0000
3+++ src/Core/Client.vala 2016-09-11 20:25:12 +0000
4@@ -117,12 +117,13 @@
5 packages_ids += null;
6
7 try {
8- var results = yield search_task.resolve_async (Pk.Bitfield.from_enums (Pk.Filter.NEWEST, Pk.Filter.ARCH), packages_ids, cancellable, () => {});
9+ var results = yield search_task.search_names_async (Pk.Bitfield.from_enums (Pk.Filter.NEWEST, Pk.Filter.ARCH), packages_ids, cancellable, () => {});
10 packages_ids = {};
11
12- results.get_package_array ().foreach ((package) => {
13- packages_ids += package.package_id;
14- });
15+ var package_array = results.get_package_array ();
16+ if (package_array.length > 0) {
17+ packages_ids += package_array[0].package_id;
18+ }
19
20 packages_ids += null;
21
22@@ -183,14 +184,17 @@
23 foreach (var pkg_name in package.component.get_pkgnames ()) {
24 packages_ids += pkg_name;
25 }
26+
27 packages_ids += null;
28
29 try {
30- var results = yield search_task.resolve_async (Pk.Bitfield.from_enums (Pk.Filter.INSTALLED, Pk.Filter.NEWEST), packages_ids, cancellable, () => {});
31+ var results = yield search_task.search_names_async (Pk.Bitfield.from_enums (Pk.Filter.INSTALLED, Pk.Filter.NEWEST), packages_ids, cancellable, () => {});
32 packages_ids = {};
33- results.get_package_array ().foreach ((package) => {
34- packages_ids += package.package_id;
35- });
36+
37+ var package_array = results.get_package_array ();
38+ if (package_array.length > 0) {
39+ packages_ids += package_array[0].package_id;
40+ }
41
42 results = yield remove_task.remove_packages_async (packages_ids, true, true, cancellable, cb);
43 exit_status = results.get_exit_code ();

Subscribers

People subscribed via source and target branches