-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 @@ #include <opie/oprocess.h> +#include <stdio.h> @@ -21,11 +22,11 @@ void SzTransfer::sendFile(const QString& file) { *proc << "sz"; - *proc << "-vv" << file; + *proc << "-v" << "-v" << "-v" << "-b" << file; connect(proc, SIGNAL(processExited(OProcess *)), this, SLOT(sent())); - connect(proc, SIGNAL(processRecievedStdout(OProcess *, char *, int)), - this, SLOT(SzRecievedStdout(OProcess *, char *, int))); - connect(proc, SIGNAL(processRecievedStderr(OProcess *, char *, int)), - this, SLOT(SzRecievedStderr(OProcess *, char *, int))); - connect(layer(), SIGNAL(received(QByteArray &)), - this, SLOT(recievedStdin(QByteArray &))); + connect(proc, SIGNAL(receivedStdout(OProcess *, char *, int)), + this, SLOT(SzReceivedStdout(OProcess *, char *, int))); + connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), + this, SLOT(SzReceivedStderr(OProcess *, char *, int))); + connect(layer(), SIGNAL(received(const QByteArray &)), + this, SLOT(receivedStdin(const QByteArray &))); proc->start(OProcess::NotifyOnExit, OProcess::All); @@ -34,3 +35,5 @@ void SzTransfer::sendFile(const QString& file) { -void SzTransfer::SzRecievedStdout(OProcess *, char *buffer, int buflen) { +void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { + + qWarning("recieved from sz %d bytes", buflen); @@ -43,9 +46,13 @@ void SzTransfer::SzRecievedStdout(OProcess *, char *buffer, int buflen) { -void SzTransfer::SzRecievedStderr(OProcess *, char *, int) { +void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) { // parse and show data in a progress dialog/widget + printf("\n"); + for (int i = 0; i < length; i++) + printf("%c", buffer[i]); } -void SzTransfer::recievedStdin(QByteArray &data) { +void SzTransfer::receivedStdin(const QByteArray &data) { + qWarning("recieved from io_serial %d bytes", data.size()); // recieved data from the io layer goes to sz @@ -54 +61,9 @@ void SzTransfer::recievedStdin(QByteArray &data) { } + +void SzTransfer::sent() { + + qWarning("sent file"); + delete proc; + disconnect(layer(), SIGNAL(received(const QByteArray &)), + this, SLOT(receivedStdin(const QByteArray &))); +} 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: void sendFile( const QFile& ); + void sent(); private slots: - void SzRecievedStdout(OProcess *, char *, int); - void SzRecievedStderr(OProcess *, char *, int); - void recievedStdin(QByteArray &); + void SzReceivedStdout(OProcess *, char *, int); + void SzReceivedStderr(OProcess *, char *, int); + void receivedStdin(const QByteArray &); |