author | zautrix <zautrix> | 2005-07-07 21:34:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-07 21:34:31 (UTC) |
commit | 3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc (patch) (side-by-side diff) | |
tree | 6fceb199e62afe671ed34acb308749ea09cac578 /korganizer | |
parent | de5621f2fd3924f27c05459ae555b3bd06c5e584 (diff) | |
download | kdepimpi-3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc.zip kdepimpi-3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc.tar.gz kdepimpi-3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/calendarview.cpp | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 65750af..426e8f9 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -661,33 +661,48 @@ void CalendarView::nextConflict( bool all, bool allday ) Event * test = testlist.first(); while ( test ) { test->setTagged( false ); + test = testlist.next(); } QDateTime startDT = QDateTime (mNavigator->selectedDates().first().addDays(1), QTime ( 0,0,0)); QDateTime conflict; QDateTime retVal; bool found = false; Event * cE = 0; + Event * cE2 = 0; QPtrList<Event> testlist2 = testlist; + test = testlist.first(); + bool skip = false; while ( test ) { - Event * test2 = testlist2.first(); - while ( test2 ) { - if ( !test2->isTagged() ) { - if ( test->isOverlapping ( test2, &retVal, true ) ) { - if ( ! found ) { - if ( retVal >= startDT ) { - conflict = retVal; - cE = test; - found = true; - } - } else { - if ( retVal >= startDT && retVal < conflict ) { - conflict = retVal; - cE = test; + skip = false; + if ( !all ) skip = ( allday != test->doesFloat() ); + if ( !skip ) { + Event * test2 = testlist2.first(); + while ( test2 ) { + skip = false; + if ( !all ) skip = ( allday != test2->doesFloat() ); + if ( !skip ) { + if ( !test2->isTagged() ) { + if ( test->isOverlapping ( test2, &retVal, &startDT ) ) { + //qDebug("overlap "); + if ( ! found ) { + if ( retVal >= startDT ) { + conflict = retVal; + cE = test; + cE2 = test2; + found = true; + } + } else { + if ( retVal >= startDT && retVal < conflict ) { + conflict = retVal; + cE = test; + cE2 = test2; + } + } } } } + test2 = testlist2.next(); } - test2 = testlist2.next(); } test->setTagged( true ); test = testlist.next(); @@ -698,11 +713,11 @@ void CalendarView::nextConflict( bool all, bool allday ) 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( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); return; } - topLevelWidget()->setCaption( i18n("No conflict found within the next two years") ); + topLevelWidget()->setCaption( i18n("No conflict found") ); qDebug("No conflict found "); return; @@ -2794,9 +2809,10 @@ void CalendarView::checkConflictForEvent() QDateTime retVal; bool found = false; Event * cE = 0; + QDateTime current = QDateTime::currentDateTime(); while ( test ) { if ( !test->doesFloat() ) { - if ( mConflictingEvent->isOverlapping ( test, &retVal, true ) ) { + if ( mConflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { if ( ! found ) { conflict = retVal; cE = test; |