diff options
| author | 2008-07-13 18:35:12 +0000 | |
|---|---|---|
| committer | 2008-07-13 18:35:12 +0000 | |
| commit | a19e69058ca7bb27715420d830fea9e4c75257fb (patch) | |
| tree | 77f4b492aac4598c3ced66806ecb0c9ece41cd0c /src/modules/dcc/marshal.cpp | |
| parent | scroll the ircview during a selection when the mouse reach borders; partially... (diff) | |
| download | KVIrc-a19e69058ca7bb27715420d830fea9e4c75257fb.tar.gz KVIrc-a19e69058ca7bb27715420d830fea9e4c75257fb.tar.bz2 KVIrc-a19e69058ca7bb27715420d830fea9e4c75257fb.zip | |
fixed not-working dcc (missing ctcp) on 4.0. Probably fixes #173 too
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2067 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/dcc/marshal.cpp')
| -rw-r--r-- | src/modules/dcc/marshal.cpp | 54 |
1 files changed, 5 insertions, 49 deletions
diff --git a/src/modules/dcc/marshal.cpp b/src/modules/dcc/marshal.cpp index 5f6aa6b3b..628889e45 100644 --- a/src/modules/dcc/marshal.cpp +++ b/src/modules/dcc/marshal.cpp @@ -33,6 +33,7 @@ #include <stdlib.h> //for exit() +#include <QTimer> KviDccMarshal::KviDccMarshal(KviDccMarshalOutputContext * ctx) : QObject(0) @@ -40,7 +41,6 @@ KviDccMarshal::KviDccMarshal(KviDccMarshalOutputContext * ctx) setObjectName("dcc_marshal"); m_pSn = 0; m_fd = KVI_INVALID_SOCKET; - m_pTimeoutTimer = 0; m_bIPv6 = false; m_pOutputContext = ctx; #ifdef COMPILE_SSL_SUPPORT @@ -94,11 +94,6 @@ void KviDccMarshal::reset() m_pSSL = 0; } #endif - if(m_pTimeoutTimer) - { - delete m_pTimeoutTimer; - m_pTimeoutTimer = 0; - } m_bIPv6 = false; } @@ -118,25 +113,13 @@ int KviDccMarshal::dccListen(const QString &ip,const QString &port,bool bUseTime #else if(bUseSSL)return KviError_noSSLSupport; #endif - - if(m_pTimeoutTimer)delete m_pTimeoutTimer; - m_pTimeoutTimer = new QTimer(); - connect(m_pTimeoutTimer,SIGNAL(timeout()),this,SLOT(doListen())); -// m_pTimeoutTimer->start(100,true); - m_pTimeoutTimer->setInterval(199); - m_pTimeoutTimer->setSingleShot(true); + QTimer::singleShot(100, this, SLOT(doListen())); return KviError_success; } void KviDccMarshal::doListen() { - if(m_pTimeoutTimer) - { - delete m_pTimeoutTimer; - m_pTimeoutTimer = 0; - } - // Check the address type if(!kvi_isValidStringIp(m_szIp.toUtf8().data())) { @@ -284,13 +267,7 @@ void KviDccMarshal::doListen() KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) = 5; if(m_bUseTimeout) - { - m_pTimeoutTimer = new QTimer(); - connect(m_pTimeoutTimer,SIGNAL(timeout()),this,SLOT(connectionTimedOut())); - //m_pTimeoutTimer->start(KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) * 1000,true); - m_pTimeoutTimer->setInterval(KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) * 1000); - m_pTimeoutTimer->setSingleShot(true); - } + QTimer::singleShot(KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) * 1000, this, SLOT(connectionTimedOut())); // and wait for connect emit inProgress(); @@ -311,23 +288,12 @@ int KviDccMarshal::dccConnect(const char * ip,const char * port,bool bUseTimeout if(bUseSSL)return KviError_noSSLSupport; #endif - if(m_pTimeoutTimer)delete m_pTimeoutTimer; - m_pTimeoutTimer = new QTimer(); - connect(m_pTimeoutTimer,SIGNAL(timeout()),this,SLOT(doConnect())); -// m_pTimeoutTimer->start(100,true); - m_pTimeoutTimer->setInterval(100); - m_pTimeoutTimer->setSingleShot(true); + QTimer::singleShot(100, this, SLOT(doConnect())); return KviError_success; } void KviDccMarshal::doConnect() { - if(m_pTimeoutTimer) - { - delete m_pTimeoutTimer; - m_pTimeoutTimer = 0; - } - // Check the address type if(!kvi_isValidStringIp(m_szIp.toUtf8().data())) { @@ -425,11 +391,7 @@ void KviDccMarshal::doConnect() KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) = 5; if(m_bUseTimeout) - { - m_pTimeoutTimer = new QTimer(); - connect(m_pTimeoutTimer,SIGNAL(timeout()),this,SLOT(connectionTimedOut())); - m_pTimeoutTimer->start(KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) * 1000,true); - } + QTimer::singleShot(KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) * 1000, this, SLOT(connectionTimedOut())); // and wait for connect emit inProgress(); @@ -438,12 +400,6 @@ void KviDccMarshal::doConnect() void KviDccMarshal::snActivated(int) { - if(m_pTimeoutTimer) - { - delete m_pTimeoutTimer; - m_pTimeoutTimer = 0; - } - #ifdef COMPILE_IPV6_SUPPORT struct sockaddr_in6 hostSockAddr6; #endif |
