summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/sz_transfer.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/sz_transfer.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/sz_transfer.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp
index f505998..3299e33 100644
--- a/noncore/apps/opie-console/sz_transfer.cpp
+++ b/noncore/apps/opie-console/sz_transfer.cpp
@@ -37,50 +37,33 @@ void SzTransfer::sendFile(const QString& file) {
37 this, SLOT(receivedStdin(const QByteArray&))); 37 this, SLOT(receivedStdin(const QByteArray&)));
38 proc->start(OProcess::NotifyOnExit, OProcess::All); 38 proc->start(OProcess::NotifyOnExit, OProcess::All);
39 39
40} 40}
41 41
42void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { 42void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) {
43
44 owarn << "recieved from sz on stdout " << buflen << " bytes" << oendl;
45
46 QByteArray data(buflen); 43 QByteArray data(buflen);
47 data.fill(*buffer, buflen); 44 data.fill(*buffer, buflen);
45
46#ifdef DEBUG_RECEIVE
48 for (uint i = 0; i < data.count(); i++ ) { 47 for (uint i = 0; i < data.count(); i++ ) {
49 printf("%c", buffer[i] ); 48 printf("%c", buffer[i] );
50 } 49 }
51 printf("\n"); 50 printf("\n");
51#endif
52 52
53 // send out through the io layer 53 // send out through the io layer
54 layer()->send(data); 54 layer()->send(data);
55} 55}
56 56
57void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) { 57void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) {
58
59 // parse and show data in a progress dialog/widget
60 printf("stderr:\n");
61 //for (int i = 0; i < length; i++)
62 // printf("%c", buffer[i]);
63 //printf("\n");
64} 58}
65 59
66void SzTransfer::receivedStdin(const QByteArray &data) { 60void SzTransfer::receivedStdin(const QByteArray &data) {
67
68 owarn << "recieved from io_serial " << data.size() << " bytes" << oendl;
69
70 // recieved data from the io layer goes to sz 61 // recieved data from the io layer goes to sz
71 proc->writeStdin(data.data(), data.size()); 62 proc->writeStdin(data.data(), data.size());
72
73} 63}
74 64
75void SzTransfer::sent() { 65void SzTransfer::sent() {
76
77 owarn << "sent file" << oendl;
78
79 //setcbreak(0); /* default */
80
81
82 delete proc; 66 delete proc;
83 disconnect(layer(), SIGNAL(received(const QByteArray&)), 67 disconnect(layer(), SIGNAL(received(const QByteArray&)),
84 this, SLOT(receivedStdin(const QByteArray&))); 68 this, SLOT(receivedStdin(const QByteArray&)));
85
86} 69}