author | zautrix <zautrix> | 2004-10-07 13:22:40 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-07 13:22:40 (UTC) |
commit | d14d61ebb2e41329465883a0dfce719d69fc3f3e (patch) (side-by-side diff) | |
tree | 39330d3848e530f9ba8deac4086685674acdc839 | |
parent | 826dc960353e47a60aba13916189c45ef3392c1e (diff) | |
download | kdepimpi-d14d61ebb2e41329465883a0dfce719d69fc3f3e.zip kdepimpi-d14d61ebb2e41329465883a0dfce719d69fc3f3e.tar.gz kdepimpi-d14d61ebb2e41329465883a0dfce719d69fc3f3e.tar.bz2 |
utf8 fixes
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index a663427..28af135 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -929,20 +929,20 @@ void KServerSocket::send_file() mSocket->close(); if ( mSocket->state() == QSocket::Idle ) QTimer::singleShot( 10, this , SLOT ( discardClient())); return ; } mSyncActionDialog->setCaption( i18n("Sending file...") ); QTextStream ts( &file ); - ts.setCodec( QTextCodec::codecForName("utf8") ); + ts.setEncoding( QTextStream::Latin1 ); + QTextStream os( mSocket ); - os.setCodec( QTextCodec::codecForName("utf8") ); - //os.setEncoding( QTextStream::UnicodeUTF8 ); + os.setEncoding( QTextStream::Latin1 ); while ( ! ts.atEnd() ) { os << ts.readLine() << "\n"; } //os << ts.read(); file.close(); mSyncActionDialog->setCaption( i18n("Waiting for synced file...") ); mSocket->close(); if ( mSocket->state() == QSocket::Idle ) @@ -985,17 +985,17 @@ void KServerSocket::readBackFileFromSocket() emit file_received( false ); blockRC = false; return ; } // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); QTextStream ts ( &file ); - ts.setCodec( QTextCodec::codecForName("utf8") ); + ts.setEncoding( QTextStream::Latin1 ); mSyncActionDialog->setCaption( i18n("Writing file to disk...") ); ts << piFileString; mSocket->close(); if ( mSocket->state() == QSocket::Idle ) QTimer::singleShot( 10, this , SLOT ( discardClient())); file.close(); delete mSyncActionDialog; mSyncActionDialog = 0; @@ -1023,17 +1023,17 @@ void KCommandSocket::readFile( QString fn ) connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) ); connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); } mFileString = ""; mFileName = fn; mFirst = true; mSocket->connectToHost( mHost, mPort ); QTextStream os( mSocket ); - os.setEncoding( QTextStream::UnicodeUTF8 ); + os.setEncoding( QTextStream::Latin1 ); os << "GET " << mPassWord << "\r\n"; mTimerSocket->start( 10000 ); } void KCommandSocket::writeFile( QString fileName ) { if ( !mSocket ) { mSocket = new QSocket( this ); @@ -1049,19 +1049,19 @@ void KCommandSocket::writeFileToSocket() if (!file2.open( IO_ReadOnly ) ) { mRetVal= errorW; mSocket->close(); if ( mSocket->state() == QSocket::Idle ) QTimer::singleShot( 10, this , SLOT ( deleteSocket())); return ; } QTextStream ts2( &file2 ); - ts2.setCodec( QTextCodec::codecForName("utf8") ); + ts2.setEncoding( QTextStream::Latin1 ); QTextStream os2( mSocket ); - os2.setCodec( QTextCodec::codecForName("utf8") ); + os2.setEncoding( QTextStream::Latin1 ); os2 << "PUT " << mPassWord << "\r\n";; while ( ! ts2.atEnd() ) { os2 << ts2.readLine() << "\n"; } mRetVal= successW; file2.close(); mSocket->close(); if ( mSocket->state() == QSocket::Idle ) @@ -1070,17 +1070,17 @@ void KCommandSocket::writeFileToSocket() void KCommandSocket::sendStop() { if ( !mSocket ) { mSocket = new QSocket( this ); connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); } mSocket->connectToHost( mHost, mPort ); QTextStream os2( mSocket ); - os2.setCodec( QTextCodec::codecForName("utf8") ); + os2.setEncoding( QTextStream::Latin1 ); os2 << "STOP\r\n"; mSocket->close(); if ( mSocket->state() == QSocket::Idle ) QTimer::singleShot( 10, this , SLOT ( deleteSocket())); } void KCommandSocket::startReadFileFromSocket() { @@ -1115,17 +1115,17 @@ void KCommandSocket::readFileFromSocket() mRetVal = errorR; qDebug("Error open temp calender file for writing: %s",fileName.latin1() ); deleteSocket(); return ; } // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); QTextStream ts ( &file ); - ts.setCodec( QTextCodec::codecForName("utf8") ); + ts.setEncoding( QTextStream::Latin1 ); ts << mFileString; file.close(); mFileString = ""; mRetVal = successR; mSocket->close(); // if state is not idle, deleteSocket(); is called via // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); if ( mSocket->state() == QSocket::Idle ) |