summaryrefslogtreecommitdiff
path: root/menuitem.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-10-03 10:37:54 +0200
committerlouis <louis.braun@gmx.de>2013-10-03 10:37:54 +0200
commit4a821c98ed14954c0fc2745ff7c2b99c75d56b1f (patch)
treea02d9e59cd0981a687934ff3416165d58b785ba2 /menuitem.c
parent1b7943aea0f17b8891f6b201ded6fadd17555972 (diff)
downloadskin-nopacity-4a821c98ed14954c0fc2745ff7c2b99c75d56b1f.tar.gz
skin-nopacity-4a821c98ed14954c0fc2745ff7c2b99c75d56b1f.tar.bz2
Added additional configurable channel logo cache
Diffstat (limited to 'menuitem.c')
-rw-r--r--menuitem.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/menuitem.c b/menuitem.c
index a4190bf..cf6dca1 100644
--- a/menuitem.c
+++ b/menuitem.c
@@ -531,11 +531,9 @@ void cNopacityScheduleMenuItem::DrawBackground(int textLeft) {
void cNopacityScheduleMenuItem::DrawLogo(int logoWidth, int logoHeight) {
if (Channel && Channel->Name()) {
- cImageLoader imgLoader;
- if (imgLoader.LoadLogo(Channel->Name(), logoWidth, logoHeight)) {
- pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage());
- } else if (imgLoader.LoadLogo(*(Channel->GetChannelID().ToString()), logoWidth, logoHeight)) {
- pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage());
+ cImage *logo = imgCache->GetLogo(ctLogoMenuItem, Channel);
+ if (logo) {
+ pixmapIcon->DrawImage(cPoint(1,1), *logo);
} else {
cTextWrapper channel;
channel.Set(Channel->Name(), font, logoWidth);
@@ -776,15 +774,11 @@ std::string cNopacityChannelMenuItem::readEPG(void) {
void cNopacityChannelMenuItem::Render() {
if (selectable) { //Channels
DrawBackground();
- int logoWidth = config.menuItemLogoWidth;
- int logoHeight = config.menuItemLogoHeight;
if (!drawn) {
- cImageLoader imgLoader;
- if (imgLoader.LoadLogo(Channel->Name(), logoWidth, logoHeight)) {
- pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage());
- } else if (imgLoader.LoadLogo(*(Channel->GetChannelID().ToString()), logoWidth, logoHeight)) {
- pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage());
- }
+ cImage *logo = imgCache->GetLogo(ctLogoMenuItem, Channel);
+ if (logo) {
+ pixmapIcon->DrawImage(cPoint(1,1), *logo);
+ }
drawn = true;
}
SetTextShort();
@@ -953,11 +947,9 @@ void cNopacityTimerMenuItem::Render() {
void cNopacityTimerMenuItem::DrawLogo(int logoWidth, int logoHeight) {
if (Timer && Timer->Channel() && Timer->Channel()->Name()) {
- cImageLoader imgLoader;
- if (imgLoader.LoadLogo(Timer->Channel()->Name(), logoWidth, logoHeight)) {
- pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage());
- } else if (imgLoader.LoadLogo(*(Timer->Channel()->GetChannelID().ToString()), logoWidth, logoHeight)) {
- pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage());
+ cImage *logo = imgCache->GetLogo(ctLogoMenuItem, Timer->Channel());
+ if (logo) {
+ pixmapIcon->DrawImage(cPoint(1,1), *logo);
} else {
cTextWrapper channel;
channel.Set(Timer->Channel()->Name(), font, logoWidth);