-rw-r--r-- | noncore/apps/opie-console/sz_transfer.cpp | 35 | ||||
-rw-r--r-- | noncore/apps/opie-console/sz_transfer.h | 7 |
2 files changed, 29 insertions, 13 deletions
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp index 10f3f7a..a5af2be 100644 --- a/noncore/apps/opie-console/sz_transfer.cpp +++ b/noncore/apps/opie-console/sz_transfer.cpp | |||
@@ -4,2 +4,3 @@ | |||
4 | #include <opie/oprocess.h> | 4 | #include <opie/oprocess.h> |
5 | #include <stdio.h> | ||
5 | 6 | ||
@@ -21,11 +22,11 @@ void SzTransfer::sendFile(const QString& file) { | |||
21 | *proc << "sz"; | 22 | *proc << "sz"; |
22 | *proc << "-vv" << file; | 23 | *proc << "-v" << "-v" << "-v" << "-b" << file; |
23 | connect(proc, SIGNAL(processExited(OProcess *)), | 24 | connect(proc, SIGNAL(processExited(OProcess *)), |
24 | this, SLOT(sent())); | 25 | this, SLOT(sent())); |
25 | connect(proc, SIGNAL(processRecievedStdout(OProcess *, char *, int)), | 26 | connect(proc, SIGNAL(receivedStdout(OProcess *, char *, int)), |
26 | this, SLOT(SzRecievedStdout(OProcess *, char *, int))); | 27 | this, SLOT(SzReceivedStdout(OProcess *, char *, int))); |
27 | connect(proc, SIGNAL(processRecievedStderr(OProcess *, char *, int)), | 28 | connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), |
28 | this, SLOT(SzRecievedStderr(OProcess *, char *, int))); | 29 | this, SLOT(SzReceivedStderr(OProcess *, char *, int))); |
29 | connect(layer(), SIGNAL(received(QByteArray &)), | 30 | connect(layer(), SIGNAL(received(const QByteArray &)), |
30 | this, SLOT(recievedStdin(QByteArray &))); | 31 | this, SLOT(receivedStdin(const QByteArray &))); |
31 | proc->start(OProcess::NotifyOnExit, OProcess::All); | 32 | proc->start(OProcess::NotifyOnExit, OProcess::All); |
@@ -34,3 +35,5 @@ void SzTransfer::sendFile(const QString& file) { | |||
34 | 35 | ||
35 | void SzTransfer::SzRecievedStdout(OProcess *, char *buffer, int buflen) { | 36 | void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { |
37 | |||
38 | qWarning("recieved from sz %d bytes", buflen); | ||
36 | 39 | ||
@@ -43,9 +46,13 @@ void SzTransfer::SzRecievedStdout(OProcess *, char *buffer, int buflen) { | |||
43 | 46 | ||
44 | void SzTransfer::SzRecievedStderr(OProcess *, char *, int) { | 47 | void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) { |
45 | 48 | ||
46 | // parse and show data in a progress dialog/widget | 49 | // parse and show data in a progress dialog/widget |
50 | printf("\n"); | ||
51 | for (int i = 0; i < length; i++) | ||
52 | printf("%c", buffer[i]); | ||
47 | } | 53 | } |
48 | 54 | ||
49 | void SzTransfer::recievedStdin(QByteArray &data) { | 55 | void SzTransfer::receivedStdin(const QByteArray &data) { |
50 | 56 | ||
57 | qWarning("recieved from io_serial %d bytes", data.size()); | ||
51 | // recieved data from the io layer goes to sz | 58 | // recieved data from the io layer goes to sz |
@@ -54 +61,9 @@ void SzTransfer::recievedStdin(QByteArray &data) { | |||
54 | } | 61 | } |
62 | |||
63 | void SzTransfer::sent() { | ||
64 | |||
65 | qWarning("sent file"); | ||
66 | delete proc; | ||
67 | disconnect(layer(), SIGNAL(received(const QByteArray &)), | ||
68 | this, SLOT(receivedStdin(const QByteArray &))); | ||
69 | } | ||
diff --git a/noncore/apps/opie-console/sz_transfer.h b/noncore/apps/opie-console/sz_transfer.h index 825680d..d3e6621 100644 --- a/noncore/apps/opie-console/sz_transfer.h +++ b/noncore/apps/opie-console/sz_transfer.h | |||
@@ -26,7 +26,8 @@ public slots: | |||
26 | void sendFile( const QFile& ); | 26 | void sendFile( const QFile& ); |
27 | void sent(); | ||
27 | 28 | ||
28 | private slots: | 29 | private slots: |
29 | void SzRecievedStdout(OProcess *, char *, int); | 30 | void SzReceivedStdout(OProcess *, char *, int); |
30 | void SzRecievedStderr(OProcess *, char *, int); | 31 | void SzReceivedStderr(OProcess *, char *, int); |
31 | void recievedStdin(QByteArray &); | 32 | void receivedStdin(const QByteArray &); |
32 | 33 | ||