-rw-r--r-- | korganizer/mainwindow.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 66bb19b..69ccde1 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -371,14 +371,16 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : | |||
371 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 371 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
372 | //fillSyncMenu(); | 372 | //fillSyncMenu(); |
373 | 373 | ||
374 | 374 | ||
375 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 375 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
376 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 376 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
377 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 377 | connect(mSyncManager , SIGNAL( request_file(const QString &) ), this, SLOT( syncFileRequest(const QString &) ) ); |
378 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 378 | connect(mSyncManager , SIGNAL( getFile( bool, const QString &)), this, SLOT(getFile( bool,const QString & ) ) ); |
379 | connect(mSyncManager , SIGNAL( multiResourceSyncStart( bool )), mView, SLOT( multiResourceSyncStart( bool ) ) ); | ||
380 | |||
379 | mSyncManager->setDefaultFileName( sentSyncFile()); | 381 | mSyncManager->setDefaultFileName( sentSyncFile()); |
380 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 382 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
381 | mSyncManager->fillSyncMenu(); | 383 | mSyncManager->fillSyncMenu(); |
382 | 384 | ||
383 | 385 | ||
384 | 386 | ||
@@ -2701,36 +2703,36 @@ QString MainWindow::sentSyncFile() | |||
2701 | return QDir::convertSeparators( locateLocal( "tmp", "copysynccal.ics" ) ); | 2703 | return QDir::convertSeparators( locateLocal( "tmp", "copysynccal.ics" ) ); |
2702 | #else | 2704 | #else |
2703 | return QString( "/tmp/copysynccal.ics" ); | 2705 | return QString( "/tmp/copysynccal.ics" ); |
2704 | #endif | 2706 | #endif |
2705 | } | 2707 | } |
2706 | 2708 | ||
2707 | void MainWindow::syncFileRequest() | 2709 | void MainWindow::syncFileRequest(const QString& resource) |
2708 | { | 2710 | { |
2709 | while ( mSyncManager->blockSave() ) { | 2711 | while ( mSyncManager->blockSave() ) { |
2710 | qApp->processEvents(); | 2712 | qApp->processEvents(); |
2711 | } | 2713 | } |
2712 | mSyncManager->setBlockSave(true); | 2714 | mSyncManager->setBlockSave(true); |
2713 | 2715 | ||
2714 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2716 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2715 | mSyncManager->slotSyncMenu( 999 ); | 2717 | mSyncManager->slotSyncMenu( 999 ); |
2716 | } | 2718 | } |
2717 | 2719 | ||
2718 | setCaption(i18n("Saving Data to temp file ..." )); | 2720 | setCaption(i18n("Saving Data to temp file ..." )); |
2719 | mView->saveCalendar( sentSyncFile() ); | 2721 | mView->saveCalendarResource( sentSyncFile(), resource ); |
2720 | setCaption(i18n("Data saved to temp file!" )); | 2722 | setCaption(i18n("Data saved to temp file!" )); |
2721 | mSyncManager->setBlockSave( false ); | 2723 | mSyncManager->setBlockSave( false ); |
2722 | 2724 | ||
2723 | } | 2725 | } |
2724 | void MainWindow::getFile( bool success ) | 2726 | void MainWindow::getFile( bool success ,const QString& resource) |
2725 | { | 2727 | { |
2726 | if ( ! success ) { | 2728 | if ( ! success ) { |
2727 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 2729 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
2728 | return; | 2730 | return; |
2729 | } | 2731 | } |
2730 | mView->mergeFile( sentSyncFile() ); | 2732 | mView->mergeFileResource( sentSyncFile(), resource); |
2731 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2733 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2732 | mSyncManager->slotSyncMenu( 999 ); | 2734 | mSyncManager->slotSyncMenu( 999 ); |
2733 | } | 2735 | } |
2734 | setCaption( i18n("Pi-Sync successful!") ); | 2736 | setCaption( i18n("Pi-Sync successful!") ); |
2735 | } | 2737 | } |
2736 | void MainWindow::printListView() | 2738 | void MainWindow::printListView() |