summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (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 2a75bfb..d71264f 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1057,97 +1057,97 @@ void KSyncManager::showProgressBar(int percentage, QString caption, int total)
1057{ 1057{
1058 if (!bar->isVisible()) 1058 if (!bar->isVisible())
1059 { 1059 {
1060 int w = 300; 1060 int w = 300;
1061 if ( QApplication::desktop()->width() < 320 ) 1061 if ( QApplication::desktop()->width() < 320 )
1062 w = 220; 1062 w = 220;
1063 int h = bar->sizeHint().height() ; 1063 int h = bar->sizeHint().height() ;
1064 int dw = QApplication::desktop()->width(); 1064 int dw = QApplication::desktop()->width();
1065 int dh = QApplication::desktop()->height(); 1065 int dh = QApplication::desktop()->height();
1066 bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1066 bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1067 bar->setCaption (caption); 1067 bar->setCaption (caption);
1068 bar->setTotalSteps ( total ) ; 1068 bar->setTotalSteps ( total ) ;
1069 bar->show(); 1069 bar->show();
1070 } 1070 }
1071 bar->raise(); 1071 bar->raise();
1072 bar->setProgress( percentage ); 1072 bar->setProgress( percentage );
1073 qApp->processEvents(); 1073 qApp->processEvents();
1074} 1074}
1075 1075
1076void KSyncManager::hideProgressBar() 1076void KSyncManager::hideProgressBar()
1077{ 1077{
1078 bar->hide(); 1078 bar->hide();
1079 qApp->processEvents(); 1079 qApp->processEvents();
1080} 1080}
1081 1081
1082bool KSyncManager::isProgressBarCanceled() 1082bool KSyncManager::isProgressBarCanceled()
1083{ 1083{
1084 return !bar->isVisible(); 1084 return !bar->isVisible();
1085} 1085}
1086 1086
1087QString KSyncManager::syncFileName() 1087QString KSyncManager::syncFileName()
1088{ 1088{
1089 1089
1090 QString fn = "tempfile"; 1090 QString fn = "tempfile";
1091 switch(mTargetApp) 1091 switch(mTargetApp)
1092 { 1092 {
1093 case (KAPI): 1093 case (KAPI):
1094 fn = "tempsyncab.vcf"; 1094 fn = "tempsyncab.vcf";
1095 break; 1095 break;
1096 case (KOPI): 1096 case (KOPI):
1097 fn = "tempsynccal.ics"; 1097 fn = "tempsynccal.ics";
1098 break; 1098 break;
1099 case (PWMPI): 1099 case (PWMPI):
1100 fn = "tempsyncpw.pwm"; 1100 fn = "tempsyncpw.pwm";
1101 break; 1101 break;
1102 default: 1102 default:
1103 break; 1103 break;
1104 } 1104 }
1105#ifdef _WIN32_ 1105#ifdef DESKTOP_VERSION
1106 return locateLocal( "tmp", fn ); 1106 return locateLocal( "tmp", fn );
1107#else 1107#else
1108 return (QString( "/tmp/" )+ fn ); 1108 return (QString( "/tmp/" )+ fn );
1109#endif 1109#endif
1110} 1110}
1111 1111
1112void KSyncManager::syncPi() 1112void KSyncManager::syncPi()
1113{ 1113{
1114 mIsKapiFile = true; 1114 mIsKapiFile = true;
1115 mPisyncFinished = false; 1115 mPisyncFinished = false;
1116 qApp->processEvents(); 1116 qApp->processEvents();
1117 if ( mAskForPreferences ) 1117 if ( mAskForPreferences )
1118 if ( !edit_pisync_options()) { 1118 if ( !edit_pisync_options()) {
1119 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); 1119 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") );
1120 mPisyncFinished = true; 1120 mPisyncFinished = true;
1121 return; 1121 return;
1122 } 1122 }
1123 bool ok; 1123 bool ok;
1124 Q_UINT16 port = mActiveSyncPort.toUInt(&ok); 1124 Q_UINT16 port = mActiveSyncPort.toUInt(&ok);
1125 if ( ! ok ) { 1125 if ( ! ok ) {
1126 mParent->topLevelWidget()->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") ); 1126 mParent->topLevelWidget()->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") );
1127 mPisyncFinished = true; 1127 mPisyncFinished = true;
1128 return; 1128 return;
1129 } 1129 }
1130 KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() ); 1130 KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() );
1131 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) ); 1131 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) );
1132 commandSocket->readFile( syncFileName() ); 1132 commandSocket->readFile( syncFileName() );
1133} 1133}
1134 1134
1135void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) 1135void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state)
1136{ 1136{
1137 //enum { success, errorW, errorR, quiet }; 1137 //enum { success, errorW, errorR, quiet };
1138 1138
1139 1139
1140 1140
1141 if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ||state == KCommandSocket::errorPW || 1141 if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ||state == KCommandSocket::errorPW ||
1142 state == KCommandSocket::errorCA ||state == KCommandSocket::errorFI ||state == KCommandSocket::errorUN||state == KCommandSocket::errorED ) { 1142 state == KCommandSocket::errorCA ||state == KCommandSocket::errorFI ||state == KCommandSocket::errorUN||state == KCommandSocket::errorED ) {
1143 if ( state == KCommandSocket::errorPW ) 1143 if ( state == KCommandSocket::errorPW )
1144 mParent->topLevelWidget()->setCaption( i18n("Wrong password: Receiving remote file failed.") ); 1144 mParent->topLevelWidget()->setCaption( i18n("Wrong password: Receiving remote file failed.") );
1145 else if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ) 1145 else if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO )
1146 mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") ); 1146 mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") );
1147 else if ( state == KCommandSocket::errorCA ) 1147 else if ( state == KCommandSocket::errorCA )
1148 mParent->topLevelWidget()->setCaption( i18n("Sync cancelled from remote.") ); 1148 mParent->topLevelWidget()->setCaption( i18n("Sync cancelled from remote.") );
1149 else if ( state == KCommandSocket::errorFI ) 1149 else if ( state == KCommandSocket::errorFI )
1150 mParent->topLevelWidget()->setCaption( i18n("File error on remote.") ); 1150 mParent->topLevelWidget()->setCaption( i18n("File error on remote.") );
1151 else if ( state == KCommandSocket::errorED ) 1151 else if ( state == KCommandSocket::errorED )
1152 mParent->topLevelWidget()->setCaption( i18n("Please close error dialog on remote.") ); 1152 mParent->topLevelWidget()->setCaption( i18n("Please close error dialog on remote.") );
1153 else if ( state == KCommandSocket::errorUN ) 1153 else if ( state == KCommandSocket::errorUN )