OpenCPN icon indicating copy to clipboard operation
OpenCPN copied to clipboard

function "ChartDatabase::RemoveSingleChart(wxString &ChartFullPath)" alway returns "false"

Open BerndCirotzki opened this issue 3 months ago • 3 comments

See the code. ...

the function : bool ChartDatabase::RemoveSingleChart(wxString &ChartFullPath) { bool rv = false;

.... return rv; }

could never return true.

BerndCirotzki avatar Oct 25 '25 13:10 BerndCirotzki

@BerndCirotzki Your conclusion is probably correct but where in the code is anything looking for a true return. I can't find it. So what kind of nuisance can occur as a result of this "bug"? It may not be a bug, i.e. an unintentional mistake?

Hakansv avatar Oct 27 '25 18:10 Hakansv

Hello Hakansv, You're right, it's only used for the plugins in the API, and that's not really very important. But it should work. For example, I use this function in my plugin, which isn't available in the OPENCPN download, because it only runs on windows. It essentially does the same thing as "vkaps_pi" ... the only thing is, it doesn't cost anything!

https://github.com/BerndCirotzki/TileChart_pi

I could imagine that there are some users who develop a plugin without publishing it. What I mean by that is... you don't even know if this function isn't being used by other users. I only discovered this bug because the function has been crashing OpenCPN lately. #4820

BerndCirotzki avatar Oct 27 '25 18:10 BerndCirotzki

Ooh, I see. Thanks for the explanation.

Hakansv avatar Oct 27 '25 20:10 Hakansv