Crash when double clicking recipes on "Brew Date" and "Style" columns

Bug #1416916 reported by mackanzx
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Brewtarget
Fix Committed
High
Mik Firestone

Bug Description

OS:
* Windows 8

To reproduce:
* Have a recipe with brew dates. that is, the recipe can be expanded
* Double click the recipe on a column other than Name.

Simple solution:
In BtTreeFilterProxyModel::filterAcceptsRow add this:
   if ( !thing )
      return true; //

before:
   return thing->display();

Question:
This seems like it might be an ugly fix.
But I dont feel at home in QT nor BT, so I don't really know where to look for the root cause.

Revision history for this message
Philip (rocketman768) wrote :

Mik can help you find a fix for this one.

Changed in brewtarget:
assignee: nobody → Mik Firestone (mikfire)
Revision history for this message
Mik Firestone (mikfire) wrote :

This is a bit more pervasive than just the recipe tree. Any tree will show the same behavior if you click in anything other than the first column.

The cause is buried deep in BtTreeModel::index. If the parent index has a non-zero column, it returns an invalid index. This causes problems in BtTreeFilterProxyModel because it doesn't test for the bad index.

The solution to this problem is to stop BtTreeModel::index() from doing that. And I will, just as soon as I remember why I did that in the first place. That section of the code hasn't been touched since the initial release of the trees. At that point, there only was one column. I may have just never updated this for the multi-column display.

I will keep trying to figure out why I did that and if it is valid. As soon as I can, I will fix this.

Changed in brewtarget:
importance: Undecided → High
status: New → In Progress
milestone: none → 2.2.0
Revision history for this message
gigatropolis (gigatropolis) wrote :

I was playing with this out of curiosity and did find a fix that seemed to work. Just added this line in BtTreeFilterProxyModel::filterAcceptsRow:

```
   if (!child.isValid())
      return false;
```

   Lazy fix that seems to work if you want to try.

  Kregg,

Revision history for this message
Mik Firestone (mikfire) wrote :

Merge request 121

Changed in brewtarget:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.