author | zautrix <zautrix> | 2004-08-07 17:37:12 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-07 17:37:12 (UTC) |
commit | 2219ddf2cb8022a24101e45ca439e65e95743388 (patch) (side-by-side diff) | |
tree | 3e15d6b069a82901a5e032f641889b1870fc6ede /korganizer/calendarview.cpp | |
parent | 88b0d33b8b0b1f6ae320cfc863ca6a47fa8fec22 (diff) | |
download | kdepimpi-2219ddf2cb8022a24101e45ca439e65e95743388.zip kdepimpi-2219ddf2cb8022a24101e45ca439e65e95743388.tar.gz kdepimpi-2219ddf2cb8022a24101e45ca439e65e95743388.tar.bz2 |
added gammu
-rw-r--r-- | korganizer/calendarview.cpp | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 689618d..a7f7010 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -84,4 +84,5 @@ #include <libkcal/sharpformat.h> #endif +#include <libkcal/phoneformat.h> #ifndef KORG_NOMAIL #include "komailclient.h" @@ -1176,10 +1177,9 @@ bool CalendarView::syncCalendar(QString filename, int mode) void CalendarView::syncPhone() { - qDebug("CalendarView::syncPhone() "); + syncExternal( 1 ); } -void CalendarView::syncSharp() +void CalendarView::syncExternal( int mode ) { -#ifndef DESKTOP_VERSION - mGlobalSyncMode = SYNC_MODE_EXTERNAL; + mGlobalSyncMode = SYNC_MODE_EXTERNAL; //mCurrentSyncDevice = "sharp-DTM"; if ( KOPrefs::instance()->mAskForPreferences ) @@ -1189,6 +1189,21 @@ void CalendarView::syncSharp() calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); bool syncOK = false; - SharpFormat sharpFormat; - if ( sharpFormat.load( calendar, mCalendar ) ) { + boo loadSuccess = false; + PhoneFormat* phoneFormat = 0; +#ifndef DESKTOP_VERSION + SharpFormat* sharpFormat = 0; + if ( mode == 0 ) { // sharp + sharpFormat = new SharpFormat () ; + loadSuccess = sharpFormat->load( calendar, mCalendar ); + + } else +#endif + if ( mode == 1 ) { // phone + phoneFormat = new PhoneFormat (); + loadSuccess = phoneFormat->load( calendar, mCalendar ); + + } else + return; + if ( loadSuccess ) { getEventViewerDialog()->setSyncMode( true ); syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs ); @@ -1206,6 +1221,10 @@ void CalendarView::syncSharp() } */ - // pending: clean last sync event description - sharpFormat.save(calendar); +#ifndef DESKTOP_VERSION + if ( sharpFormat ) + sharpFormat->save(calendar); +#endif + if ( phoneFormat ) + phoneFormat->save(calendar); iL = calendar->rawIncidences(); inc = iL.first(); @@ -1239,5 +1258,10 @@ void CalendarView::syncSharp() updateView(); return ;//syncOK; -#endif + +} +void CalendarView::syncSharp() +{ + syncExternal( 0 ); + } |