summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.cpp
authorzautrix <zautrix>2005-11-25 21:00:35 (UTC)
committer zautrix <zautrix>2005-11-25 21:00:35 (UTC)
commit81d012860ea3d5d17d0e9cf16ec992baa83efbbf (patch) (unidiff)
tree2e5ce0b81f1700f9c6dc60a8411029cd194e45a1 /libkdepim/ksyncmanager.cpp
parent2468bddcb380d8621d5bb49b69b3492d90562d93 (diff)
downloadkdepimpi-81d012860ea3d5d17d0e9cf16ec992baa83efbbf.zip
kdepimpi-81d012860ea3d5d17d0e9cf16ec992baa83efbbf.tar.gz
kdepimpi-81d012860ea3d5d17d0e9cf16ec992baa83efbbf.tar.bz2
sync
Diffstat (limited to 'libkdepim/ksyncmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index d2cb71b..e1b15d2 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1712,67 +1712,67 @@ void KCommandSocket::readFileFromSocket()
1712 } 1712 }
1713 mFileString += line; 1713 mFileString += line;
1714 //qDebug("readline: %s ", line.latin1()); 1714 //qDebug("readline: %s ", line.latin1());
1715 } 1715 }
1716 if ( mTime.elapsed () < 3000 ) { 1716 if ( mTime.elapsed () < 3000 ) {
1717 // wait for more 1717 // wait for more
1718 //qDebug("waitformore "); 1718 //qDebug("waitformore ");
1719 QTimer::singleShot( 100, this , SLOT (readFileFromSocket( ) )); 1719 QTimer::singleShot( 100, this , SLOT (readFileFromSocket( ) ));
1720 return; 1720 return;
1721 } 1721 }
1722 mTimerSocket->stop(); 1722 mTimerSocket->stop();
1723 mConnectCount = -1; 1723 mConnectCount = -1;
1724 mConnectProgress.hide(); 1724 mConnectProgress.hide();
1725 QString fileName = mFileName; 1725 QString fileName = mFileName;
1726 QFile file ( fileName ); 1726 QFile file ( fileName );
1727 if (!file.open( IO_WriteOnly ) ) { 1727 if (!file.open( IO_WriteOnly ) ) {
1728 mFileString = ""; 1728 mFileString = "";
1729 mRetVal = errorR; 1729 mRetVal = errorR;
1730 qDebug("KSS:Error open temp sync file for writing: %s",fileName.latin1() ); 1730 qDebug("KSS:Error open temp sync file for writing: %s",fileName.latin1() );
1731 deleteSocket(); 1731 deleteSocket();
1732 return ; 1732 return ;
1733 1733
1734 } 1734 }
1735 // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); 1735 // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1));
1736 QTextStream ts ( &file ); 1736 QTextStream ts ( &file );
1737 ts.setEncoding( QTextStream::Latin1 ); 1737 ts.setEncoding( QTextStream::Latin1 );
1738 ts << mFileString; 1738 ts << mFileString;
1739 file.close(); 1739 file.close();
1740 mFileString = ""; 1740 mFileString = "";
1741 mRetVal = successR; 1741 mRetVal = successR;
1742 mSocket->close(); 1742 mSocket->close();
1743 // if state is not idle, deleteSocket(); is called via 1743 // if state is not idle, deleteSocket(); is called via
1744 // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1744 // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1745 if ( mSocket->state() == QSocket::Idle ) 1745 if ( mSocket->state() == QSocket::Idle )
1746 deleteSocket(); 1746 deleteSocket();
1747} 1747}
1748 1748
1749void KCommandSocket::deleteSocket() 1749void KCommandSocket::deleteSocket()
1750{ 1750{
1751 //qDebug("KCommandSocket::deleteSocket() "); 1751 //qDebug("KCommandSocket::deleteSocket() ");
1752 mConnectProgress.hide(); 1752 mConnectProgress.hide();
1753 1753
1754 if ( mConnectCount >= 0 ) { 1754 if ( mConnectCount >= 0 ) {
1755 mTimerSocket->stop(); 1755 mTimerSocket->stop();
1756 mRetVal = errorTO; 1756 mRetVal = errorTO;
1757 qDebug("KCS::Connection to remote host timed out"); 1757 qDebug("KCS::Connection to remote host timed out");
1758 if ( mSocket ) { 1758 if ( mSocket ) {
1759 mSocket->close(); 1759 mSocket->close();
1760 //if ( mSocket->state() == QSocket::Idle ) 1760 //if ( mSocket->state() == QSocket::Idle )
1761 // deleteSocket(); 1761 // deleteSocket();
1762 delete mSocket; 1762 delete mSocket;
1763 mSocket = 0; 1763 mSocket = 0;
1764 } 1764 }
1765 if ( mConnectCount == 0 ) 1765 if ( mConnectCount == 0 )
1766 KMessageBox::error( 0, i18n("Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?")); 1766 KMessageBox::error( 0, i18n("Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?"));
1767 else if ( tlw ) 1767 else if ( tlw )
1768 tlw->setCaption( i18n("Connection to remote host cancelled!") ); 1768 tlw->setCaption( i18n("Connection to remote host cancelled!") );
1769 emit commandFinished( this, mRetVal ); 1769 emit commandFinished( this, mRetVal );
1770 return; 1770 return;
1771 } 1771 }
1772 //qDebug("KCommandSocket::deleteSocket() %d", mRetVal ); 1772 //qDebug("KCommandSocket::deleteSocket() %d", mRetVal );
1773 if ( mSocket) 1773 if ( mSocket)
1774 delete mSocket; 1774 delete mSocket;
1775 mSocket = 0; 1775 mSocket = 0;
1776 qDebug("commandFinished "); 1776 //qDebug("commandFinished ");
1777 emit commandFinished( this, mRetVal ); 1777 emit commandFinished( this, mRetVal );
1778} 1778}