mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-03 19:01:25 +02:00
cc_item_picture: try to fix has_logo value
has_logo was always true if an alternate logo was defined.
This commit is contained in:
@@ -66,7 +66,10 @@ void CCPictureBase::setPicture(const std::string &name, const int &w, const int
|
|||||||
int dy_tmp = dy_orig;
|
int dy_tmp = dy_orig;
|
||||||
|
|
||||||
if (getBodyBGImage().empty())
|
if (getBodyBGImage().empty())
|
||||||
|
{
|
||||||
|
dprintf(DEBUG_NORMAL, "[CCPictureBase] [%s - %d] no image defined or doesn't exists %s\n", __func__, __LINE__, name.c_str());
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
g_PicViewer->getSize(getBodyBGImage().c_str(), &dx_orig, &dy_orig);
|
g_PicViewer->getSize(getBodyBGImage().c_str(), &dx_orig, &dy_orig);
|
||||||
|
|
||||||
@@ -143,6 +146,7 @@ void CComponentsChannelLogo::setChannel(const uint64_t &channelId, const std::st
|
|||||||
std::string image = "";
|
std::string image = "";
|
||||||
channel_id = channelId;
|
channel_id = channelId;
|
||||||
channel_name = channelName;
|
channel_name = channelName;
|
||||||
|
has_logo = false;
|
||||||
|
|
||||||
//dimensions not required here, will be handled in member setPicture(), therefore here only dummy variables
|
//dimensions not required here, will be handled in member setPicture(), therefore here only dummy variables
|
||||||
int dmy_x, dmy_y;
|
int dmy_x, dmy_y;
|
||||||
@@ -154,12 +158,14 @@ void CComponentsChannelLogo::setChannel(const uint64_t &channelId, const std::st
|
|||||||
|
|
||||||
//if logo or alternate image not available, set has_logo to false
|
//if logo or alternate image not available, set has_logo to false
|
||||||
has_logo = !image.empty();
|
has_logo = !image.empty();
|
||||||
|
if (!has_logo)
|
||||||
|
image = "blank";
|
||||||
|
|
||||||
//refresh object
|
//refresh object
|
||||||
setPicture(image, w, h);
|
setPicture(image, w, h);
|
||||||
|
|
||||||
//for sure, if no dimensions were detected set value of has_logo = false
|
//for sure, if no dimensions were detected set value of has_logo = false
|
||||||
if (width && height)
|
if (width && height && has_logo)
|
||||||
has_logo = true;
|
has_logo = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user