better solution to add possibility to delete eSocketNotifiers,
[vuplus_dvbapp] / lib / driver / rc.cpp
index d466489..c7acd11 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <lib/base/init.h>
 #include <lib/base/init_num.h>
-#include <lib/base/econfig.h>
 #include <lib/base/eerror.h>
 
 /*
@@ -80,7 +79,7 @@ eRCShortDriver::eRCShortDriver(const char *filename): eRCDriver(eRCInput::getIns
                sn=0;
        } else
        {
-               sn=new eSocketNotifier(eApp, handle, eSocketNotifier::Read);
+               sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
                CONNECT(sn->activated, eRCShortDriver::keyPressed);
                eRCInput::getInstance()->setFile(handle);
        }
@@ -90,8 +89,6 @@ eRCShortDriver::~eRCShortDriver()
 {
        if (handle>=0)
                close(handle);
-       if (sn)
-               delete sn;
 }
 
 void eRCInputEventDriver::keyPressed(int)
@@ -103,7 +100,7 @@ void eRCInputEventDriver::keyPressed(int)
                        break;
                if (enabled && !input->islocked())
                        for (std::list<eRCDevice*>::iterator i(listeners.begin()); i!=listeners.end(); ++i)
-                               (*i)->handleCode((int)&ev);
+                               (*i)->handleCode((long)&ev);
        }
 }
 
@@ -116,7 +113,7 @@ eRCInputEventDriver::eRCInputEventDriver(const char *filename): eRCDriver(eRCInp
                sn=0;
        } else
        {
-               sn=new eSocketNotifier(eApp, handle, eSocketNotifier::Read);
+               sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
                CONNECT(sn->activated, eRCInputEventDriver::keyPressed);
                eRCInput::getInstance()->setFile(handle);
        }
@@ -134,8 +131,6 @@ eRCInputEventDriver::~eRCInputEventDriver()
 {
        if (handle>=0)
                close(handle);
-       if (sn)
-               delete sn;
 }
 
 eRCConfig::eRCConfig()
@@ -158,15 +153,10 @@ void eRCConfig::reload()
 {
        rdelay=500;
        rrate=100;
-       if ( eConfig::getInstance()->getKey("/ezap/rc/repeatRate", rrate) )
-               save();
-       eConfig::getInstance()->getKey("/ezap/rc/repeatDelay", rdelay);
 }
 
 void eRCConfig::save()
 {
-       eConfig::getInstance()->setKey("/ezap/rc/repeatRate", rrate);
-       eConfig::getInstance()->setKey("/ezap/rc/repeatDelay", rdelay);
 }
 
 eRCInput *eRCInput::instance;
@@ -177,7 +167,7 @@ eRCInput::eRCInput()
        instance=this;
        handle = -1;
        locked = 0;
-       keyboardMode = kmAll;
+       keyboardMode = kmNone;
 }
 
 eRCInput::~eRCInput()