summaryrefslogtreecommitdiff
authorhash <hash>2002-10-07 07:38:11 (UTC)
committer hash <hash>2002-10-07 07:38:11 (UTC)
commit2ff05a9340c34116723abba578b383e1bf958552 (patch) (unidiff)
treea350a64a28745d37d55935f31978bb4677272a97
parent82c55f5dbe4d621019b9b9f153e85af0ce52799e (diff)
downloadopie-2ff05a9340c34116723abba578b383e1bf958552.zip
opie-2ff05a9340c34116723abba578b383e1bf958552.tar.gz
opie-2ff05a9340c34116723abba578b383e1bf958552.tar.bz2
returned to the orignal state \(i hope\)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/file_layer.cpp44
1 files changed, 0 insertions, 44 deletions
diff --git a/noncore/apps/opie-console/file_layer.cpp b/noncore/apps/opie-console/file_layer.cpp
index 4830f3b..79caa8a 100644
--- a/noncore/apps/opie-console/file_layer.cpp
+++ b/noncore/apps/opie-console/file_layer.cpp
@@ -1,66 +1,22 @@
1/*
2 * <zecke> what you would simply do is connect stdout of the sz process
3 * <zecke> to the send slot of the IOLayer
4 * <zecke> and stdin to the receive signal of IOlayer
5 * <zecke> on stderr you can see the progress
6 */
7
8#include "file_layer.h" 1#include "file_layer.h"
9#include <qfile.h> 2#include <qfile.h>
10#include <opie/oprocess.h> 3#include <opie/oprocess.h>
11 4
12FileTransferLayer::FileTransferLayer(IOLayer *layer) 5FileTransferLayer::FileTransferLayer(IOLayer *layer)
13 : QObject(), m_layer( layer ) 6 : QObject(), m_layer( layer )
14{ 7{
15} 8}
16 9
17FileTransferLayer::~FileTransferLayer() { 10FileTransferLayer::~FileTransferLayer() {
18} 11}
19 12
20void FileTransferLayer::sendFile(const QFile& file) { 13void FileTransferLayer::sendFile(const QFile& file) {
21 14
22 sendFile(file.name());
23} 15}
24 16
25void FileTransferLayer::sendFile(const QString& file) { 17void FileTransferLayer::sendFile(const QString& file) {
26
27 proc = new OProcess;
28 *proc << "sz";
29 *proc << "-vv" << file;
30 connect(proc, SIGNAL(processExited(OProcess *)),
31 this, SLOT(sent()));
32 connect(proc, SIGNAL(processRecievedStdout(OProcess *, char *, int)),
33 this, SLOT(SzRecievedStdout(OProcess *, char *, int)));
34 connect(proc, SIGNAL(processRecievedStderr(OProcess *, char *, int)),
35 this, SLOT(SzRecievedStderr(OProcess *, char *, int)));
36 connect(m_layer, SIGNAL(received(QByteArray &)),
37 this, SLOT(recievedStdin(QByteArray &)));
38 proc->start(OProcess::NotifyOnExit, OProcess::All);
39
40} 18}
41 19
42IOLayer* FileTransferLayer::layer() { 20IOLayer* FileTransferLayer::layer() {
43 return m_layer; 21 return m_layer;
44} 22}
45
46
47void FileTransferLayer::SzRecievedStdout(OProcess *, char *buffer, int buflen) {
48
49 QByteArray data(buflen);
50 data.fill(*buffer, buflen);
51
52 // send out through the io layer
53 m_layer->send(data);
54}
55
56void FileTransferLayer::SzRecievedStderr(OProcess *, char *, int) {
57
58 // parse and show data in a progress dialog/widget
59}
60
61void FileTransferLayer::recievedStdin(QByteArray &data) {
62
63 // recieved data from the io layer goes to sz
64 proc->writeStdin(data.data(), data.size());
65
66}