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, 0 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/filetransfer.cpp b/noncore/apps/opie-console/filetransfer.cpp index 7b75d35..7fd9f37 100644 --- a/noncore/apps/opie-console/filetransfer.cpp +++ b/noncore/apps/opie-console/filetransfer.cpp | |||
@@ -203,43 +203,40 @@ void FileTransfer::slotProgress( const QStringList& list ) { | |||
203 | min = sec = bps = -1; | 203 | min = sec = bps = -1; |
204 | sent = total = 0; | 204 | sent = total = 0; |
205 | 205 | ||
206 | // Data looks like this | 206 | // Data looks like this |
207 | // 0 1 2 3 4 5 | 207 | // 0 1 2 3 4 5 |
208 | // Bytes Sent 65536/11534336 BPS:7784 ETA 24:33 | 208 | // Bytes Sent 65536/11534336 BPS:7784 ETA 24:33 |
209 | QStringList progi = QStringList::split('/', list[2].simplifyWhiteSpace() ); | 209 | QStringList progi = QStringList::split('/', list[2].simplifyWhiteSpace() ); |
210 | sent = progi[0].toULong(&complete ); | 210 | sent = progi[0].toULong(&complete ); |
211 | if (!complete ) return; | 211 | if (!complete ) return; |
212 | 212 | ||
213 | total = progi[1].toULong(&complete ); | 213 | total = progi[1].toULong(&complete ); |
214 | if (!complete || total == 0) { | 214 | if (!complete || total == 0) { |
215 | qWarning("returning!!"); | ||
216 | return; | 215 | return; |
217 | } | 216 | } |
218 | 217 | ||
219 | qWarning("%s, %d, %d", progi.join("/").latin1(), sent, total ); | 218 | qWarning("%s, %d, %d", progi.join("/").latin1(), sent, total ); |
220 | 219 | ||
221 | double pro = (double)sent/total; | 220 | double pro = (double)sent/total; |
222 | int prog = pro * 100; | 221 | int prog = pro * 100; |
223 | 222 | ||
224 | // speed | 223 | // speed |
225 | progi = QStringList::split(':', list[3].simplifyWhiteSpace() ); | 224 | progi = QStringList::split(':', list[3].simplifyWhiteSpace() ); |
226 | bps = progi[1].toInt(); | 225 | bps = progi[1].toInt(); |
227 | 226 | ||
228 | // time | 227 | // time |
229 | progi = QStringList::split(':', list[5].simplifyWhiteSpace() ); | 228 | progi = QStringList::split(':', list[5].simplifyWhiteSpace() ); |
230 | min = progi[0].toInt(); | 229 | min = progi[0].toInt(); |
231 | sec = progi[1].toInt(); | 230 | sec = progi[1].toInt(); |
232 | 231 | ||
233 | 232 | ||
234 | qWarning("Prog!:%d", prog ); | ||
235 | if ( prog > m_prog ) { | 233 | if ( prog > m_prog ) { |
236 | m_prog = prog; | 234 | m_prog = prog; |
237 | emit progress(m_file, m_prog, bps, -1, min , sec ); | 235 | emit progress(m_file, m_prog, bps, -1, min , sec ); |
238 | qWarning("Progress: %s, %d\%, %d, %d:%d", m_file.latin1(), m_prog, bps, min, sec ); | ||
239 | } | 236 | } |
240 | 237 | ||
241 | } | 238 | } |
242 | void FileTransfer::cancel() { | 239 | void FileTransfer::cancel() { |
243 | ::kill(m_pid,9 ); | 240 | ::kill(m_pid,9 ); |
244 | delete m_not; | 241 | delete m_not; |
245 | } | 242 | } |