NFIFlash: hide hdd and other mounts (#480)
[vuplus_dvbapp] / lib / python / connections.cpp
index c24c939..c0d38f8 100644 (file)
@@ -1,9 +1,40 @@
 #include <lib/python/connections.h>
 
-PSignal1<void,int> testsignal;
+PSignal::PSignal()
+{
+}
+
+PSignal::~PSignal()
+{
+       Py_XDECREF(m_list);
+}
 
-void connect(Slot1<void, int> &slot, PyObject *fnc)
+void PSignal::callPython(ePyObject tuple)
 {
-       printf("CONNECT !\n");
+       int size = PyList_Size(m_list);
+       int i;
+       for (i=0; i<size; ++i)
+       {
+               ePyObject b = PyList_GET_ITEM(m_list, i);
+               ePython::call(b, tuple);
+       }
 }
 
+PyObject *PSignal::get()
+{
+       if (!m_list)
+               m_list = PyList_New(0);
+       Py_INCREF(m_list);
+       return m_list;
+}
+
+PyObject *PSignal::getSteal(bool clear)
+{
+       if (clear)
+       {
+               ePyObject ret = m_list;
+               m_list = (PyObject*)0;
+               return ret;
+       }
+       return m_list;
+}