-rw-r--r-- | korganizer/calendarview.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 9928b48..14094bb 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -3023,48 +3023,50 @@ void CalendarView::changeEventDisplay(Event *which, int action) | |||
3023 | } | 3023 | } |
3024 | clearallviews = true; | 3024 | clearallviews = true; |
3025 | mDateNavigator->updateView(); | 3025 | mDateNavigator->updateView(); |
3026 | //mDialogManager->updateSearchDialog(); | 3026 | //mDialogManager->updateSearchDialog(); |
3027 | if (which) { | 3027 | if (which) { |
3028 | // If there is an event view visible update the display | 3028 | // If there is an event view visible update the display |
3029 | mViewManager->currentView()->changeEventDisplay(which,action); | 3029 | mViewManager->currentView()->changeEventDisplay(which,action); |
3030 | // TODO: check, if update needed | 3030 | // TODO: check, if update needed |
3031 | // if (which->getTodoStatus()) { | 3031 | // if (which->getTodoStatus()) { |
3032 | mTodoList->updateView(); | 3032 | mTodoList->updateView(); |
3033 | if ( action != KOGlobals::EVENTDELETED && KOPrefs::instance()->mDetectConflicts ) { | 3033 | if ( action != KOGlobals::EVENTDELETED && KOPrefs::instance()->mDetectConflicts ) { |
3034 | mConflictingEvent = which ; | 3034 | mConflictingEvent = which ; |
3035 | int time = 1000; | 3035 | int time = 1000; |
3036 | #ifdef DESKTOP_VERSION | 3036 | #ifdef DESKTOP_VERSION |
3037 | time = 500; | 3037 | time = 500; |
3038 | #endif | 3038 | #endif |
3039 | bool checkC = false; | 3039 | bool checkC = false; |
3040 | if ( mConflictingEvent->doesFloat() ) { | 3040 | if ( mConflictingEvent->doesFloat() ) { |
3041 | checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay | 3041 | checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay |
3042 | || KOPrefs::instance()->mCheckConflictsAllDayNonAD; | 3042 | || KOPrefs::instance()->mCheckConflictsAllDayNonAD; |
3043 | } else { | 3043 | } else { |
3044 | checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay | 3044 | checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay |
3045 | || KOPrefs::instance()->mCheckConflictsNonADNonAD; | 3045 | || KOPrefs::instance()->mCheckConflictsNonADNonAD; |
3046 | } | 3046 | } |
3047 | if ( !KOPrefs::instance()->mIncludeFree && mConflictingEvent->transparency() == KCal::Event::Transparent ) | ||
3048 | checkC = false; | ||
3047 | if ( checkC ) | 3049 | if ( checkC ) |
3048 | QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) ); | 3050 | QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) ); |
3049 | } | 3051 | } |
3050 | // } | 3052 | // } |
3051 | } else { | 3053 | } else { |
3052 | mViewManager->currentView()->updateView(); | 3054 | mViewManager->currentView()->updateView(); |
3053 | } | 3055 | } |
3054 | } | 3056 | } |
3055 | void CalendarView::checkConflictForEvent() | 3057 | void CalendarView::checkConflictForEvent() |
3056 | { | 3058 | { |
3057 | 3059 | ||
3058 | if (!KOPrefs::instance()->mConfirm) | 3060 | if (!KOPrefs::instance()->mConfirm) |
3059 | return; | 3061 | return; |
3060 | if ( ! mConflictingEvent ) return; | 3062 | if ( ! mConflictingEvent ) return; |
3061 | Event * conflictingEvent = mConflictingEvent; | 3063 | Event * conflictingEvent = mConflictingEvent; |
3062 | mConflictingEvent = 0; | 3064 | mConflictingEvent = 0; |
3063 | QDateTime current = QDateTime::currentDateTime(); | 3065 | QDateTime current = QDateTime::currentDateTime(); |
3064 | if ( ! conflictingEvent->matchTime( ¤t, 0 ) ) { | 3066 | if ( ! conflictingEvent->matchTime( ¤t, 0 ) ) { |
3065 | return; | 3067 | return; |
3066 | } | 3068 | } |
3067 | CalFilter *filterIN = 0; | 3069 | CalFilter *filterIN = 0; |
3068 | CalFilter *filterALL = 0; | 3070 | CalFilter *filterALL = 0; |
3069 | CalFilter *filter = mFilters.first(); | 3071 | CalFilter *filter = mFilters.first(); |
3070 | while(filter) { | 3072 | while(filter) { |
@@ -3074,48 +3076,53 @@ void CalendarView::checkConflictForEvent() | |||
3074 | filterALL = filter; | 3076 | filterALL = filter; |
3075 | filter = mFilters.next(); | 3077 | filter = mFilters.next(); |
3076 | } | 3078 | } |
3077 | if ( filterIN ) { | 3079 | if ( filterIN ) { |
3078 | if ( !filterIN->filterCalendarItem( conflictingEvent ) ) { | 3080 | if ( !filterIN->filterCalendarItem( conflictingEvent ) ) { |
3079 | return; | 3081 | return; |
3080 | } | 3082 | } |
3081 | } | 3083 | } |
3082 | QPtrList<Event> testlist = mCalendar->events(); | 3084 | QPtrList<Event> testlist = mCalendar->events(); |
3083 | Event * test = testlist.first(); | 3085 | Event * test = testlist.first(); |
3084 | QDateTime conflict; | 3086 | QDateTime conflict; |
3085 | QDateTime retVal; | 3087 | QDateTime retVal; |
3086 | bool found = false; | 3088 | bool found = false; |
3087 | Event * cE = 0; | 3089 | Event * cE = 0; |
3088 | bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay; | 3090 | bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay; |
3089 | bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD; | 3091 | bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD; |
3090 | if ( !conflictingEvent->doesFloat() ) { | 3092 | if ( !conflictingEvent->doesFloat() ) { |
3091 | chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay; | 3093 | chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay; |
3092 | chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD; | 3094 | chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD; |
3093 | } | 3095 | } |
3094 | topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); | 3096 | topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); |
3095 | while ( test ) { | 3097 | while ( test ) { |
3096 | qApp->processEvents(); | 3098 | qApp->processEvents(); |
3097 | bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad ); | 3099 | bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad ); |
3100 | |||
3101 | if ( !skip ) { | ||
3102 | if ( !KOPrefs::instance()->mIncludeFree && test->transparency() == KCal::Event::Transparent ) | ||
3103 | skip = true; | ||
3104 | } | ||
3098 | if ( !skip ) { | 3105 | if ( !skip ) { |
3099 | if ( filterALL ) { | 3106 | if ( filterALL ) { |
3100 | if ( !filterALL->filterCalendarItem( test ) ) { | 3107 | if ( !filterALL->filterCalendarItem( test ) ) { |
3101 | skip = true; | 3108 | skip = true; |
3102 | } | 3109 | } |
3103 | } | 3110 | } |
3104 | if ( !skip ) { | 3111 | if ( !skip ) { |
3105 | if ( found ) | 3112 | if ( found ) |
3106 | skip = !test->matchTime( ¤t, &conflict ); | 3113 | skip = !test->matchTime( ¤t, &conflict ); |
3107 | else | 3114 | else |
3108 | skip = !test->matchTime( ¤t, 0 ); | 3115 | skip = !test->matchTime( ¤t, 0 ); |
3109 | if ( !skip ) { | 3116 | if ( !skip ) { |
3110 | if ( conflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { | 3117 | if ( conflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { |
3111 | if ( ! found ) { | 3118 | if ( ! found ) { |
3112 | conflict = retVal; | 3119 | conflict = retVal; |
3113 | cE = test; | 3120 | cE = test; |
3114 | } else { | 3121 | } else { |
3115 | if ( retVal < conflict ) { | 3122 | if ( retVal < conflict ) { |
3116 | conflict = retVal; | 3123 | conflict = retVal; |
3117 | cE = test; | 3124 | cE = test; |
3118 | } | 3125 | } |
3119 | } | 3126 | } |
3120 | found = true; | 3127 | found = true; |
3121 | } | 3128 | } |