author | zautrix <zautrix> | 2005-02-09 19:31:50 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-09 19:31:50 (UTC) |
commit | a9eff860d8399a198a9fdc04e09ed369097fc745 (patch) (side-by-side diff) | |
tree | c953f38ef75bed96bdedd61b1b4bf369e08cddee /libkdepim/ksyncmanager.cpp | |
parent | 22d5db839c9741cb2e988e84bbb367617934ebd9 (diff) | |
download | kdepimpi-a9eff860d8399a198a9fdc04e09ed369097fc745.zip kdepimpi-a9eff860d8399a198a9fdc04e09ed369097fc745.tar.gz kdepimpi-a9eff860d8399a198a9fdc04e09ed369097fc745.tar.bz2 |
fixes
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 9177f63..c8d0e0d 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -63,34 +63,38 @@ KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, Targ { mServerSocket = 0; bar = new QProgressBar ( 1, 0 ); bar->setCaption (""); mWriteBackInPast = 2; int w = 300; if ( QApplication::desktop()->width() < 320 ) w = 220; int h = bar->sizeHint().height() ; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); - if ( mPrefs->mPassiveSyncAutoStart ) - enableQuick( false ); } KSyncManager::~KSyncManager() { delete bar; } - + +void KSyncManager::setDefaultFileName( QString s) +{ + mDefFileName = s ; + if ( mPrefs->mPassiveSyncAutoStart ) + enableQuick( false ); +} void KSyncManager::fillSyncMenu() { if ( mSyncMenu->count() ) mSyncMenu->clear(); mSyncMenu->insertItem( i18n("Configure..."), 0 ); mSyncMenu->insertSeparator(); QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); clearMenu->insertItem( i18n("For all profiles"), 1 ); clearMenu->insertSeparator(); @@ -403,25 +407,24 @@ void KSyncManager::enableQuick( bool ask ) if ( autoStart != mPrefs->mPassiveSyncAutoStart ) changed = true; bool ok; mPrefs->mPassiveSyncAutoStart = false; Q_UINT16 port = mPrefs->mPassiveSyncPort.toUInt(&ok); if ( ! ok ) { KMessageBox::information( 0, i18n("No valid port")); return; } //qDebug("port %d ", port); mServerSocket = new KServerSocket ( mPrefs->mPassiveSyncPw, port ,1 ); mServerSocket->setFileName( defaultFileName() );//bbb - //qDebug("connected "); if ( !mServerSocket->ok() ) { KMessageBox::information( 0, i18n("Failed to bind or\nlisten to the port!")); delete mServerSocket; mServerSocket = 0; return; } mPrefs->mPassiveSyncAutoStart = autoStart; if ( changed ) { mPrefs->writeConfig(); } connect( mServerSocket, SIGNAL ( request_file() ),this, SIGNAL ( request_file() ) ); connect( mServerSocket, SIGNAL ( file_received( bool ) ), this, SIGNAL ( getFile( bool ) ) ); @@ -1108,25 +1111,25 @@ void KSyncManager::readFileFromSocket() commandSocket->sendStop(); mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); mPisyncFinished = true; } } KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : QServerSocket( port, backlog, parent, name ) { mPassWord = pw; mSocket = 0; mSyncActionDialog = 0; blockRC = false; -}; +} void KServerSocket::newConnection ( int socket ) { // qDebug("KServerSocket:New connection %d ", socket); if ( mSocket ) { qDebug("KSS::newConnection Socket deleted! "); delete mSocket; mSocket = 0; } mSocket = new QSocket( this ); connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); |