-rw-r--r-- | libkdepim/ksyncmanager.cpp | 2 |
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 | |||
@@ -1728,51 +1728,51 @@ void KCommandSocket::readFileFromSocket() | |||
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 | ||
1749 | void KCommandSocket::deleteSocket() | 1749 | void 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 | } |