-rw-r--r-- | korganizer/calendarview.cpp | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index a9e402e..427d71b 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -661,3 +661,5 @@ void CalendarView::nextConflict( bool all, bool allday ) { - + static bool block = false; + if ( block ) return; + block = true; QPtrList<Event> testlist = mCalendar->events(); @@ -682,2 +684,4 @@ void CalendarView::nextConflict( bool all, bool allday ) topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); + //QTime tm; + //tm.start(); while ( test ) { @@ -687,8 +691,19 @@ void CalendarView::nextConflict( bool all, bool allday ) if ( !skip ) { + if ( found ) + skip = !test->matchTime( &startDT, &conflict ); + else + skip = !test->matchTime( &startDT, 0 ); + } + if ( !skip ) { Event * test2 = testlist2.first(); while ( test2 ) { - skip = false; - if ( !all ) skip = ( allday != test2->doesFloat() ); + skip = test2->isTagged(); + if ( !skip && !all ) skip = ( allday != test2->doesFloat() ); + if ( !skip ) { + if ( found ) + skip = !test2->matchTime( &startDT, &conflict ); + else + skip = !test2->matchTime( &startDT, 0 ); + } if ( !skip ) { - if ( !test2->isTagged() ) { if ( test->isOverlapping ( test2, &retVal, &startDT ) ) { @@ -711,3 +726,2 @@ void CalendarView::nextConflict( bool all, bool allday ) } - } test2 = testlist2.next(); @@ -718,2 +732,3 @@ void CalendarView::nextConflict( bool all, bool allday ) } + //qDebug("Search time : %d", tm.elapsed()); if ( found ) { @@ -725,2 +740,3 @@ void CalendarView::nextConflict( bool all, bool allday ) topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); + block = false; return; @@ -730,2 +746,3 @@ void CalendarView::nextConflict( bool all, bool allday ) qDebug("No conflict found "); + block = false; return; @@ -2774,3 +2791,7 @@ void CalendarView::checkConflictForEvent() if ( ! mConflictingEvent ) return; - topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); + QDateTime current = QDateTime::currentDateTime(); + if ( ! mConflictingEvent->matchTime( ¤t, 0 ) ) { + mConflictingEvent = 0; + return; + } QPtrList<Event> testlist = mCalendar->events(); @@ -2781,6 +2802,11 @@ void CalendarView::checkConflictForEvent() Event * cE = 0; - QDateTime current = QDateTime::currentDateTime(); + topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); while ( test ) { qApp->processEvents(); - if ( !test->doesFloat() ) { + bool skip = false; + if ( found ) + skip = !test->matchTime( ¤t, &conflict ); + else + skip = !test->matchTime( ¤t, 0 ); + if ( !skip && !test->doesFloat() ) { if ( mConflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { |