-rw-r--r-- | korganizer/calendarview.cpp | 64 |
1 files changed, 6 insertions, 58 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 426e8f9..2582931 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -101,12 +101,13 @@ | |||
101 | #include "koeventviewerdialog.h" | 101 | #include "koeventviewerdialog.h" |
102 | #include "publishdialog.h" | 102 | #include "publishdialog.h" |
103 | #include "kofilterview.h" | 103 | #include "kofilterview.h" |
104 | #include "koglobals.h" | 104 | #include "koglobals.h" |
105 | #include "koviewmanager.h" | 105 | #include "koviewmanager.h" |
106 | #include "koagendaview.h" | 106 | #include "koagendaview.h" |
107 | #include "koagenda.h" | ||
107 | #include "kodialogmanager.h" | 108 | #include "kodialogmanager.h" |
108 | #include "outgoingdialog.h" | 109 | #include "outgoingdialog.h" |
109 | #include "incomingdialog.h" | 110 | #include "incomingdialog.h" |
110 | #include "datenavigatorcontainer.h" | 111 | #include "datenavigatorcontainer.h" |
111 | #include "statusdialog.h" | 112 | #include "statusdialog.h" |
112 | #include "kdatenavigator.h" | 113 | #include "kdatenavigator.h" |
@@ -660,13 +661,17 @@ void CalendarView::nextConflict( bool all, bool allday ) | |||
660 | QPtrList<Event> testlist = mCalendar->events(); | 661 | QPtrList<Event> testlist = mCalendar->events(); |
661 | Event * test = testlist.first(); | 662 | Event * test = testlist.first(); |
662 | while ( test ) { | 663 | while ( test ) { |
663 | test->setTagged( false ); | 664 | test->setTagged( false ); |
664 | test = testlist.next(); | 665 | test = testlist.next(); |
665 | } | 666 | } |
666 | QDateTime startDT = QDateTime (mNavigator->selectedDates().first().addDays(1), QTime ( 0,0,0)); | 667 | QTime st ( 0,0,0); |
668 | if ( mViewManager->currentView() == mViewManager->agendaView() ) | ||
669 | st = mViewManager->agendaView()->agenda()->getEndTime(); | ||
670 | //qDebug("time %s ", st.toString().latin1()); | ||
671 | QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st); | ||
667 | QDateTime conflict; | 672 | QDateTime conflict; |
668 | QDateTime retVal; | 673 | QDateTime retVal; |
669 | bool found = false; | 674 | bool found = false; |
670 | Event * cE = 0; | 675 | Event * cE = 0; |
671 | Event * cE2 = 0; | 676 | Event * cE2 = 0; |
672 | QPtrList<Event> testlist2 = testlist; | 677 | QPtrList<Event> testlist2 = testlist; |
@@ -717,69 +722,12 @@ void CalendarView::nextConflict( bool all, bool allday ) | |||
717 | return; | 722 | return; |
718 | } | 723 | } |
719 | 724 | ||
720 | topLevelWidget()->setCaption( i18n("No conflict found") ); | 725 | topLevelWidget()->setCaption( i18n("No conflict found") ); |
721 | qDebug("No conflict found "); | 726 | qDebug("No conflict found "); |
722 | return; | 727 | return; |
723 | |||
724 | |||
725 | |||
726 | |||
727 | |||
728 | #if 0 | ||
729 | |||
730 | |||
731 | QDate end = start.addDays( 365*2); | ||
732 | while ( start < end ) { | ||
733 | QPtrList<Event> eventList = calendar()->events( start ); | ||
734 | Event * ev = eventList.first(); | ||
735 | QPtrList<Event> test = eventList; | ||
736 | while ( ev ) { | ||
737 | //qDebug("found %d on %s ", eventList.count(), start.toString().latin1()); | ||
738 | Event * t_ev = test.first(); | ||
739 | QDateTime es = ev->dtStart(); | ||
740 | QDateTime ee = ev->dtEnd(); | ||
741 | if ( ev->doesFloat() ) | ||
742 | ee = ee.addDays( 1 ); | ||
743 | if ( ! all ) { | ||
744 | if ( ev->doesFloat() != allday ) | ||
745 | t_ev = 0; | ||
746 | } | ||
747 | while ( t_ev ) { | ||
748 | bool skip = false; | ||
749 | if ( ! all ) { | ||
750 | if ( t_ev->doesFloat() != allday ) | ||
751 | skip = true; | ||
752 | } | ||
753 | if ( !skip && ev != t_ev ) { | ||
754 | QDateTime ets = t_ev->dtStart(); | ||
755 | QDateTime ete = t_ev->dtEnd(); | ||
756 | if ( t_ev->doesFloat() ) | ||
757 | ete = ete.addDays( 1 ); | ||
758 | //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() ); | ||
759 | if ( es < ete && ets < ee ) { | ||
760 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) | ||
761 | mViewManager->showDayView(); | ||
762 | mNavigator->slotDaySelect( start ); | ||
763 | int hour = es.time().hour(); | ||
764 | if ( ets > es ) | ||
765 | hour = ets.time().hour(); | ||
766 | mViewManager->agendaView()->setStartHour( hour ); | ||
767 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) ); | ||
768 | return; | ||
769 | } | ||
770 | } | ||
771 | t_ev = test.next(); | ||
772 | } | ||
773 | ev = eventList.next(); | ||
774 | } | ||
775 | start = start.addDays( 1 ); | ||
776 | } | ||
777 | topLevelWidget()->setCaption( i18n("No conflict found within the next two years") ); | ||
778 | qDebug("No conflict found "); | ||
779 | #endif | ||
780 | } | 728 | } |
781 | 729 | ||
782 | void CalendarView::conflictAll() | 730 | void CalendarView::conflictAll() |
783 | { | 731 | { |
784 | nextConflict ( true, true ); | 732 | nextConflict ( true, true ); |
785 | } | 733 | } |