summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/sz_transfer.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/sz_transfer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/sz_transfer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp
index 5958e93..fbc5306 100644
--- a/noncore/apps/opie-console/sz_transfer.cpp
+++ b/noncore/apps/opie-console/sz_transfer.cpp
@@ -9,51 +9,51 @@
9using namespace Opie::Core; 9using namespace Opie::Core;
10using namespace Opie::Core; 10using namespace Opie::Core;
11SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) 11SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t)
12{ 12{
13} 13}
14 14
15SzTransfer::~SzTransfer() { 15SzTransfer::~SzTransfer() {
16} 16}
17 17
18void SzTransfer::sendFile(const QFile& file) { 18void SzTransfer::sendFile(const QFile& file) {
19 19
20 sendFile(file.name()); 20 sendFile(file.name());
21} 21}
22 22
23void SzTransfer::sendFile(const QString& file) { 23void SzTransfer::sendFile(const QString& file) {
24 24
25 //setcbreak(2); /* raw no echo */ 25 //setcbreak(2); /* raw no echo */
26 26
27 proc = new OProcess; 27 proc = new OProcess;
28 *proc << "sz"; 28 *proc << "sz";
29 *proc << "-v" << "-v" << "-b" << file; 29 *proc << "-v" << "-v" << "-b" << file;
30 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)), 30 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)),
31 this, SLOT(sent())); 31 this, SLOT(sent()));
32 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)), 32 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
33 this, SLOT(SzReceivedStdout(OProcess*,char*,int))); 33 this, SLOT(SzReceivedStdout(Opie::Core::OProcess*,char*,int)));
34 connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), 34 connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),
35 this, SLOT(SzReceivedStderr(OProcess*,char*,int))); 35 this, SLOT(SzReceivedStderr(Opie::Core::OProcess*,char*,int)));
36 connect(layer(), SIGNAL(received(const QByteArray&)), 36 connect(layer(), SIGNAL(received(const QByteArray&)),
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 43
44 qWarning("recieved from sz on stdout %d bytes", buflen); 44 qWarning("recieved from sz on stdout %d bytes", buflen);
45 45
46 QByteArray data(buflen); 46 QByteArray data(buflen);
47 data.fill(*buffer, buflen); 47 data.fill(*buffer, buflen);
48 for (uint i = 0; i < data.count(); i++ ) { 48 for (uint i = 0; i < data.count(); i++ ) {
49 printf("%c", buffer[i] ); 49 printf("%c", buffer[i] );
50 } 50 }
51 printf("\n"); 51 printf("\n");
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 58
59 // parse and show data in a progress dialog/widget 59 // parse and show data in a progress dialog/widget