-rw-r--r-- | korganizer/calendarview.cpp | 21 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 12 |
2 files changed, 21 insertions, 12 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 3ab4bb4..a76f2ed 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -369,9 +369,9 @@ void CalendarView::init() mNextAlarmDateTime = QDateTime::currentDateTime(); setFocusPolicy (NoFocus ); mViewerCallerIsSearchDialog = false; mBlockShowDates = false; - + mConflictingEvent = 0; mDatePickerMode = 0; mCurrentSyncDevice = ""; mViewManager = new KOViewManager( this ); mDialogManager = new KODialogManager( this ); @@ -2792,11 +2792,12 @@ void CalendarView::checkConflictForEvent() if (!KOPrefs::instance()->mConfirm) return; if ( ! mConflictingEvent ) return; + Event * conflictingEvent = mConflictingEvent; + mConflictingEvent = 0; QDateTime current = QDateTime::currentDateTime(); - if ( ! mConflictingEvent->matchTime( ¤t, 0 ) ) { - mConflictingEvent = 0; + if ( ! conflictingEvent->matchTime( ¤t, 0 ) ) { return; } QPtrList<Event> testlist = mCalendar->events(); Event * test = testlist.first(); @@ -2812,9 +2813,9 @@ void CalendarView::checkConflictForEvent() skip = !test->matchTime( ¤t, &conflict ); else skip = !test->matchTime( ¤t, 0 ); if ( !skip && !test->doesFloat() ) { - if ( mConflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { + if ( conflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { if ( ! found ) { conflict = retVal; cE = test; } else { @@ -2829,9 +2830,9 @@ void CalendarView::checkConflictForEvent() test = testlist.next(); } topLevelWidget()->setCaption( i18n("KO/Pi") ); if ( found ) { - QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( mConflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; + QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( conflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; qApp->processEvents(); int km = KMessageBox::warningContinueCancel(this,mess, i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!")); if ( km != KMessageBox::Continue ) { @@ -2841,12 +2842,11 @@ void CalendarView::checkConflictForEvent() mViewManager->showDayView(); mNavigator->slotDaySelect( conflict.date() ); int hour = conflict.time().hour(); mViewManager->agendaView()->setStartHour( hour ); - topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); + topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( conflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); } else topLevelWidget()->setCaption( i18n("No conflict found") ); - mConflictingEvent = 0; return; } @@ -4091,14 +4091,15 @@ void CalendarView::openAddressbook() } void CalendarView::setModified(bool modified) { + //qDebug("CalendarView::setModified %d ", modified); if ( modified ) emit signalmodified(); - if (mModified != modified) { - mModified = modified; + mModified = modified; + if ( mModified ) emit modifiedChanged(mModified); - } + } bool CalendarView::isReadOnly() { diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 279955f..77d0ac8 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1913,8 +1913,12 @@ void MainWindow::slotModifiedChanged( bool ) if ( mBlockAtStartup ) return; int msec; + if ( mCalendarModifiedFlag ) { + //qDebug(" MainWindow timer is running "); + return; + } // we store the changes after 1 minute, // and for safety reasons after 10 minutes again if ( !mSyncManager->blockSave() ) msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; @@ -1974,10 +1978,11 @@ void MainWindow::save() if ( !mCalendarModifiedFlag ) { qDebug("KO: Calendar not modified. Nothing saved."); return; } - if ( mSyncManager->blockSave() ) + if ( mSyncManager->blockSave() ) { return; + } mSyncManager->setBlockSave(true); if ( mView->checkAllFileVersions() ) { if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ QDate reference ( 2000,1,1); @@ -2000,10 +2005,13 @@ void MainWindow::save() if ( !isMinimized () ) setCaption(savemes); else qDebug(savemes); - } else + } else { setCaption(i18n("Saving cancelled!")); + mCalendarModifiedFlag = false; + slotModifiedChanged( true ); + } mSyncManager->setBlockSave( false ); } void MainWindow::keyReleaseEvent ( QKeyEvent * e) |