summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp19
-rw-r--r--korganizer/mainwindow.cpp12
2 files changed, 20 insertions, 11 deletions
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;
- QDateTime current = QDateTime::currentDateTime();
- if ( ! mConflictingEvent->matchTime( &current, 0 ) ) {
+ Event * conflictingEvent = mConflictingEvent;
mConflictingEvent = 0;
+ QDateTime current = QDateTime::currentDateTime();
+ if ( ! conflictingEvent->matchTime( &current, 0 ) ) {
return;
}
QPtrList<Event> testlist = mCalendar->events();
@@ -2813,7 +2814,7 @@ void CalendarView::checkConflictForEvent()
else
skip = !test->matchTime( &current, 0 );
if ( !skip && !test->doesFloat() ) {
- if ( mConflictingEvent->isOverlapping ( test, &retVal, &current ) ) {
+ if ( conflictingEvent->isOverlapping ( test, &retVal, &current ) ) {
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;
+ 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 );
}