summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/qws/config.in13
-rw-r--r--core/qws/oqwsserver.cpp2
-rw-r--r--core/qws/oqwsserver.h2
-rw-r--r--core/qws/qws.pro4
-rw-r--r--core/qws/transferserver.cpp47
-rw-r--r--core/qws/transferserver.h15
6 files changed, 37 insertions, 46 deletions
diff --git a/core/qws/config.in b/core/qws/config.in
index 3706405..903eaa1 100644
--- a/core/qws/config.in
+++ b/core/qws/config.in
@@ -2,15 +2,4 @@
2 boolean "Minimal QWS Server" 2 boolean "Minimal QWS Server"
3 default "n" 3 default "n"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && EXPERIMENTAL 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && EXPERIMENTAL
5 5
6# menu "Advanced QWS Server Config"
7# config QWS_QCOP
8# bool "QCop bridge and Transfer server (sync)"
9# default y
10# depends on QWS
11#
12# config QWS_PACKAGE
13# bool "Package Slave (package installs via sync software)"
14# default n
15# depends on QWS
16# endmenu
diff --git a/core/qws/oqwsserver.cpp b/core/qws/oqwsserver.cpp
index 907686a..d6b6504 100644
--- a/core/qws/oqwsserver.cpp
+++ b/core/qws/oqwsserver.cpp
@@ -30,5 +30,5 @@
30#endif 30#endif
31 31
32#include <opie/odevice.h> 32#include <opie2/odevice.h>
33 33
34 34
diff --git a/core/qws/oqwsserver.h b/core/qws/oqwsserver.h
index b95c3fb..c8622d4 100644
--- a/core/qws/oqwsserver.h
+++ b/core/qws/oqwsserver.h
@@ -24,5 +24,5 @@
24 24
25#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
26#include <opie/odevicebutton.h> 26#include <opie2/odevicebutton.h>
27 27
28#include <qwidget.h> 28#include <qwidget.h>
diff --git a/core/qws/qws.pro b/core/qws/qws.pro
index 5656a59..50d0b2b 100644
--- a/core/qws/qws.pro
+++ b/core/qws/qws.pro
@@ -15,6 +15,6 @@ SOURCES = \
15 INCLUDEPATH+= $(OPIEDIR)/include 15 INCLUDEPATH+= $(OPIEDIR)/include
16 DEPENDPATH+= $(OPIEDIR)/include . 16 DEPENDPATH+= $(OPIEDIR)/include .
17 TARGET = op-qws 17 TARGET = qws
18 LIBS += -lqpe -lopie 18 LIBS += -lqpe -lopiecore2 -lopieui2
19 19
20include ( $(OPIEDIR)/include.pro ) 20include ( $(OPIEDIR)/include.pro )
diff --git a/core/qws/transferserver.cpp b/core/qws/transferserver.cpp
index daf63ec..d0fec89 100644
--- a/core/qws/transferserver.cpp
+++ b/core/qws/transferserver.cpp
@@ -65,5 +65,6 @@ extern "C"
65 65
66#include "transferserver.h" 66#include "transferserver.h"
67#include <opie/oprocess.h> 67#include <opie2/oprocess.h>
68using namespace Opie::Core;
68 69
69const int block_size = 51200; 70const int block_size = 51200;
@@ -1050,17 +1051,17 @@ ServerDTP::ServerDTP( QObject *parent, const char* name)
1050 connect( this, SIGNAL( readyRead() ), SLOT( readyRead() ) ); 1051 connect( this, SIGNAL( readyRead() ), SLOT( readyRead() ) );
1051 1052
1052 gzipProc = new OProcess( this, "gzipProc" ); 1053 gzipProc = new Opie::Core::OProcess( this, "gzipProc" );
1053 1054
1054 createTargzProc = new OProcess( QString("tar"), this, "createTargzProc"); 1055 createTargzProc = new Opie::Core::OProcess( QString("tar"), this, "createTargzProc");
1055 createTargzProc->setWorkingDirectory( QDir::rootDirPath() ); 1056 createTargzProc->setWorkingDirectory( QDir::rootDirPath() );
1056 connect( createTargzProc, SIGNAL( processExited(OProcess*) ), SLOT( targzDone() ) ); 1057 connect( createTargzProc, SIGNAL( processExited(Opie::Core::OProcess*) ), SLOT( targzDone() ) );
1057 1058
1058 QStringList args = "tar"; 1059 QStringList args = "tar";
1059 args += "-xv"; 1060 args += "-xv";
1060 retrieveTargzProc = new OProcess( args, this, "retrieveTargzProc" ); 1061 retrieveTargzProc = new Opie::Core::OProcess( args, this, "retrieveTargzProc" );
1061 retrieveTargzProc->setWorkingDirectory( QDir::rootDirPath() ); 1062 retrieveTargzProc->setWorkingDirectory( QDir::rootDirPath() );
1062 connect( retrieveTargzProc, SIGNAL( processExited(OProcess*) ), 1063 connect( retrieveTargzProc, SIGNAL( processExited(Opie::Core::OProcess*) ),
1063 SIGNAL( completed() ) ); 1064 SIGNAL( completed() ) );
1064 connect( retrieveTargzProc, SIGNAL( processExited(OProcess*) ), 1065 connect( retrieveTargzProc, SIGNAL( processExited(Opie::Core::OProcess*) ),
1065 SLOT( extractTarDone() ) ); 1066 SLOT( extractTarDone() ) );
1066} 1067}
@@ -1122,5 +1123,5 @@ void ServerDTP::connected()
1122 bytes_written = 0; 1123 bytes_written = 0;
1123 qDebug("==>start send tar process"); 1124 qDebug("==>start send tar process");
1124 if ( !createTargzProc->start(OProcess::NotifyOnExit, OProcess::Stdout) ) 1125 if ( !createTargzProc->start(Opie::Core::OProcess::NotifyOnExit, Opie::Core::OProcess::Stdout) )
1125 qWarning("Error starting %s or %s", 1126 qWarning("Error starting %s or %s",
1126 createTargzProc->args()[0].data(), 1127 createTargzProc->args()[0].data(),
@@ -1257,5 +1258,5 @@ void ServerDTP::readyRead()
1257 else if ( RetrieveGzipFile == mode ) { 1258 else if ( RetrieveGzipFile == mode ) {
1258 if ( !gzipProc->isRunning() ) 1259 if ( !gzipProc->isRunning() )
1259 gzipProc->start(OProcess::NotifyOnExit, (OProcess::Communication) ( OProcess::Stdin | OProcess::Stdout )); 1260 gzipProc->start(Opie::Core::OProcess::NotifyOnExit, (Opie::Core::OProcess::Communication) ( Opie::Core::OProcess::Stdin | Opie::Core::OProcess::Stdout ));
1260 1261
1261 QByteArray s; 1262 QByteArray s;
@@ -1274,5 +1275,5 @@ void ServerDTP::readyRead()
1274} 1275}
1275 1276
1276void ServerDTP::writeTargzBlock(OProcess *, char *buffer, int buflen) 1277void ServerDTP::writeTargzBlock(Opie::Core::OProcess *, char *buffer, int buflen)
1277{ 1278{
1278 writeBlock( buffer, buflen ); 1279 writeBlock( buffer, buflen );
@@ -1282,6 +1283,6 @@ void ServerDTP::writeTargzBlock(OProcess *, char *buffer, int buflen)
1282 emit completed(); 1283 emit completed();
1283 mode = Idle; 1284 mode = Idle;
1284 disconnect( gzipProc, SIGNAL( receivedStdout(OProcess*,char*,int) ), 1285 disconnect( gzipProc, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
1285 this, SLOT( writeTargzBlock(OProcess*,char*,int) ) ); 1286 this, SLOT( writeTargzBlock(Opie::Core::OProcess*,char*,int) ) );
1286 } 1287 }
1287} 1288}
@@ -1290,15 +1291,15 @@ void ServerDTP::targzDone()
1290{ 1291{
1291 //qDebug("targz done"); 1292 //qDebug("targz done");
1292 disconnect( createTargzProc, SIGNAL( receivedStdout(OProcess*,char*,int) ), 1293 disconnect( createTargzProc, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
1293 this, SLOT( gzipTarBlock(OProcess*,char*,int) ) ); 1294 this, SLOT( gzipTarBlock(Opie::Core::OProcess*,char*,int) ) );
1294 gzipProc->closeStdin(); 1295 gzipProc->closeStdin();
1295} 1296}
1296 1297
1297void ServerDTP::gzipTarBlock(OProcess *, char *buffer, int buflen) 1298void ServerDTP::gzipTarBlock(Opie::Core::OProcess *, char *buffer, int buflen)
1298{ 1299{
1299 //qDebug("gzipTarBlock"); 1300 //qDebug("gzipTarBlock");
1300 if ( !gzipProc->isRunning() ) { 1301 if ( !gzipProc->isRunning() ) {
1301 //qDebug("auto start gzip proc"); 1302 //qDebug("auto start gzip proc");
1302 gzipProc->start(OProcess::NotifyOnExit, (OProcess::Communication) ( OProcess::Stdin | OProcess::Stdout )); 1303 gzipProc->start(Opie::Core::OProcess::NotifyOnExit, (Opie::Core::OProcess::Communication) ( Opie::Core::OProcess::Stdin | Opie::Core::OProcess::Stdout ));
1303 } 1304 }
1304 gzipProc->writeStdin( buffer, buflen ); 1305 gzipProc->writeStdin( buffer, buflen );
@@ -1339,10 +1340,10 @@ void ServerDTP::sendGzipFile( const QString &fn,
1339 *createTargzProc << args; 1340 *createTargzProc << args;
1340 connect( createTargzProc, 1341 connect( createTargzProc,
1341 SIGNAL( receivedStdout(OProcess*,char*,int) ), SLOT( gzipTarBlock(OProcess*,char*,int) ) ); 1342 SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ), SLOT( gzipTarBlock(Opie::Core::OProcess*,char*,int) ) );
1342 1343
1343 gzipProc->clearArguments( ); 1344 gzipProc->clearArguments( );
1344 *gzipProc << "gzip"; 1345 *gzipProc << "gzip";
1345 connect( gzipProc, SIGNAL( receivedStdout(OProcess*,char*,int) ), 1346 connect( gzipProc, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
1346 SLOT( writeTargzBlock(OProcess*,char*,int) ) ); 1347 SLOT( writeTargzBlock(Opie::Core::OProcess*,char*,int) ) );
1347} 1348}
1348 1349
@@ -1353,14 +1354,14 @@ void ServerDTP::gunzipDone()
1353 this, SLOT( gunzipDone() ) ); 1354 this, SLOT( gunzipDone() ) );
1354 retrieveTargzProc->closeStdin(); 1355 retrieveTargzProc->closeStdin();
1355 disconnect( gzipProc, SIGNAL( receivedStdout(OProcess*,char*,int) ), 1356 disconnect( gzipProc, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
1356 this, SLOT( tarExtractBlock(OProcess*,char*,int) ) ); 1357 this, SLOT( tarExtractBlock(Opie::Core::OProcess*,char*,int) ) );
1357} 1358}
1358 1359
1359void ServerDTP::tarExtractBlock(OProcess *, char *buffer, int buflen) 1360void ServerDTP::tarExtractBlock(Opie::Core::OProcess *, char *buffer, int buflen)
1360{ 1361{
1361 qDebug("tarExtractBlock"); 1362 qDebug("tarExtractBlock");
1362 if ( !retrieveTargzProc->isRunning() ) { 1363 if ( !retrieveTargzProc->isRunning() ) {
1363 qDebug("auto start ungzip proc"); 1364 qDebug("auto start ungzip proc");
1364 if ( !retrieveTargzProc->start(OProcess::NotifyOnExit, OProcess::Stdin) ) 1365 if ( !retrieveTargzProc->start(Opie::Core::OProcess::NotifyOnExit, Opie::Core::OProcess::Stdin) )
1365 qWarning(" failed to start tar -x process"); 1366 qWarning(" failed to start tar -x process");
1366 } 1367 }
diff --git a/core/qws/transferserver.h b/core/qws/transferserver.h
index 1c5ab4b..82dae40 100644
--- a/core/qws/transferserver.h
+++ b/core/qws/transferserver.h
@@ -25,5 +25,6 @@
25 25
26class QFileInfo; 26class QFileInfo;
27class OProcess; 27namespace Opie { namespace Core { class OProcess; } }
28
28class TransferServer : public QServerSocket 29class TransferServer : public QServerSocket
29{ 30{
@@ -93,9 +94,9 @@ private slots:
93 void bytesWritten( int bytes ); 94 void bytesWritten( int bytes );
94 void readyRead(); 95 void readyRead();
95 void writeTargzBlock(OProcess *, char *, int); 96 void writeTargzBlock(Opie::Core::OProcess *, char *, int);
96 void targzDone(); 97 void targzDone();
97 98
98 void gzipTarBlock(OProcess *, char *, int); 99 void gzipTarBlock(Opie::Core::OProcess *, char *, int);
99 void tarExtractBlock(OProcess *, char *, int); 100 void tarExtractBlock(Opie::Core::OProcess *, char *, int);
100 void gunzipDone(); 101 void gunzipDone();
101 void extractTarDone(); 102 void extractTarDone();
@@ -107,7 +108,7 @@ private:
107 QFile file; 108 QFile file;
108 QBuffer buf; 109 QBuffer buf;
109 OProcess *createTargzProc; 110 Opie::Core::OProcess *createTargzProc;
110 OProcess *retrieveTargzProc; 111 Opie::Core::OProcess *retrieveTargzProc;
111 OProcess *gzipProc; 112 Opie::Core::OProcess *gzipProc;
112}; 113};
113 114