summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 31e103d..8965d3b 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1978,7 +1978,6 @@ bool CalendarView::syncCalendar(QString filename, int mode)
void CalendarView::syncExternal( int mode )
{
mGlobalSyncMode = SYNC_MODE_EXTERNAL;
-
qApp->processEvents();
CalendarLocal* calendar = new CalendarLocal();
calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
@@ -5034,7 +5033,7 @@ void CalendarView::keyPressEvent ( QKeyEvent *e)
}
-bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
+bool CalendarView::sync(KSyncManager* manager, QString filename, int mode,QString resource)
{
if ( manager != mSyncManager)
@@ -5044,7 +5043,21 @@ bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
}
mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
mCurrentSyncName = mSyncManager->getCurrentSyncName();
- return syncCalendar( filename, mode );
+ if ( !resource.isEmpty() ) {
+ int exclusiveSyncResource = KOPrefs::instance()->getFuzzyCalendarID( resource );
+ qDebug( "KO: Sync request for resource: %s", resource.latin1() );
+
+ if ( !exclusiveSyncResource ) {
+ qDebug( "KO: Requested sync resource not found: %s", resource.latin1() );
+ return false;
+ }
+ mCalendar->setDefaultCalendar( exclusiveSyncResource );
+ mCalendar->setDefaultCalendarEnabledOnly();
+ }
+ bool result = syncCalendar( filename, mode );
+ if ( !resource.isEmpty() )
+ restoreCalendarSettings();
+ return result;
}
bool CalendarView::syncExternal(KSyncManager* manager, QString resource)
{