Bug PVRChannel::SetIconPath
#1
Bug 
Line 295:
if (!CFile::Exists(strIconPath) && !strIconPath.IsEmpty())
return false;

Should be:
if (!CFile::Exists(strIconPath) && strIconPath.IsEmpty())
return false;

Reg.
Fred
Silverstone Grandia GD02-MT | AMD A8-3850 | Breakaway Audio Enhancer, HK AVR-365 | HKTS 30, Philips 50PFL7956H/12 21:9 3D
Reply
#2
it's a bug, but your fix isn't correct either. but thanks for pointing it out
opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
Reply
#3
(2012-10-26, 11:23)dushmaniac Wrote: it's a bug, but your fix isn't correct either. but thanks for pointing it out

I was loosing my icons for the radio channels each time I started xbmc Wink

Silverstone Grandia GD02-MT | AMD A8-3850 | Breakaway Audio Enhancer, HK AVR-365 | HKTS 30, Philips 50PFL7956H/12 21:9 3D
Reply
#4
(2012-10-26, 11:47)Skixbmc Wrote:
(2012-10-26, 11:23)dushmaniac Wrote: it's a bug, but your fix isn't correct either. but thanks for pointing it out

I was loosing my icons for the radio channels each time I started xbmc Wink

Well, now I have no icons at all Confused but I think that the problem can be resolved with the following solution:

First:
bool CPVRChannel::SetIconPath(const CStdString &strIconPath, bool bIsUserSetIcon /* = false */)
{
CSingleLock lock(m_critSection);

if (m_strIconPath != strIconPath && CFile::Exists(strIconPath))
{
/* update the path */
m_strIconPath.Format("%s", strIconPath);
SetChanged();
m_bChanged = true;

/* did the user change the icon? */
if (bIsUserSetIcon)
m_bIsUserSetIcon = !m_strIconPath.IsEmpty();

return true;
}

return false;
}

Why?
Because this function is called from CPVRChannelGroup::SearchAndSetChannelIcons which do a OR call on the different image types.

Second:
CPVRChannelGroup::SearchAndSetChannelIcons
/* skip if an icon is already set */
if (!groupMember.channel->IconPath().IsEmpty() && CFile::Exists(groupMember.channel->IconPath()))
continue;

This is an second control of the file exists.

There is also another problem with assigning the icons manually, the setting isUserSetIcon is not set and there is no check when loading the channels to obey this settings.

Reg.
Fred
Silverstone Grandia GD02-MT | AMD A8-3850 | Breakaway Audio Enhancer, HK AVR-365 | HKTS 30, Philips 50PFL7956H/12 21:9 3D
Reply
#5
meh, forgot about that sucky SearchAndSetChannelIcons() method
opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
Reply
#6
(2012-10-27, 13:22)dushmaniac Wrote: meh, forgot about that sucky SearchAndSetChannelIcons() method

Wink
Silverstone Grandia GD02-MT | AMD A8-3850 | Breakaway Audio Enhancer, HK AVR-365 | HKTS 30, Philips 50PFL7956H/12 21:9 3D
Reply
#7
Why is line 295 a problem? I added that because without "&& !strIconPath.IsEmpty()" the icon could never be removed once it was set.

And about the isUserSetIcon... it is set when user is choosing an icon from GUIWindowPVRChannels. And checked when the channels are loaded from the backend (so that the user set icon is not overwritten). Maybe it's missing in CPVRChannelGroup::SearchAndSetChannelIcons... i'm not sure because I never used this function.

You can take a look here to see what was changed when this was commited:
https://github.com/opdenkamp/xbmc/commit...4fa39dda63

Please describe your use case and problem... and then I'll take a look in how to fix it (without breaking anything else).
Reply
#8
(2012-10-28, 09:41)mikrohard Wrote: Why is line 295 a problem? I added that because without "&& !strIconPath.IsEmpty()" the icon could never be removed once it was set.

And about the isUserSetIcon... it is set when user is choosing an icon from GUIWindowPVRChannels. And checked when the channels are loaded from the backend (so that the user set icon is not overwritten). Maybe it's missing in CPVRChannelGroup::SearchAndSetChannelIcons... i'm not sure because I never used this function.

You can take a look here to see what was changed when this was commited:
https://github.com/opdenkamp/xbmc/commit...4fa39dda63

Please describe your use case and problem... and then I'll take a look in how to fix it (without breaking anything else).

Yes,
That is how it should be, but I have the code from github/xbmc and there it is different.... I thought that the pvr code was integrated in xbmc... Huh
Silverstone Grandia GD02-MT | AMD A8-3850 | Breakaway Audio Enhancer, HK AVR-365 | HKTS 30, Philips 50PFL7956H/12 21:9 3D
Reply
#9
It was integrated... but it's already 8 months since this was added to Eden-pvr. It was likely modified before being merged into mainline.
Reply
#10
(2012-10-28, 10:41)mikrohard Wrote: It was integrated... but it's already 8 months since this was added to Eden-pvr. It was likely modified before being merged into mainline.

That explains a lot to me, but which repo should I take?
Silverstone Grandia GD02-MT | AMD A8-3850 | Breakaway Audio Enhancer, HK AVR-365 | HKTS 30, Philips 50PFL7956H/12 21:9 3D
Reply
#11
(2012-10-28, 10:44)Skixbmc Wrote:
(2012-10-28, 10:41)mikrohard Wrote: It was integrated... but it's already 8 months since this was added to Eden-pvr. It was likely modified before being merged into mainline.

That explains a lot to me, but which repo should I take?

So I take the repo from xbmc and the pvr files from opdenkamp and merge the files? Huh
Silverstone Grandia GD02-MT | AMD A8-3850 | Breakaway Audio Enhancer, HK AVR-365 | HKTS 30, Philips 50PFL7956H/12 21:9 3D
Reply
#12
No... it's already merged into mainline. I just wanted to show you the commit to see what was changed at that time.

Just take xbmc master (frodo) and fix it there if it's broken. Or let someone else fix it...
Reply
#13
mainline xbmc = alpha state. take eden-pvr from my repos if you want a stable build
opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
Reply

Logout Mark Read Team Forum Stats Members Help
PVRChannel::SetIconPath0