void ControlList::internAddListItem(AddonClass::Ref<ListItem> pListItem, bool sendMessage) { if (pListItem.isNull()) throw WindowException("NULL ListItem passed to ControlList::addListItem"); // add item to objects vector vecItems.push_back(pListItem); // send all of the items ... this is what it did before. if (sendMessage) sendLabelBind(vecItems.size()); }
// Ok ... we're going to get it even if it doesn't exist. If it doesn't exist then // we're going to assume we're not in control of the interpreter. This (apparently) // can be the case. E.g. Libspotify manages to call into a script using a ctypes // extension but under the control of an Interpreter we know nothing about. In // cases like this we're going to use a global interpreter AddonClass::Ref<PythonLanguageHook> PythonLanguageHook::GetIfExists(PyInterpreterState* interp) { XBMC_TRACE; CSingleLock lock(hooksMutex); std::map<PyInterpreterState*,AddonClass::Ref<PythonLanguageHook> >::iterator iter = hooks.find(interp); if (iter != hooks.end()) return AddonClass::Ref<PythonLanguageHook>(iter->second); // if we got here then we need to use the global one. if (g_languageHook.isNull()) g_languageHook = new XBMCAddon::Python::PythonLanguageHook(); return g_languageHook; }