From 85d0ce2142b5860ce5375d2b6228e70c04d3a32c Mon Sep 17 00:00:00 2001 From: Noldor Date: Thu, 29 Jul 2010 14:49:26 +0000 Subject: More fixes in kvs classes memory leaks git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4709 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/objects/class_ftp.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/modules/objects/class_ftp.cpp') diff --git a/src/modules/objects/class_ftp.cpp b/src/modules/objects/class_ftp.cpp index ff5127141..bba0fd5c0 100644 --- a/src/modules/objects/class_ftp.cpp +++ b/src/modules/objects/class_ftp.cpp @@ -252,8 +252,11 @@ void KviKvsObject_ftp::slotCommandFinished ( int id, bool error ) else if (m_pFtp->currentCommand()==QFtp:: Login) status="logged"; else if (m_pFtp->currentCommand()==QFtp:: Cd) status="entered"; else if (m_pFtp->currentCommand()==QFtp:: List) status="listCompleted"; - callFunction(this,"commandFinishedEvent",0,new KviKvsVariantList(new KviKvsVariant((kvs_int_t) id), - new KviKvsVariant(status),new KviKvsVariant(error))); + KviKvsVariantList lParams; + lParams.append(new KviKvsVariant((kvs_int_t) id)); + lParams.append(new KviKvsVariant(status)); + lParams.append(new KviKvsVariant(error)); + callFunction(this,"commandFinishedEvent",0,&lParams); } void KviKvsObject_ftp::slotCommandStarted ( int ) @@ -262,8 +265,10 @@ void KviKvsObject_ftp::slotCommandStarted ( int ) void KviKvsObject_ftp::slotDataTransferProgress ( qint64 done, qint64 total ) { - callFunction(this,"dataTransferProgressEvent",0,new KviKvsVariantList( - new KviKvsVariant((kvs_int_t) done),new KviKvsVariant((kvs_int_t) total))); + KviKvsVariantList lParams; + lParams.append(new KviKvsVariant((kvs_int_t) done)); + lParams.append(new KviKvsVariant((kvs_int_t) total)); + callFunction(this,"dataTransferProgressEvent",0,&lParams); } KVSO_CLASS_FUNCTION(ftp,dataTransferProgressEvent) @@ -278,7 +283,9 @@ void KviKvsObject_ftp::slotDone ( bool ) void KviKvsObject_ftp::slotListInfo ( const QUrlInfo & i ) { - callFunction(this,"listInfoEvent",0,new KviKvsVariantList(new KviKvsVariant(i.name()))); + KviKvsVariantList lParams; + lParams.append(new KviKvsVariant(i.name())); + callFunction(this,"listInfoEvent",0,&lParams); } KVSO_CLASS_FUNCTION(ftp,listInfoEvent) @@ -304,8 +311,9 @@ void KviKvsObject_ftp::slotStateChanged (int state) else if (state==QFtp::Connected) szState="Connected"; else if (state==QFtp::LoggedIn) szState="LoggedIn"; else if (state==QFtp::Closing) szState="Closing"; - callFunction(this,"stateChangedEvent",0,new KviKvsVariantList( - new KviKvsVariant(szState))); + KviKvsVariantList lParams; + lParams.append(new KviKvsVariant(szState)); + callFunction(this,"stateChangedEvent",0,&lParams); } KVSO_CLASS_FUNCTION(ftp,stateChangedEvent) -- cgit v1.3.1-10-gc9f91