[mythtv] Depreciated calls to MythUIButtonListItem::setImage(MythImage *image, const QString &name="")

Paul Harrison mythtv at dsl.pipex.com
Wed Oct 15 17:42:48 UTC 2008

Stuart Morgan wrote:
> On Tuesday 14 October 2008 23:28:30 Paul Harrison wrote:
>> I see that function  is now depreciated so what is the alternative? Some
>> documentation would be nice :-)
>> There's a couple of those calls in MythGallery iconview.cpp the first
>> one is easy to replace just by re-ordering things and passing the image
>> in the ctor but the second one is more tricky. The only way I can see is
>> to save the thumb image to a file and use the SetImage(const QString
>> &filename, const QString &name="") to load it back in. Not exactly
>> efficient!
> Loading by filename is exactly the way it should be done. This is for several 
> reasons but the biggest of which is so that it uses the new image cache. The 
> mythgallery scaling and cache will be removed at some point, all scaling and 
> caching will be done through mythui.
> Right now the mythui cache is pretty basic, it lacks threaded scaling and 
> delayed loading through the use of events but those features are on the cards.
> MythGallery already saves the thumbnail to disk, all we need to do is keep 
> track of that filename in the ThumbItem and use it instead of the image. Once 
> the mythui image cache is complete we can simplify things further.
> The current buggy behaviour of old images being displayed in the wrong places 
> will be solved if we load by filename too.

This all good news for MythGallery or MythVideo and will be good for the 
covers in MythMusic where the source image files have to be available 
locally so there is no problem loading the image from the file.  Also we 
are usually only talking about a few hundred images.

But there is always an exception :-)

In MythZoneMinder the analysis images shown on the event screen are only 
available on the server running ZM which is usually a separate machine 
on the network. MythZM gets these images over a socket from the server 
so there is no need for these images to ever hit the hard drive, whats 
more  it's not uncommon for there to be 10,000+ events available. It's 
not practical to copy and store all these on each FE that accesses them. 
Most users will probably only ever look at the images once anyway so 
there is no advantage to caching  them. What I do now is I get the 
images on demand from the server as the user scrolls in the grid. Even a 
slow celeron has no problem keeping up so there is really no need to 
cache these images. I'd really appreciate it if we could keep the 
ability to load images directly into MythUIButtonListItems.

Paul H.


More information about the mythtv-dev mailing list