Best way to execute some code after a script is completed
#1
Hi,

Anyone knows what would be the right way to excute some C++ code after a Script is completed within Kodi source code? I have a script that is executed by a CDirectoryProvider, and I would like to have a piece of code excuted when it completes.

Should I create a derived class of CDirectoryProvider and override the OnJobComplete() method?? or is there a way to register a callback to be called after the Fetch() is completed?

Thanks in advance for any tip...
Reply
#2
ok, following up my own thread, after investigations, it seems that in many cases, after a thread is completed in Kodi, OnJobComplete() is including a call to something like:

Code:
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE);
g_windowManager.SendThreadMessage(msg);

forcing window update. But in the CDirectoryProvider implementation, OnJobComplete() does not notify the rest of the application. Is this intended? When the content of a containter is set with a script, which executes in a thread, it means the state of the container is not updated when the thread is complete?

Pierre
Reply

Logout Mark Read Team Forum Stats Members Help
Best way to execute some code after a script is completed0