From d0fe94073aa3209532952c944b41bccfb4341a8d Mon Sep 17 00:00:00 2001 From: zautrix Date: Tue, 26 Jul 2005 15:43:00 +0000 Subject: fixxx --- diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 3ab4bb4..a76f2ed 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -370,7 +370,7 @@ void CalendarView::init() setFocusPolicy (NoFocus ); mViewerCallerIsSearchDialog = false; mBlockShowDates = false; - + mConflictingEvent = 0; mDatePickerMode = 0; mCurrentSyncDevice = ""; mViewManager = new KOViewManager( this ); @@ -2793,9 +2793,10 @@ 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 testlist = mCalendar->events(); @@ -2813,7 +2814,7 @@ void CalendarView::checkConflictForEvent() 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; @@ -2830,7 +2831,7 @@ void CalendarView::checkConflictForEvent() } 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!")); @@ -2842,10 +2843,9 @@ void CalendarView::checkConflictForEvent() 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; } @@ -4092,12 +4092,13 @@ 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 @@ -1914,6 +1914,10 @@ void MainWindow::slotModifiedChanged( bool ) 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() ) @@ -1975,8 +1979,9 @@ void MainWindow::save() 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 ){ @@ -2001,8 +2006,11 @@ void MainWindow::save() setCaption(savemes); else qDebug(savemes); - } else + } else { setCaption(i18n("Saving cancelled!")); + mCalendarModifiedFlag = false; + slotModifiedChanged( true ); + } mSyncManager->setBlockSave( false ); } -- cgit v0.9.0.2