I’m trying to learn about Deskbar replicants by tinkering with the Weather app.
I’ve removed the commented-out menu item to show the replicant and tooltip.
However, for some reason the replicant doesn’t change at all when I update the code or make changes to the app settings (change location or temperature unit). The only way I can get it to change is by recompiling the code and restart Haiku (I’m using VirtualBox).
I’m unsure if this is expected (is the Replicant data stored somewhere?), or if it is a bug in the way Weather implements the Replicant? How can I force the replicant to update without a reboot?
It’s been reported already in an issue upstream
EDIT, most read more carefully Thanks for looking into this!
thanks for working on this! It’s being sitting in my to-do list since ever…
I don’t know if the Deskbar replicant ever worked in Weather, tbh.
I need to look at the code again but I think that the problem is with the BView not being updated properly.
The replicant gets drawn in the Draw method, you should follow the route and see when and how it is called.
Secondly, you’d better have a look at where the replicant view gets the weather data.
The replicant view lives in the Deskbar and is independent of the application it is bundled with.
If the update is performed somewhere outside of the replicant you can’t really communicate with it unless the application is running.
Look also at how the Tracker replicant is done.
Thanks for the advice, I’ll see if I can figure it out. I’m just surprised that the replicant keeps the old code even after I close and recompile the app. I found out that if I force the Deskbar to quit, it restarts automatically and the replicant updates, at least it’s easier than rebooting the system.
Replicants are loaded from the executable (using load_add_on) and once loaded, that can’t “magically” update to the new code, you have to uninstall and reinstall the replicant.
Also, when it is loaded, it will use a query based on the MIME signature to find the app to load,and take the first result, so if you have multiple executaples around, it may pick the wrong one.