summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-09 12:21:39 (UTC)
committer zautrix <zautrix>2005-02-09 12:21:39 (UTC)
commit940cdd0fd1349e7f8e53adff0595c1d946322ef1 (patch) (side-by-side diff)
tree1a78f2c862afbc0d3c019c0905775782c906df64
parent968099947455adc0e8681aedf8c161327e311f38 (diff)
downloadkdepimpi-940cdd0fd1349e7f8e53adff0595c1d946322ef1.zip
kdepimpi-940cdd0fd1349e7f8e53adff0595c1d946322ef1.tar.gz
kdepimpi-940cdd0fd1349e7f8e53adff0595c1d946322ef1.tar.bz2
pisync fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt10
-rw-r--r--libkdepim/ksyncmanager.cpp43
-rw-r--r--libkdepim/ksyncmanager.h6
3 files changed, 42 insertions, 17 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 2275f3a..4f29ca3 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1228,2 +1228,12 @@
{ "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.net --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.net --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" },
+{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." },
+{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." },
+{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." },
+{ "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" },
+{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." },
+{ "Error","Fehler" },
+{ "","" },
+{ "","" },
+{ "","" },
+{ "","" },
{ "","" },
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index df5a0d9..1f5f4c7 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1054,5 +1054,4 @@ void KSyncManager::syncPi()
}
- KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, port, mActiveSyncIP, this );
+ KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() );
connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) );
- mParent->topLevelWidget()->setCaption( i18n("Sending request for remote file ...") );
commandSocket->readFile( syncFileName() );
@@ -1067,3 +1066,3 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state)
if ( state == KCommandSocket::errorR ) {
- KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this );
+ KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget());
connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) );
@@ -1098,3 +1097,3 @@ void KSyncManager::readFileFromSocket()
}
- KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this );
+ KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget() );
connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) );
@@ -1265,3 +1264,3 @@ void KServerSocket::send_file()
while ( ! ts.atEnd() ) {
- os << ts.readLine() << "\r\n";
+ os << ts.readLine() << "\r\n\r\n";
}
@@ -1331,3 +1330,3 @@ void KServerSocket::readBackFileFromSocket()
-KCommandSocket::KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent, const char * name ): QObject( parent, name )
+KCommandSocket::KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent, QWidget * cap, const char * name ): QObject( parent, name )
{
@@ -1335,5 +1334,6 @@ KCommandSocket::KCommandSocket ( QString password, Q_UINT16 port, QString host,
mSocket = 0;
+ mFirst = false;
mPort = port;
mHost = host;
-
+ tlw = cap;
mRetVal = quiet;
@@ -1342,2 +1342,14 @@ KCommandSocket::KCommandSocket ( QString password, Q_UINT16 port, QString host,
}
+void KCommandSocket::sendFileRequest()
+{
+ if ( tlw )
+ tlw->setCaption( i18n("Connected! Sending request for remote file ...") );
+ mTimerSocket->start( 300000 );
+ QTextStream os( mSocket );
+ os.setEncoding( QTextStream::Latin1 );
+
+ QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate );
+ os << "GET " << mPassWord << curDt <<"\r\n\r\n";
+}
+
void KCommandSocket::readFile( QString fn )
@@ -1348,2 +1360,3 @@ void KCommandSocket::readFile( QString fn )
connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
+ connect( mSocket, SIGNAL(connected ()), this, SLOT(sendFileRequest() ));
}
@@ -1352,9 +1365,7 @@ void KCommandSocket::readFile( QString fn )
mFirst = true;
+ if ( tlw )
+ tlw->setCaption( i18n("Trying to connect to remote...") );
mSocket->connectToHost( mHost, mPort );
- QTextStream os( mSocket );
- os.setEncoding( QTextStream::Latin1 );
-
- QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate );
- os << "GET " << mPassWord << curDt <<"\r\n";
- mTimerSocket->start( 300000 );
+ qDebug("KSS: Waiting for connection");
+ mTimerSocket->start( 20000 );
}
@@ -1385,5 +1396,5 @@ void KCommandSocket::writeFileToSocket()
os2.setEncoding( QTextStream::Latin1 );
- os2 << "PUT " << mPassWord << "\r\n";;
+ os2 << "PUT " << mPassWord << "\r\n\r\n";;
while ( ! ts2.atEnd() ) {
- os2 << ts2.readLine() << "\r\n";
+ os2 << ts2.readLine() << "\r\n\r\n";
}
@@ -1404,3 +1415,3 @@ void KCommandSocket::sendStop()
os2.setEncoding( QTextStream::Latin1 );
- os2 << "STOP\r\n";
+ os2 << "STOP\r\n\r\n";
mSocket->close();
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 6d89950..9a3066e 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -77,3 +77,3 @@ class KCommandSocket : public QObject
enum state { successR, errorR, successW, errorW, errorTO, quiet };
- KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, const char * name=0 );
+ KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, QWidget* cap = 0, const char * name=0 );
void readFile( QString );
@@ -82,2 +82,5 @@ class KCommandSocket : public QObject
+ private slots :
+ void sendFileRequest();
+
signals:
@@ -90,2 +93,3 @@ class KCommandSocket : public QObject
private :
+ QWidget* tlw;
QSocket* mSocket;