Merge lp://staging/~gary-lasker/software-center/fix-lp969907-for-5.2 into lp://staging/software-center/5.2

Proposed by Gary Lasker
Status: Merged
Approved by: Michael Vogt
Approved revision: 3065
Merge reported by: Michael Vogt
Merged at revision: not available
Proposed branch: lp://staging/~gary-lasker/software-center/fix-lp969907-for-5.2
Merge into: lp://staging/software-center/5.2
Diff against target: 89 lines (+19/-19)
1 file modified
softwarecenter/ui/gtk3/widgets/apptreeview.py (+19/-19)
To merge this branch: bzr merge lp://staging/~gary-lasker/software-center/fix-lp969907-for-5.2
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Review via email: mp+115461@code.staging.launchpad.net

Description of the change

This branch should fix the crasher in bug 969907. Unfortunately, I could not find a way to reproduce this crash, but it has been consistently appearing on errors.ubuntu.com so we need to fix this. Basically, the fix consists in checking for a null model on the call to _app_activated_cb(), and returning if we don't have a model. There should be no unwanted side effect for this fix in the case of the error because we can't view the details for an application if we don't have a model available.

I also made a change earlier in the chain, in the _on_key_release_event() method (which eventually calls self._init_activated and finally results in the callback being called). In this there was a direct call to this.get_model(), which is not valid as it does not check for Gtk.TreeModelFilter as is done in the appmodel property. Instead, I just use the model passed in with the event.

I also did a small amount of cleanup to the code in _app_activated_cb(). There is a lot more cleanup that could and should be done in general in this class, but this branch is targeted for an SRU and so makes minimal changes.

Testing should be done in the various listviews, that is, to use both the "More Info" and the "Install/Remove" buttons in the listviews for both the "All Software" and "Installed" views (the latter tests the treeview case).

Thanks for your review!

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks a lot for this branch! I have a bit of a busy morning so I will review it a bit later today, this is just a quick note to say that its great that you looked at the problem and analyzed it.

Revision history for this message
Michael Vogt (mvo) wrote :

Hi, I think this looks good and the check for a valid model is a good idea.

The only thing that makes me slightly nervous is that the "appmodel" property now returns the underlying model and never a filter model. This property is used in the cellrender and the appview (and internally in the apptreeview) so I wonder if that does not change the semantic? I will have a closer look to better understand this.

Revision history for this message
Michael Vogt (mvo) wrote :

Oh, sorry, its just the comment for def appmodel() that changed, so no semantic change. Please ignore the previous bit abotu that.

Revision history for this message
Michael Vogt (mvo) wrote :

All looks fine, thanks for this fix.

review: Approve
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Ha! I was reading the comments in email and saw the one from two comments back and I had a tiny moment of panic "Yikes, I don't think I changed def appmodel???". I definitely would *not* touch that (until we find a way to properly not need such a thing). ;)

Yeah, I just added the FIXME there.

Thanks as always for the careful review!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches