-rw-r--r-- | korganizer/calendarview.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 884c61a..0306e07 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1225,41 +1225,44 @@ bool CalendarView::syncCalendar(QString filename, int mode) | |||
1225 | } | 1225 | } |
1226 | 1226 | ||
1227 | void CalendarView::syncExternal( int mode ) | 1227 | void CalendarView::syncExternal( int mode ) |
1228 | { | 1228 | { |
1229 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 1229 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
1230 | 1230 | ||
1231 | qApp->processEvents(); | 1231 | qApp->processEvents(); |
1232 | CalendarLocal* calendar = new CalendarLocal(); | 1232 | CalendarLocal* calendar = new CalendarLocal(); |
1233 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); | 1233 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); |
1234 | bool syncOK = false; | 1234 | bool syncOK = false; |
1235 | bool loadSuccess = false; | 1235 | bool loadSuccess = false; |
1236 | PhoneFormat* phoneFormat = 0; | 1236 | PhoneFormat* phoneFormat = 0; |
1237 | emit tempDisableBR(true); | ||
1237 | #ifndef DESKTOP_VERSION | 1238 | #ifndef DESKTOP_VERSION |
1238 | SharpFormat* sharpFormat = 0; | 1239 | SharpFormat* sharpFormat = 0; |
1239 | if ( mode == 0 ) { // sharp | 1240 | if ( mode == 0 ) { // sharp |
1240 | sharpFormat = new SharpFormat () ; | 1241 | sharpFormat = new SharpFormat () ; |
1241 | loadSuccess = sharpFormat->load( calendar, mCalendar ); | 1242 | loadSuccess = sharpFormat->load( calendar, mCalendar ); |
1242 | 1243 | ||
1243 | } else | 1244 | } else |
1244 | #endif | 1245 | #endif |
1245 | if ( mode == 1 ) { // phone | 1246 | if ( mode == 1 ) { // phone |
1246 | phoneFormat = new PhoneFormat (mCurrentSyncDevice, | 1247 | phoneFormat = new PhoneFormat (mCurrentSyncDevice, |
1247 | mSyncManager->mPhoneDevice, | 1248 | mSyncManager->mPhoneDevice, |
1248 | mSyncManager->mPhoneConnection, | 1249 | mSyncManager->mPhoneConnection, |
1249 | mSyncManager->mPhoneModel); | 1250 | mSyncManager->mPhoneModel); |
1250 | loadSuccess = phoneFormat->load( calendar,mCalendar); | 1251 | loadSuccess = phoneFormat->load( calendar,mCalendar); |
1251 | 1252 | ||
1252 | } else | 1253 | } else { |
1254 | emit tempDisableBR(false); | ||
1253 | return; | 1255 | return; |
1256 | } | ||
1254 | if ( loadSuccess ) { | 1257 | if ( loadSuccess ) { |
1255 | getEventViewerDialog()->setSyncMode( true ); | 1258 | getEventViewerDialog()->setSyncMode( true ); |
1256 | syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); | 1259 | syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); |
1257 | getEventViewerDialog()->setSyncMode( false ); | 1260 | getEventViewerDialog()->setSyncMode( false ); |
1258 | qApp->processEvents(); | 1261 | qApp->processEvents(); |
1259 | if ( syncOK ) { | 1262 | if ( syncOK ) { |
1260 | if ( mSyncManager->mWriteBackFile ) | 1263 | if ( mSyncManager->mWriteBackFile ) |
1261 | { | 1264 | { |
1262 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); | 1265 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); |
1263 | Incidence* inc = iL.first(); | 1266 | Incidence* inc = iL.first(); |
1264 | if ( phoneFormat ) { | 1267 | if ( phoneFormat ) { |
1265 | while ( inc ) { | 1268 | while ( inc ) { |
@@ -1294,24 +1297,25 @@ void CalendarView::syncExternal( int mode ) | |||
1294 | } | 1297 | } |
1295 | } | 1298 | } |
1296 | } | 1299 | } |
1297 | setModified( true ); | 1300 | setModified( true ); |
1298 | } else { | 1301 | } else { |
1299 | QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; | 1302 | QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; |
1300 | QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), | 1303 | QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), |
1301 | question, i18n("Ok")) ; | 1304 | question, i18n("Ok")) ; |
1302 | 1305 | ||
1303 | } | 1306 | } |
1304 | delete calendar; | 1307 | delete calendar; |
1305 | updateView(); | 1308 | updateView(); |
1309 | emit tempDisableBR(false); | ||
1306 | return ;//syncOK; | 1310 | return ;//syncOK; |
1307 | 1311 | ||
1308 | } | 1312 | } |
1309 | 1313 | ||
1310 | bool CalendarView::importBday() | 1314 | bool CalendarView::importBday() |
1311 | { | 1315 | { |
1312 | #ifndef KORG_NOKABC | 1316 | #ifndef KORG_NOKABC |
1313 | 1317 | ||
1314 | #ifdef DESKTOP_VERSION | 1318 | #ifdef DESKTOP_VERSION |
1315 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 1319 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
1316 | KABC::AddressBook::Iterator it; | 1320 | KABC::AddressBook::Iterator it; |
1317 | int count = 0; | 1321 | int count = 0; |