Permalink
Browse files

Use the ChannelIcon storage group in the services API Guide/GetChanne…

…lIcon()

(cherry picked from commit d21c685f62c58e596ce1ece86e85040285eb0ccd)
  • Loading branch information...
stuartm committed Oct 16, 2013
1 parent 23131d3 commit 85462fbc670eb3efc4d3d66cf4708541a51199f1
Showing with 29 additions and 3 deletions.
  1. +29 −3 mythtv/programs/mythbackend/services/guide.cpp
@@ -229,12 +229,38 @@ QFileInfo Guide::GetChannelIcon( int nChanId,
if (sFileName.isEmpty())
return QFileInfo();
if ((nWidth <= 0) && (nHeight <= 0))
// ------------------------------------------------------------------
// Search for the filename
// ------------------------------------------------------------------
StorageGroup storage( "ChannelIcons" );
QString sFullFileName = storage.FindFile( sFileName );
if (sFullFileName.isEmpty())
{
// Use default pixmap
return QFileInfo( sFileName );
LOG(VB_UPNP, LOG_ERR,
QString("GetImageFile - Unable to find %1.").arg(sFileName));
return QFileInfo();
}
// ----------------------------------------------------------------------
// check to see if the file (still) exists
// ----------------------------------------------------------------------
if ((nWidth == 0) && (nHeight == 0))
{
if (QFile::exists( sFullFileName ))
{
return QFileInfo( sFullFileName );
}
LOG(VB_UPNP, LOG_ERR,
QString("GetImageFile - File Does not exist %1.").arg(sFullFileName));
return QFileInfo();
}
// -------------------------------------------------------------------
QString sNewFileName = QString( "%1.%2x%3.png" )
.arg( sFileName )

0 comments on commit 85462fb

Please sign in to comment.