summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-07-07 21:34:31 (UTC)
committer zautrix <zautrix>2005-07-07 21:34:31 (UTC)
commit3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc (patch) (unidiff)
tree6fceb199e62afe671ed34acb308749ea09cac578 /korganizer
parentde5621f2fd3924f27c05459ae555b3bd06c5e584 (diff)
downloadkdepimpi-3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc.zip
kdepimpi-3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc.tar.gz
kdepimpi-3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc.tar.bz2
fixxx
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 65750af..426e8f9 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -661,34 +661,49 @@ void CalendarView::nextConflict( bool all, bool allday )
661 Event * test = testlist.first(); 661 Event * test = testlist.first();
662 while ( test ) { 662 while ( test ) {
663 test->setTagged( false ); 663 test->setTagged( false );
664 test = testlist.next();
664 } 665 }
665 QDateTime startDT = QDateTime (mNavigator->selectedDates().first().addDays(1), QTime ( 0,0,0)); 666 QDateTime startDT = QDateTime (mNavigator->selectedDates().first().addDays(1), QTime ( 0,0,0));
666 QDateTime conflict; 667 QDateTime conflict;
667 QDateTime retVal; 668 QDateTime retVal;
668 bool found = false; 669 bool found = false;
669 Event * cE = 0; 670 Event * cE = 0;
671 Event * cE2 = 0;
670 QPtrList<Event> testlist2 = testlist; 672 QPtrList<Event> testlist2 = testlist;
673 test = testlist.first();
674 bool skip = false;
671 while ( test ) { 675 while ( test ) {
676 skip = false;
677 if ( !all ) skip = ( allday != test->doesFloat() );
678 if ( !skip ) {
672 Event * test2 = testlist2.first(); 679 Event * test2 = testlist2.first();
673 while ( test2 ) { 680 while ( test2 ) {
681 skip = false;
682 if ( !all ) skip = ( allday != test2->doesFloat() );
683 if ( !skip ) {
674 if ( !test2->isTagged() ) { 684 if ( !test2->isTagged() ) {
675 if ( test->isOverlapping ( test2, &retVal, true ) ) { 685 if ( test->isOverlapping ( test2, &retVal, &startDT ) ) {
686 //qDebug("overlap ");
676 if ( ! found ) { 687 if ( ! found ) {
677 if ( retVal >= startDT ) { 688 if ( retVal >= startDT ) {
678 conflict = retVal; 689 conflict = retVal;
679 cE = test; 690 cE = test;
691 cE2 = test2;
680 found = true; 692 found = true;
681 } 693 }
682 } else { 694 } else {
683 if ( retVal >= startDT && retVal < conflict ) { 695 if ( retVal >= startDT && retVal < conflict ) {
684 conflict = retVal; 696 conflict = retVal;
685 cE = test; 697 cE = test;
698 cE2 = test2;
699 }
686 } 700 }
687 } 701 }
688 } 702 }
689 } 703 }
690 test2 = testlist2.next(); 704 test2 = testlist2.next();
691 } 705 }
706 }
692 test->setTagged( true ); 707 test->setTagged( true );
693 test = testlist.next(); 708 test = testlist.next();
694 } 709 }
@@ -698,11 +713,11 @@ void CalendarView::nextConflict( bool all, bool allday )
698 mNavigator->slotDaySelect( conflict.date() ); 713 mNavigator->slotDaySelect( conflict.date() );
699 int hour = conflict.time().hour(); 714 int hour = conflict.time().hour();
700 mViewManager->agendaView()->setStartHour( hour ); 715 mViewManager->agendaView()->setStartHour( hour );
701 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); 716 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) );
702 return; 717 return;
703 } 718 }
704 719
705 topLevelWidget()->setCaption( i18n("No conflict found within the next two years") ); 720 topLevelWidget()->setCaption( i18n("No conflict found") );
706 qDebug("No conflict found "); 721 qDebug("No conflict found ");
707 return; 722 return;
708 723
@@ -2794,9 +2809,10 @@ void CalendarView::checkConflictForEvent()
2794 QDateTime retVal; 2809 QDateTime retVal;
2795 bool found = false; 2810 bool found = false;
2796 Event * cE = 0; 2811 Event * cE = 0;
2812 QDateTime current = QDateTime::currentDateTime();
2797 while ( test ) { 2813 while ( test ) {
2798 if ( !test->doesFloat() ) { 2814 if ( !test->doesFloat() ) {
2799 if ( mConflictingEvent->isOverlapping ( test, &retVal, true ) ) { 2815 if ( mConflictingEvent->isOverlapping ( test, &retVal, &current ) ) {
2800 if ( ! found ) { 2816 if ( ! found ) {
2801 conflict = retVal; 2817 conflict = retVal;
2802 cE = test; 2818 cE = test;