author | zecke <zecke> | 2002-10-12 21:18:46 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-12 21:18:46 (UTC) |
commit | 9b33ff5f74c30a5a4905093715a6f345edee26ab (patch) (unidiff) | |
tree | eb0155744adb8c0901e27e001c7e09fc8c789369 /noncore/apps/opie-console/filetransfer.cpp | |
parent | 3eb9678dfab4d152858b7f72c7f0c057fe393541 (diff) | |
download | opie-9b33ff5f74c30a5a4905093715a6f345edee26ab.zip opie-9b33ff5f74c30a5a4905093715a6f345edee26ab.tar.gz opie-9b33ff5f74c30a5a4905093715a6f345edee26ab.tar.bz2 |
Calmed down... 2nd try after merge
Use MetaFactory cuase it's so nice and avoids thousands of if() else if
stuff
Fix a bug in filetransfer where cancel after exit leaded to a crash cause
of bogus adresses in the QSocketNotifiers..
Diffstat (limited to 'noncore/apps/opie-console/filetransfer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/filetransfer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/filetransfer.cpp b/noncore/apps/opie-console/filetransfer.cpp index b39dc95..8e86ebb 100644 --- a/noncore/apps/opie-console/filetransfer.cpp +++ b/noncore/apps/opie-console/filetransfer.cpp | |||
@@ -182,24 +182,26 @@ void FileTransfer::slotRead() { | |||
182 | } | 182 | } |
183 | /* | 183 | /* |
184 | * do progress reading | 184 | * do progress reading |
185 | */ | 185 | */ |
186 | slotProgress( lis ); | 186 | slotProgress( lis ); |
187 | 187 | ||
188 | 188 | ||
189 | } | 189 | } |
190 | /* | 190 | /* |
191 | * find the progress | 191 | * find the progress |
192 | */ | 192 | */ |
193 | void FileTransfer::slotProgress( const QStringList& list ) { | 193 | void FileTransfer::slotProgress( const QStringList& list ) { |
194 | if ( m_type != SZ ) | ||
195 | return; | ||
194 | bool complete = true; | 196 | bool complete = true; |
195 | int min, sec; | 197 | int min, sec; |
196 | int bps; | 198 | int bps; |
197 | unsigned long sent, total; | 199 | unsigned long sent, total; |
198 | 200 | ||
199 | min = sec = bps = -1; | 201 | min = sec = bps = -1; |
200 | sent = total = 0; | 202 | sent = total = 0; |
201 | 203 | ||
202 | // Data looks like this | 204 | // Data looks like this |
203 | // 0 1 2 3 4 5 | 205 | // 0 1 2 3 4 5 |
204 | // Bytes Sent 65536/11534336 BPS:7784 ETA 24:33 | 206 | // Bytes Sent 65536/11534336 BPS:7784 ETA 24:33 |
205 | QStringList progi = QStringList::split('/', list[2].simplifyWhiteSpace() ); | 207 | QStringList progi = QStringList::split('/', list[2].simplifyWhiteSpace() ); |
@@ -233,18 +235,19 @@ void FileTransfer::slotProgress( const QStringList& list ) { | |||
233 | 235 | ||
234 | } | 236 | } |
235 | void FileTransfer::cancel() { | 237 | void FileTransfer::cancel() { |
236 | ::kill(m_pid,9 ); | 238 | ::kill(m_pid,9 ); |
237 | delete m_not; | 239 | delete m_not; |
238 | } | 240 | } |
239 | void FileTransfer::slotExec() { | 241 | void FileTransfer::slotExec() { |
240 | qWarning("exited!"); | 242 | qWarning("exited!"); |
241 | char buf[2]; | 243 | char buf[2]; |
242 | ::read(m_term[0], buf, 1 ); | 244 | ::read(m_term[0], buf, 1 ); |
243 | delete m_proc; | 245 | delete m_proc; |
244 | delete m_not; | 246 | delete m_not; |
247 | m_proc = m_not = 0l; | ||
245 | close( m_term[0] ); | 248 | close( m_term[0] ); |
246 | close( m_term[1] ); | 249 | close( m_term[1] ); |
247 | close( m_comm[0] ); | 250 | close( m_comm[0] ); |
248 | close( m_comm[1] ); | 251 | close( m_comm[1] ); |
249 | emit sent(); | 252 | emit sent(); |
250 | } | 253 | } |