summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp73
1 files changed, 56 insertions, 17 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 26323b1..898da6c 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -3035,9 +3035,18 @@ void CalendarView::changeEventDisplay(Event *which, int action)
int time = 1000;
#ifdef DESKTOP_VERSION
time = 500;
#endif
- QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) );
+ bool checkC = false;
+ if ( mConflictingEvent->doesFloat() ) {
+ checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay
+ || KOPrefs::instance()->mCheckConflictsAllDayNonAD;
+ } else {
+ checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay
+ || KOPrefs::instance()->mCheckConflictsNonADNonAD;
+ }
+ if ( checkC )
+ QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) );
}
// }
} else {
mViewManager->currentView()->updateView();
@@ -3054,34 +3063,64 @@ void CalendarView::checkConflictForEvent()
QDateTime current = QDateTime::currentDateTime();
if ( ! conflictingEvent->matchTime( &current, 0 ) ) {
return;
}
+ CalFilter *filterIN = 0;
+ CalFilter *filterALL = 0;
+ CalFilter *filter = mFilters.first();
+ while(filter) {
+ if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem)
+ filterIN = filter;
+ if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem )
+ filterALL = filter;
+ filter = mFilters.next();
+ }
+ if ( filterIN ) {
+ if ( !filterIN->filterCalendarItem( conflictingEvent ) ) {
+ return;
+ }
+ }
QPtrList<Event> testlist = mCalendar->events();
Event * test = testlist.first();
QDateTime conflict;
QDateTime retVal;
bool found = false;
Event * cE = 0;
+ bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay;
+ bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD;
+ if ( !conflictingEvent->doesFloat() ) {
+ chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay;
+ chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD;
+ }
topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
while ( test ) {
qApp->processEvents();
- bool skip = false;
- if ( found )
- skip = !test->matchTime( &current, &conflict );
- else
- skip = !test->matchTime( &current, 0 );
- if ( !skip && !test->doesFloat() ) {
- if ( conflictingEvent->isOverlapping ( test, &retVal, &current ) ) {
- if ( ! found ) {
- conflict = retVal;
- cE = test;
- } else {
- if ( retVal < conflict ) {
- conflict = retVal;
- cE = test;
+ bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad );
+ if ( !skip ) {
+ if ( filterALL ) {
+ if ( !filterALL->filterCalendarItem( test ) ) {
+ skip = true;
+ }
+ }
+ if ( !skip ) {
+ if ( found )
+ skip = !test->matchTime( &current, &conflict );
+ else
+ skip = !test->matchTime( &current, 0 );
+ if ( !skip ) {
+ if ( conflictingEvent->isOverlapping ( test, &retVal, &current ) ) {
+ if ( ! found ) {
+ conflict = retVal;
+ cE = test;
+ } else {
+ if ( retVal < conflict ) {
+ conflict = retVal;
+ cE = test;
+ }
+ }
+ found = true;
}
}
- found = true;
}
}
test = testlist.next();
}
@@ -3089,9 +3128,9 @@ void CalendarView::checkConflictForEvent()
if ( found ) {
QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( conflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ;
qApp->processEvents();
int km = KMessageBox::warningContinueCancel(this,mess,
- i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!"));
+ i18n("KO/Pi Conflict detected"),i18n("Show date"),i18n("No problem!"));
if ( km != KMessageBox::Continue ) {
return;
}
if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )