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.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp index 2f82417..5958e93 100644 --- a/noncore/apps/opie-console/sz_transfer.cpp +++ b/noncore/apps/opie-console/sz_transfer.cpp | |||
@@ -1,44 +1,46 @@ | |||
1 | 1 | ||
2 | #include "sz_transfer.h" | 2 | #include "sz_transfer.h" |
3 | #include <qfile.h> | 3 | #include <qfile.h> |
4 | #include <stdio.h> | 4 | #include <stdio.h> |
5 | #include <sys/termios.h> | 5 | #include <sys/termios.h> |
6 | 6 | ||
7 | 7 | ||
8 | 8 | ||
9 | using namespace Opie::Core; | ||
10 | using namespace Opie::Core; | ||
9 | SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) | 11 | SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) |
10 | { | 12 | { |
11 | } | 13 | } |
12 | 14 | ||
13 | SzTransfer::~SzTransfer() { | 15 | SzTransfer::~SzTransfer() { |
14 | } | 16 | } |
15 | 17 | ||
16 | void SzTransfer::sendFile(const QFile& file) { | 18 | void SzTransfer::sendFile(const QFile& file) { |
17 | 19 | ||
18 | sendFile(file.name()); | 20 | sendFile(file.name()); |
19 | } | 21 | } |
20 | 22 | ||
21 | void SzTransfer::sendFile(const QString& file) { | 23 | void SzTransfer::sendFile(const QString& file) { |
22 | 24 | ||
23 | //setcbreak(2); /* raw no echo */ | 25 | //setcbreak(2); /* raw no echo */ |
24 | 26 | ||
25 | proc = new OProcess; | 27 | proc = new OProcess; |
26 | *proc << "sz"; | 28 | *proc << "sz"; |
27 | *proc << "-v" << "-v" << "-b" << file; | 29 | *proc << "-v" << "-v" << "-b" << file; |
28 | connect(proc, SIGNAL(processExited(OProcess*)), | 30 | connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)), |
29 | this, SLOT(sent())); | 31 | this, SLOT(sent())); |
30 | connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)), | 32 | connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)), |
31 | this, SLOT(SzReceivedStdout(OProcess*,char*,int))); | 33 | this, SLOT(SzReceivedStdout(OProcess*,char*,int))); |
32 | connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)), | 34 | connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), |
33 | this, SLOT(SzReceivedStderr(OProcess*,char*,int))); | 35 | this, SLOT(SzReceivedStderr(OProcess*,char*,int))); |
34 | connect(layer(), SIGNAL(received(const QByteArray&)), | 36 | connect(layer(), SIGNAL(received(const QByteArray&)), |
35 | this, SLOT(receivedStdin(const QByteArray&))); | 37 | this, SLOT(receivedStdin(const QByteArray&))); |
36 | proc->start(OProcess::NotifyOnExit, OProcess::All); | 38 | proc->start(OProcess::NotifyOnExit, OProcess::All); |
37 | 39 | ||
38 | } | 40 | } |
39 | 41 | ||
40 | void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { | 42 | void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { |
41 | 43 | ||
42 | qWarning("recieved from sz on stdout %d bytes", buflen); | 44 | qWarning("recieved from sz on stdout %d bytes", buflen); |
43 | 45 | ||
44 | QByteArray data(buflen); | 46 | QByteArray data(buflen); |