summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.cpp
authorzautrix <zautrix>2004-10-07 11:44:35 (UTC)
committer zautrix <zautrix>2004-10-07 11:44:35 (UTC)
commit43c82cc5393522d2c34f34a4339cb6a1d1c6c555 (patch) (side-by-side diff)
tree49916cfb6f12c846fa52f9697f9b0285c2902772 /libkdepim/ksyncmanager.cpp
parentf0e8b8f36bccda952fa662e4faf2d58fcee67262 (diff)
downloadkdepimpi-43c82cc5393522d2c34f34a4339cb6a1d1c6c555.zip
kdepimpi-43c82cc5393522d2c34f34a4339cb6a1d1c6c555.tar.gz
kdepimpi-43c82cc5393522d2c34f34a4339cb6a1d1c6c555.tar.bz2
sync fixes
Diffstat (limited to 'libkdepim/ksyncmanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp75
1 files changed, 27 insertions, 48 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index b360644..a663427 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -232,5 +232,5 @@ void KSyncManager::slotSyncMenu( int action )
}
syncPi();
- }
+ } else
syncRemote( temp );
@@ -350,7 +350,7 @@ bool KSyncManager::syncWithFile( QString fn , bool quick )
//qDebug("Now sycing ... ");
if ( ret = mImplementation->sync( this, fn, mSyncAlgoPrefs ) )
- mParent->setCaption( i18n("Synchronization successful") );
+ mParent->topLevelWidget()->setCaption( i18n("Synchronization successful") );
else
- mParent->setCaption( i18n("Sync cancelled or failed. Nothing synced.") );
+ mParent->topLevelWidget()->setCaption( i18n("Sync cancelled or failed. Nothing synced.") );
if ( ! quick )
mLastSyncedLocalFile = fn;
@@ -377,5 +377,5 @@ void KSyncManager::multiSync( bool askforPrefs )
0, 0 ) != 0 ) {
setBlockSave(false);
- mParent->setCaption(i18n("Aborted! Nothing synced!"));
+ mParent->topLevelWidget()->setCaption(i18n("Aborted! Nothing synced!"));
return;
}
@@ -386,5 +386,5 @@ void KSyncManager::multiSync( bool askforPrefs )
mRingSyncAlgoPrefs = mSyncAlgoPrefs;
}
- mParent->setCaption(i18n("Multiple sync started.") );
+ mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") );
qApp->processEvents();
int num = ringSync() ;
@@ -395,7 +395,7 @@ void KSyncManager::multiSync( bool askforPrefs )
emit save();
if ( num )
- mParent->setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) );
+ mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) );
else
- mParent->setCaption(i18n("Nothing synced! No profiles defined for multisync!"));
+ mParent->topLevelWidget()->setCaption(i18n("Nothing synced! No profiles defined for multisync!"));
return;
}
@@ -434,5 +434,5 @@ int KSyncManager::ringSync()
if ( includeInRingSync && ( i < 1 || i > 2 )) {
- mParent->setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... "));
+ mParent->topLevelWidget()->setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... "));
++syncedProfiles;
// mAskForPreferences = temp->getAskForPreferences();
@@ -479,5 +479,5 @@ int KSyncManager::ringSync()
}
timer.start();
- mParent->setCaption(i18n("Multiple sync in progress ... please wait!") );
+ mParent->topLevelWidget()->setCaption(i18n("Multiple sync in progress ... please wait!") );
while ( timer.elapsed () < 2000 ) {
qApp->processEvents();
@@ -542,5 +542,5 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask)
if ( QApplication::desktop()->width() > 320 )
maxlen += 25;
- mParent->setCaption ( i18n( "Copy remote file to local machine..." ) );
+ mParent->topLevelWidget()->setCaption ( i18n( "Copy remote file to local machine..." ) );
int fileSize = 0;
int result = system ( preCommand );
@@ -559,8 +559,8 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask)
question,
i18n("Okay!")) ;
- mParent->setCaption ("");
+ mParent->topLevelWidget()->setCaption ("");
return;
}
- mParent->setCaption ( i18n( "Copying succeed." ) );
+ mParent->topLevelWidget()->setCaption ( i18n( "Copying succeed." ) );
//qDebug(" file **%s** ",prof->getLocalTempFile().latin1() );
@@ -579,12 +579,12 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask)
}
- mParent->setCaption ( i18n( "Writing back file ..." ) );
+ mParent->topLevelWidget()->setCaption ( i18n( "Writing back file ..." ) );
result = system ( postCommand );
qDebug("Writing back file result: %d ", result);
if ( result != 0 ) {
- mParent->setCaption ( i18n( "Writing back file result: " )+QString::number( result ) );
+ mParent->topLevelWidget()->setCaption ( i18n( "Writing back file result: " )+QString::number( result ) );
return;
} else {
- mParent->setCaption ( i18n( "Syncronization sucessfully completed" ) );
+ mParent->topLevelWidget()->setCaption ( i18n( "Syncronization sucessfully completed" ) );
}
}
@@ -750,11 +750,11 @@ QString KSyncManager::syncFileName()
{
case (KAPI):
- fn = "addressbook.vcf";
+ fn = "tempsyncab.vcf";
break;
case (KOPI):
- fn = "synccalendar.ics";
+ fn = "tempsynccal.ics";
break;
case (PWMPI):
- fn = "manager.pwm";
+ fn = "tempsyncpw.pwm";
break;
default:
@@ -774,10 +774,10 @@ void KSyncManager::syncPi()
Q_UINT16 port = mActiveSyncPort.toUInt(&ok);
if ( ! ok ) {
- mParent->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") );
+ mParent->topLevelWidget()->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") );
return;
}
KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, port, mActiveSyncIP, this );
connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) );
- mParent->setCaption( i18n("Sending request for remote file ...") );
+ mParent->topLevelWidget()->setCaption( i18n("Sending request for remote file ...") );
commandSocket->readFile( syncFileName() );
}
@@ -789,5 +789,5 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state)
//enum { success, errorW, errorR, quiet };
if ( state == KCommandSocket::errorR ) {
- mParent->setCaption( i18n("ERROR: Receiving remote file failed.") );
+ mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") );
delete s;
KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this );
@@ -797,5 +797,5 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state)
} else if ( state == KCommandSocket::errorW ) {
- mParent->setCaption( i18n("ERROR:Writing back file failed.") );
+ mParent->topLevelWidget()->setCaption( i18n("ERROR:Writing back file failed.") );
} else if ( state == KCommandSocket::successR ) {
@@ -803,5 +803,5 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state)
} else if ( state == KCommandSocket::successW ) {
- mParent->setCaption( i18n("Pi-Sync succesful!") );
+ mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") );
}
@@ -812,7 +812,7 @@ void KSyncManager::readFileFromSocket()
{
QString fileName = syncFileName();
- mParent->setCaption( i18n("Remote file saved to temp file.") );
+ mParent->topLevelWidget()->setCaption( i18n("Remote file saved to temp file.") );
if ( ! syncWithFile( fileName , true ) ) {
- mParent->setCaption( i18n("Syncing failed.") );
+ mParent->topLevelWidget()->setCaption( i18n("Syncing failed.") );
qDebug("Syncing failed ");
return;
@@ -824,30 +824,8 @@ void KSyncManager::readFileFromSocket()
else {
commandSocket->sendStop();
- mParent->setCaption( i18n("Pi-Sync succesful!") );
+ mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") );
}
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : QServerSocket( port, backlog, parent, name )
{
@@ -939,4 +917,5 @@ void KServerSocket::send_file()
mSyncActionDialog->setFixedSize( 230, 120);
mSyncActionDialog->show();
+ mSyncActionDialog->raise();
qDebug("KSS::saving ... ");
emit request_file();