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 | |
parent | 88b0d33b8b0b1f6ae320cfc863ca6a47fa8fec22 (diff) | |
download | kdepimpi-2219ddf2cb8022a24101e45ca439e65e95743388.zip kdepimpi-2219ddf2cb8022a24101e45ca439e65e95743388.tar.gz kdepimpi-2219ddf2cb8022a24101e45ca439e65e95743388.tar.bz2 |
added gammu
-rw-r--r-- | korganizer/calendarview.cpp | 42 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 8 |
3 files changed, 41 insertions, 10 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 689618d..a7f7010 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -83,6 +83,7 @@ #ifndef DESKTOP_VERSION #include <libkcal/sharpformat.h> #endif +#include <libkcal/phoneformat.h> #ifndef KORG_NOMAIL #include "komailclient.h" #endif @@ -1175,12 +1176,11 @@ 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 ) edit_sync_options(); @@ -1188,8 +1188,23 @@ void CalendarView::syncSharp() CalendarLocal* calendar = new CalendarLocal(); 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 ); getEventViewerDialog()->setSyncMode( false ); @@ -1205,8 +1220,12 @@ void CalendarView::syncSharp() inc = iL.next(); } */ - // 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(); Incidence* loc; @@ -1238,7 +1257,12 @@ void CalendarView::syncSharp() delete calendar; updateView(); return ;//syncOK; -#endif + +} +void CalendarView::syncSharp() +{ + syncExternal( 0 ); + } diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index b2838db..a3315ad 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -426,6 +426,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser const QString &tasklistFile ); void syncSharp( ); void syncPhone( ); + void syncExternal( int mode ); void slotSelectPickerDate( QDate ) ; void showDatePicker( ) ; void moveIncidence(Incidence *) ; diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 062c95f..cce182a 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1000,7 +1000,13 @@ void MainWindow::slotSyncMenu( int action ) if ( syncWithFile( temp->getRemoteFileName( ), false ) ) KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); } else { - syncRemote( temp ); + if ( temp->getIsPhoneSync() ) { + KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; + KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); + KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); + syncPhone(); + } else + syncRemote( temp ); } } |