From 6a9726437a59cf3b18bf57d6e20fb2dfaaa2fc34 Mon Sep 17 00:00:00 2001 From: zecke Date: Sun, 13 Oct 2002 15:31:12 +0000 Subject: Move some stuff in filetransfer around make pid == 0 after a finished process. Introduce the FileReceive class it does not parse progress though --- (limited to 'noncore/apps/opie-console/filetransfer.cpp') diff --git a/noncore/apps/opie-console/filetransfer.cpp b/noncore/apps/opie-console/filetransfer.cpp index 14787f6..8ca0df2 100644 --- a/noncore/apps/opie-console/filetransfer.cpp +++ b/noncore/apps/opie-console/filetransfer.cpp @@ -17,6 +17,7 @@ FileTransfer::FileTransfer( Type t, IOLayer* lay ) : FileTransferLayer( lay ), m_type( t ), m_pid ( 0 ) { signal(SIGPIPE, SIG_IGN ); + m_pid = 0; m_not = 0l; m_proc = 0l; } @@ -48,6 +49,7 @@ void FileTransfer::sendFile( const QString& file ) { switch( m_pid ) { case -1: emit error( StartError, tr("Was not able to fork") ); + slotExec(); break; case 0:{ setupChild(); @@ -177,7 +179,6 @@ void FileTransfer::slotRead() { */ if ( lis[0].simplifyWhiteSpace() == "Transfer" ) { qWarning("sent!!!!"); - emit sent(); return; } /* @@ -236,7 +237,7 @@ void FileTransfer::slotProgress( const QStringList& list ) { } void FileTransfer::cancel() { if(m_pid > 0) ::kill(m_pid,9 ); - delete m_not; + } void FileTransfer::slotExec() { qWarning("exited!"); @@ -249,5 +250,7 @@ void FileTransfer::slotExec() { close( m_term[1] ); close( m_comm[0] ); close( m_comm[1] ); + layer()->closeRawIO( m_fd ); emit sent(); + m_pid = 0; } -- cgit v0.9.0.2