Bug Fixes in Multimedia
Beginnings of SmartPointerList class:
A QList for storing pointers to QObjects, that automatically removes the pointers when objects are deleted.
The evil scheme behind this idea is to fix many of our crashes that result from storing (caching) QLists of pointers to QActions in various places in Amarok. The problem is that sometimes these QActions get deleted, and we end up with dangling pointers in these lists. That's causing crashes like in BR 184630, when we dereference these dangling pointers.
Now my class does have a few drawbacks still, which may be fixable with more tweaking, or maybe not:
* Does not work with Qt's foreach(), as it subclasses QObject. You need to iterate over the list in traditional ways.
* Casting of pointers is sometimes needed
For testing, I did start to port some of our QList<QAction*> to SmartPointerList, but not all of them.
You be the judge if this class is a good idea and a viable path.
I'm requesting code review and discussion.