-rw-r--r-- | libkdepim/ksyncmanager.cpp | 97 |
1 files changed, 50 insertions, 47 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 5708dfc..c844627 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <qdir.h> | 37 | #include <qdir.h> |
38 | #include <qprogressbar.h> | 38 | #include <q3progressbar.h> |
39 | #include <qpopupmenu.h> | 39 | #include <q3popupmenu.h> |
40 | #include <qpushbutton.h> | 40 | #include <qpushbutton.h> |
41 | #include <qradiobutton.h> | 41 | #include <qradiobutton.h> |
42 | #include <qbuttongroup.h> | 42 | #include <q3buttongroup.h> |
43 | #include <qtimer.h> | 43 | #include <qtimer.h> |
@@ -52,2 +52,5 @@ | |||
52 | #include <qapplication.h> | 52 | #include <qapplication.h> |
53 | #include <QDesktopWidget> | ||
54 | //Added by qt3to4: | ||
55 | #include <Q3VBoxLayout> | ||
53 | 56 | ||
@@ -61,3 +64,3 @@ QDateTime KSyncManager::mRequestedSyncEvent; | |||
61 | 64 | ||
62 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) | 65 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, Q3PopupMenu* syncmenu) |
63 | : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) | 66 | : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) |
@@ -65,3 +68,3 @@ KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, Targ | |||
65 | mServerSocket = 0; | 68 | mServerSocket = 0; |
66 | bar = new QProgressBar ( 1, 0 ); | 69 | bar = new Q3ProgressBar ( 1, 0 ); |
67 | bar->setCaption (""); | 70 | bar->setCaption (""); |
@@ -91,3 +94,3 @@ void KSyncManager::fillSyncMenu() | |||
91 | mSyncMenu->insertSeparator(); | 94 | mSyncMenu->insertSeparator(); |
92 | QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); | 95 | Q3PopupMenu *clearMenu = new Q3PopupMenu ( mSyncMenu ); |
93 | mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); | 96 | mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); |
@@ -357,3 +360,3 @@ void KSyncManager::enableQuick( bool ask ) | |||
357 | QLineEdit lab ( &dia ); | 360 | QLineEdit lab ( &dia ); |
358 | QVBoxLayout lay( &dia ); | 361 | Q3VBoxLayout lay( &dia ); |
359 | lab.setText( mPrefs->mPassiveSyncPort ); | 362 | lab.setText( mPrefs->mPassiveSyncPort ); |
@@ -806,3 +809,3 @@ bool KSyncManager::edit_pisync_options() | |||
806 | dia.setCaption( i18n("Pi-Sync options for device: " ) +mCurrentSyncDevice ); | 809 | dia.setCaption( i18n("Pi-Sync options for device: " ) +mCurrentSyncDevice ); |
807 | QVBoxLayout lay ( &dia ); | 810 | Q3VBoxLayout lay ( &dia ); |
808 | lay.setSpacing( 5 ); | 811 | lay.setSpacing( 5 ); |
@@ -840,4 +843,4 @@ bool KSyncManager::edit_sync_options() | |||
840 | dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice ); | 843 | dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice ); |
841 | QButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia); | 844 | Q3ButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia); |
842 | QVBoxLayout lay ( &dia ); | 845 | Q3VBoxLayout lay ( &dia ); |
843 | lay.setSpacing( 2 ); | 846 | lay.setSpacing( 2 ); |
@@ -893,3 +896,3 @@ QString KSyncManager::getPassword( ) | |||
893 | lab.setEchoMode( QLineEdit::Password ); | 896 | lab.setEchoMode( QLineEdit::Password ); |
894 | QVBoxLayout lay( &dia ); | 897 | Q3VBoxLayout lay( &dia ); |
895 | lay.setMargin(7); | 898 | lay.setMargin(7); |
@@ -1336,3 +1339,3 @@ void KSyncManager::readFileFromSocket() | |||
1336 | 1339 | ||
1337 | KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : QServerSocket( port, backlog, parent, name ) | 1340 | KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : Q3ServerSocket( port, backlog, parent, name ) |
1338 | { | 1341 | { |
@@ -1352,3 +1355,3 @@ void KServerSocket::waitForSocketFinish() | |||
1352 | } | 1355 | } |
1353 | mSocket = new QSocket( this ); | 1356 | mSocket = new Q3Socket( this ); |
1354 | connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); | 1357 | connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); |
@@ -1374,3 +1377,3 @@ void KServerSocket::newConnection ( int socket ) | |||
1374 | mPendingConnect = 0; | 1377 | mPendingConnect = 0; |
1375 | mSocket = new QSocket( this ); | 1378 | mSocket = new Q3Socket( this ); |
1376 | connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); | 1379 | connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); |
@@ -1464,7 +1467,7 @@ void KServerSocket::error_connect( QString errmess ) | |||
1464 | { | 1467 | { |
1465 | QTextStream os( mSocket ); | 1468 | Q3TextStream os( mSocket ); |
1466 | os.setEncoding( QTextStream::Latin1 ); | 1469 | os.setEncoding( Q3TextStream::Latin1 ); |
1467 | os << errmess ; | 1470 | os << errmess ; |
1468 | mSocket->close(); | 1471 | mSocket->close(); |
1469 | if ( mSocket->state() == QSocket::Idle ) { | 1472 | if ( mSocket->state() == Q3Socket::Idle ) { |
1470 | QTimer::singleShot( 0, this , SLOT ( discardClient())); | 1473 | QTimer::singleShot( 0, this , SLOT ( discardClient())); |
@@ -1486,3 +1489,3 @@ void KServerSocket::send_file() | |||
1486 | label->setAlignment ( Qt::AlignHCenter ); | 1489 | label->setAlignment ( Qt::AlignHCenter ); |
1487 | QVBoxLayout* lay = new QVBoxLayout( mSyncActionDialog ); | 1490 | Q3VBoxLayout* lay = new Q3VBoxLayout( mSyncActionDialog ); |
1488 | lay->addWidget( label); | 1491 | lay->addWidget( label); |
@@ -1538,3 +1541,3 @@ void KServerSocket::send_file() | |||
1538 | QFile file( fileName ); | 1541 | QFile file( fileName ); |
1539 | if (!file.open( IO_ReadOnly ) ) { | 1542 | if (!file.open( QIODevice::ReadOnly ) ) { |
1540 | mErrorMessage = 0; | 1543 | mErrorMessage = 0; |
@@ -1545,7 +1548,7 @@ void KServerSocket::send_file() | |||
1545 | mSyncActionDialog->setCaption( i18n("Sending file...") ); | 1548 | mSyncActionDialog->setCaption( i18n("Sending file...") ); |
1546 | QTextStream ts( &file ); | 1549 | Q3TextStream ts( &file ); |
1547 | ts.setEncoding( QTextStream::Latin1 ); | 1550 | ts.setEncoding( Q3TextStream::Latin1 ); |
1548 | 1551 | ||
1549 | QTextStream os( mSocket ); | 1552 | Q3TextStream os( mSocket ); |
1550 | os.setEncoding( QTextStream::Latin1 ); | 1553 | os.setEncoding( Q3TextStream::Latin1 ); |
1551 | while ( ! ts.atEnd() ) { | 1554 | while ( ! ts.atEnd() ) { |
@@ -1558,3 +1561,3 @@ void KServerSocket::send_file() | |||
1558 | mSocket->close(); | 1561 | mSocket->close(); |
1559 | if ( mSocket->state() == QSocket::Idle ) | 1562 | if ( mSocket->state() == Q3Socket::Idle ) |
1560 | QTimer::singleShot( 10, this , SLOT ( discardClient())); | 1563 | QTimer::singleShot( 10, this , SLOT ( discardClient())); |
@@ -1590,3 +1593,3 @@ void KServerSocket::readBackFileFromSocket() | |||
1590 | QFile file ( fileName ); | 1593 | QFile file ( fileName ); |
1591 | if (!file.open( IO_WriteOnly ) ) { | 1594 | if (!file.open( QIODevice::WriteOnly ) ) { |
1592 | delete mSyncActionDialog; | 1595 | delete mSyncActionDialog; |
@@ -1603,4 +1606,4 @@ void KServerSocket::readBackFileFromSocket() | |||
1603 | // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); | 1606 | // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); |
1604 | QTextStream ts ( &file ); | 1607 | Q3TextStream ts ( &file ); |
1605 | ts.setEncoding( QTextStream::Latin1 ); | 1608 | ts.setEncoding( Q3TextStream::Latin1 ); |
1606 | mSyncActionDialog->setCaption( i18n("Writing file to disk...") ); | 1609 | mSyncActionDialog->setCaption( i18n("Writing file to disk...") ); |
@@ -1608,3 +1611,3 @@ void KServerSocket::readBackFileFromSocket() | |||
1608 | mSocket->close(); | 1611 | mSocket->close(); |
1609 | if ( mSocket->state() == QSocket::Idle ) | 1612 | if ( mSocket->state() == Q3Socket::Idle ) |
1610 | QTimer::singleShot( 10, this , SLOT ( discardClient())); | 1613 | QTimer::singleShot( 10, this , SLOT ( discardClient())); |
@@ -1650,4 +1653,4 @@ void KCommandSocket::sendFileRequest() | |||
1650 | mTimerSocket->start( 100, true ); | 1653 | mTimerSocket->start( 100, true ); |
1651 | QTextStream os( mSocket ); | 1654 | Q3TextStream os( mSocket ); |
1652 | os.setEncoding( QTextStream::Latin1 ); | 1655 | os.setEncoding( Q3TextStream::Latin1 ); |
1653 | 1656 | ||
@@ -1660,3 +1663,3 @@ void KCommandSocket::readFile( QString fn ) | |||
1660 | if ( !mSocket ) { | 1663 | if ( !mSocket ) { |
1661 | mSocket = new QSocket( this ); | 1664 | mSocket = new Q3Socket( this ); |
1662 | //qDebug("KCS: read file - new socket"); | 1665 | //qDebug("KCS: read file - new socket"); |
@@ -1698,3 +1701,3 @@ void KCommandSocket::writeFile( QString fileName ) | |||
1698 | if ( !mSocket ) { | 1701 | if ( !mSocket ) { |
1699 | mSocket = new QSocket( this ); | 1702 | mSocket = new Q3Socket( this ); |
1700 | connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); | 1703 | connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); |
@@ -1711,3 +1714,3 @@ void KCommandSocket::writeFileToSocket() | |||
1711 | QFile file2( mFileName ); | 1714 | QFile file2( mFileName ); |
1712 | if (!file2.open( IO_ReadOnly ) ) { | 1715 | if (!file2.open( QIODevice::ReadOnly ) ) { |
1713 | mConnectProgress.hide(); | 1716 | mConnectProgress.hide(); |
@@ -1716,3 +1719,3 @@ void KCommandSocket::writeFileToSocket() | |||
1716 | mSocket->close(); | 1719 | mSocket->close(); |
1717 | if ( mSocket->state() == QSocket::Idle ) | 1720 | if ( mSocket->state() == Q3Socket::Idle ) |
1718 | QTimer::singleShot( 10, this , SLOT ( deleteSocket())); | 1721 | QTimer::singleShot( 10, this , SLOT ( deleteSocket())); |
@@ -1726,6 +1729,6 @@ void KCommandSocket::writeFileToSocket() | |||
1726 | mConnectProgress.blockSignals( true ); | 1729 | mConnectProgress.blockSignals( true ); |
1727 | QTextStream ts2( &file2 ); | 1730 | Q3TextStream ts2( &file2 ); |
1728 | ts2.setEncoding( QTextStream::Latin1 ); | 1731 | ts2.setEncoding( Q3TextStream::Latin1 ); |
1729 | QTextStream os2( mSocket ); | 1732 | Q3TextStream os2( mSocket ); |
1730 | os2.setEncoding( QTextStream::Latin1 ); | 1733 | os2.setEncoding( Q3TextStream::Latin1 ); |
1731 | os2 << "PUT " << mPassWord << " " << mRemoteResource << "\r\n\r\n";; | 1734 | os2 << "PUT " << mPassWord << " " << mRemoteResource << "\r\n\r\n";; |
@@ -1750,3 +1753,3 @@ void KCommandSocket::writeFileToSocket() | |||
1750 | mSocket->close(); | 1753 | mSocket->close(); |
1751 | if ( mSocket->state() == QSocket::Idle ) | 1754 | if ( mSocket->state() == Q3Socket::Idle ) |
1752 | QTimer::singleShot( 10, this , SLOT ( deleteSocket())); | 1755 | QTimer::singleShot( 10, this , SLOT ( deleteSocket())); |
@@ -1757,3 +1760,3 @@ void KCommandSocket::sendStop() | |||
1757 | if ( !mSocket ) { | 1760 | if ( !mSocket ) { |
1758 | mSocket = new QSocket( this ); | 1761 | mSocket = new Q3Socket( this ); |
1759 | connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); | 1762 | connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); |
@@ -1761,7 +1764,7 @@ void KCommandSocket::sendStop() | |||
1761 | mSocket->connectToHost( mHost, mPort ); | 1764 | mSocket->connectToHost( mHost, mPort ); |
1762 | QTextStream os2( mSocket ); | 1765 | Q3TextStream os2( mSocket ); |
1763 | os2.setEncoding( QTextStream::Latin1 ); | 1766 | os2.setEncoding( Q3TextStream::Latin1 ); |
1764 | os2 << "STOP\r\n\r\n"; | 1767 | os2 << "STOP\r\n\r\n"; |
1765 | mSocket->close(); | 1768 | mSocket->close(); |
1766 | if ( mSocket->state() == QSocket::Idle ) | 1769 | if ( mSocket->state() == Q3Socket::Idle ) |
1767 | QTimer::singleShot( 10, this , SLOT ( deleteSocket())); | 1770 | QTimer::singleShot( 10, this , SLOT ( deleteSocket())); |
@@ -1831,3 +1834,3 @@ void KCommandSocket::readFileFromSocket() | |||
1831 | QFile file ( fileName ); | 1834 | QFile file ( fileName ); |
1832 | if (!file.open( IO_WriteOnly ) ) { | 1835 | if (!file.open( QIODevice::WriteOnly ) ) { |
1833 | mFileString = ""; | 1836 | mFileString = ""; |
@@ -1840,4 +1843,4 @@ void KCommandSocket::readFileFromSocket() | |||
1840 | // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); | 1843 | // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); |
1841 | QTextStream ts ( &file ); | 1844 | Q3TextStream ts ( &file ); |
1842 | ts.setEncoding( QTextStream::Latin1 ); | 1845 | ts.setEncoding( Q3TextStream::Latin1 ); |
1843 | ts << mFileString; | 1846 | ts << mFileString; |
@@ -1849,3 +1852,3 @@ void KCommandSocket::readFileFromSocket() | |||
1849 | // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); | 1852 | // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); |
1850 | if ( mSocket->state() == QSocket::Idle ) | 1853 | if ( mSocket->state() == Q3Socket::Idle ) |
1851 | deleteSocket(); | 1854 | deleteSocket(); |