-rw-r--r-- | korganizer/koagendaview.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 42a6f7c..8b79788 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -1462,88 +1462,87 @@ void KOAgendaView::newTimeSpanSelected(int gxStart, int gyStart, | |||
1462 | int gxEnd, int gyEnd) | 1462 | int gxEnd, int gyEnd) |
1463 | { | 1463 | { |
1464 | if (!mSelectedDates.count()) return; | 1464 | if (!mSelectedDates.count()) return; |
1465 | 1465 | ||
1466 | QDate dayStart = mSelectedDates[gxStart]; | 1466 | QDate dayStart = mSelectedDates[gxStart]; |
1467 | QDate dayEnd = mSelectedDates[gxEnd]; | 1467 | QDate dayEnd = mSelectedDates[gxEnd]; |
1468 | 1468 | ||
1469 | QTime timeStart = mAgenda->gyToTime(gyStart); | 1469 | QTime timeStart = mAgenda->gyToTime(gyStart); |
1470 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); | 1470 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); |
1471 | 1471 | ||
1472 | QDateTime dtStart(dayStart,timeStart); | 1472 | QDateTime dtStart(dayStart,timeStart); |
1473 | QDateTime dtEnd(dayEnd,timeEnd); | 1473 | QDateTime dtEnd(dayEnd,timeEnd); |
1474 | 1474 | ||
1475 | mTimeSpanBegin = dtStart; | 1475 | mTimeSpanBegin = dtStart; |
1476 | mTimeSpanEnd = dtEnd; | 1476 | mTimeSpanEnd = dtEnd; |
1477 | 1477 | ||
1478 | } | 1478 | } |
1479 | 1479 | ||
1480 | void KOAgendaView::deleteSelectedDateTime() | 1480 | void KOAgendaView::deleteSelectedDateTime() |
1481 | { | 1481 | { |
1482 | mTimeSpanBegin.setDate(QDate()); | 1482 | mTimeSpanBegin.setDate(QDate()); |
1483 | mTimeSpanEnd.setDate(QDate()); | 1483 | mTimeSpanEnd.setDate(QDate()); |
1484 | mTimeSpanInAllDay = false; | 1484 | mTimeSpanInAllDay = false; |
1485 | } | 1485 | } |
1486 | 1486 | ||
1487 | void KOAgendaView::keyPressEvent ( QKeyEvent * e ) | 1487 | void KOAgendaView::keyPressEvent ( QKeyEvent * e ) |
1488 | { | 1488 | { |
1489 | e->ignore(); | 1489 | e->ignore(); |
1490 | } | 1490 | } |
1491 | 1491 | ||
1492 | void KOAgendaView::scrollOneHourUp() | 1492 | void KOAgendaView::scrollOneHourUp() |
1493 | { | 1493 | { |
1494 | 1494 | ||
1495 | mAgenda->scrollBy ( 0, -mAgenda->contentsHeight () / 24 ); | 1495 | mAgenda->scrollBy ( 0, -mAgenda->contentsHeight () / 24 ); |
1496 | } | 1496 | } |
1497 | void KOAgendaView::scrollOneHourDown() | 1497 | void KOAgendaView::scrollOneHourDown() |
1498 | { | 1498 | { |
1499 | mAgenda->scrollBy ( 0, mAgenda->contentsHeight () / 24 ); | 1499 | mAgenda->scrollBy ( 0, mAgenda->contentsHeight () / 24 ); |
1500 | } | 1500 | } |
1501 | 1501 | ||
1502 | void KOAgendaView::setStartHour( int h ) | 1502 | void KOAgendaView::setStartHour( int h ) |
1503 | { | 1503 | { |
1504 | mAgenda->setStartHour( h ); | 1504 | mAgenda->setStartHour( h ); |
1505 | 1505 | ||
1506 | } | 1506 | } |
1507 | 1507 | ||
1508 | void KOAgendaView::updateTodo( Todo * t, int ) | 1508 | void KOAgendaView::updateTodo( Todo * t, int ) |
1509 | { | 1509 | { |
1510 | |||
1511 | bool remove = false; | 1510 | bool remove = false; |
1512 | bool removeAD = false; | 1511 | bool removeAD = false; |
1513 | QDate da; | 1512 | QDate da; |
1514 | if ( t->hasCompletedDate() ) | 1513 | if ( t->hasCompletedDate() ) |
1515 | da = t->completed().date(); | 1514 | da = t->completed().date(); |
1516 | else | 1515 | else |
1517 | da = t->dtDue().date(); | 1516 | da = t->dtDue().date(); |
1518 | if ( ! t->hasDueDate() && !t->hasCompletedDate() ) { | 1517 | if ( ! t->hasDueDate() && !t->hasCompletedDate() ) { |
1519 | remove = true; | 1518 | remove = true; |
1520 | removeAD = true; | 1519 | removeAD = true; |
1521 | } | 1520 | } |
1522 | else { | 1521 | else { |
1523 | bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; | 1522 | bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; |
1524 | if ( overdue && | 1523 | if ( overdue && |
1525 | QDate::currentDate() >= mSelectedDates.first() && | 1524 | QDate::currentDate() >= mSelectedDates.first() && |
1526 | QDate::currentDate() <= mSelectedDates.last()) { | 1525 | QDate::currentDate() <= mSelectedDates.last()) { |
1527 | removeAD = false; | 1526 | removeAD = false; |
1528 | remove = true; | 1527 | remove = true; |
1529 | } | 1528 | } |
1530 | else { | 1529 | else { |
1531 | 1530 | ||
1532 | if ( da < mSelectedDates.first() || | 1531 | if ( da < mSelectedDates.first() || |
1533 | da > mSelectedDates.last() ) { | 1532 | da > mSelectedDates.last() ) { |
1534 | remove = true; | 1533 | remove = true; |
1535 | removeAD = true; | 1534 | removeAD = true; |
1536 | } else { | 1535 | } else { |
1537 | remove = t->doesFloat() && !t->hasCompletedDate(); | 1536 | remove = t->doesFloat() && !t->hasCompletedDate(); |
1538 | removeAD = !remove; | 1537 | removeAD = !remove; |
1539 | } | 1538 | } |
1540 | } | 1539 | } |
1541 | } | 1540 | } |
1542 | int days = mSelectedDates.first().daysTo( da ); | 1541 | int days = mSelectedDates.first().daysTo( da ); |
1543 | // qDebug("daysto %d ", days ); | 1542 | //qDebug("daysto %d %d %d", days, remove,removeAD ); |
1544 | mAgenda->updateTodo( t , days, remove); | 1543 | mAgenda->updateTodo( t , days, remove); |
1545 | if ( KOPrefs::instance()->mShowTodoInAgenda ) | 1544 | if ( KOPrefs::instance()->mShowTodoInAgenda ) |
1546 | mAllDayAgenda->updateTodo( t , days, removeAD); | 1545 | mAllDayAgenda->updateTodo( t , days, removeAD); |
1547 | //qDebug("KOAgendaView::updateTodo( Todo *, int ) "); | 1546 | //qDebug("KOAgendaView::updateTodo( Todo *, int ) "); |
1548 | 1547 | ||
1549 | } | 1548 | } |