summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp2
-rw-r--r--korganizer/koagendaview.cpp31
2 files changed, 2 insertions, 31 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index f860f7d..94c3b22 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1114,49 +1114,49 @@ void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos)
!moveItem->lastMultiItem()) {
setCursor(sizeVerCursor);
} else {
setCursor(arrowCursor);
}
}
}
/*
Place item in cell and take care that multiple items using the same cell do
not overlap. This method is not yet optimal. It doesn´t use the maximum space
it can get in all cases.
At the moment the method has a bug: When an item is placed only the sub cell
widths of the items are changed, which are within the Y region the item to
place spans. When the sub cell width change of one of this items affects a
cell, where other items are, which do not overlap in Y with the item to place,
the display gets corrupted, although the corruption looks quite nice.
*/
void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
{
QPtrList<KOAgendaItem> conflictItems;
int maxSubCells = 0;
- QIntDict<KOAgendaItem> subCellDict(5);
+ QIntDict<KOAgendaItem> subCellDict(7);
KOAgendaItem *item;
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
if (item != placeItem) {
if (placeItem->cellX() <= item->cellXWidth() &&
placeItem->cellXWidth() >= item->cellX()) {
if ((placeItem->cellYTop() <= item->cellYBottom()) &&
(placeItem->cellYBottom() >= item->cellYTop())) {
conflictItems.append(item);
if (item->subCells() > maxSubCells)
maxSubCells = item->subCells();
subCellDict.insert(item->subCell(),item);
}
}
}
}
if (conflictItems.count() > 0) {
// Look for unused sub cell and insert item
int i;
for(i=0;i<maxSubCells;++i) {
if (!subCellDict.find(i)) {
placeItem->setSubCell(i);
break;
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index a42227c..5a63b35 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1100,75 +1100,69 @@ void KOAgendaView::fillAgenda()
if ( globalFlagBlockStartup )
return;
if ( globalFlagBlockAgenda == 1 )
return;
static bool onlyOne = false;
if ( onlyOne )
return;
onlyOne = true;
//if ( globalFlagBlockAgenda == 2 )
//globalFlagBlockAgenda = 0;
// globalFlagBlockPainting = false;
if ( globalFlagBlockAgenda == 0 )
globalFlagBlockAgenda = 1;
// clearView();
//qDebug("fillAgenda()++++ ");
globalFlagBlockAgendaItemPaint = 1;
mAllDayAgenda->changeColumns(mSelectedDates.count());
mAgenda->changeColumns(mSelectedDates.count());
qApp->processEvents();
mEventIndicatorTop->changeColumns(mSelectedDates.count());
mEventIndicatorBottom->changeColumns(mSelectedDates.count());
setHolidayMasks();
- //mAgenda->hideUnused();
- //mAllDayAgenda->hideUnused();
-
- // mAgenda->blockNextRepaint( false );
- // mAgenda->viewport()->repaint();
- // mAgenda->blockNextRepaint( true );
mMinY.resize(mSelectedDates.count());
mMaxY.resize(mSelectedDates.count());
QPtrList<Event> dayEvents;
// ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.
// Therefore, gtodoset all of them.
QPtrList<Todo> todos = calendar()->todos();
mAgenda->setDateList(mSelectedDates);
QDate today = QDate::currentDate();
DateList::ConstIterator dit;
int curCol = 0;
for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) {
QDate currentDate = *dit;
// kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString()
// << endl;
- dayEvents = calendar()->events(currentDate,true);
+ dayEvents = calendar()->events(currentDate,false);
// Default values, which can never be reached
mMinY[curCol] = mAgenda->timeToY(QTime(23,59)) + 1;
mMaxY[curCol] = mAgenda->timeToY(QTime(0,0)) - 1;
unsigned int numEvent;
for(numEvent=0;numEvent<dayEvents.count();++numEvent) {
Event *event = dayEvents.at(numEvent);
if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") )
if ( event->uid().left(15) == QString("last-syncEvent-") )
continue;
// kdDebug() << " Event: " << event->summary() << endl;
int beginX = currentDate.daysTo(event->dtStart().date()) + curCol;
int endX = currentDate.daysTo(event->dtEnd().date()) + curCol;
// kdDebug() << " beginX: " << beginX << " endX: " << endX << endl;
if (event->doesFloat()) {
if (event->recurrence()->doesRecur()) {
if (event->isMultiDay() ) {
endX = endX - beginX;// endX is now number of days
if ( event->recursOn( currentDate ) ) {
endX += curCol;
@@ -1268,104 +1262,81 @@ void KOAgendaView::fillAgenda()
dt = todo->completed();
else
dt = todo->dtDue();;
int endY = mAgenda->timeToY(dt.time()) - 1;
int hi = (18/KOPrefs::instance()->mHourSize);
//qDebug("hei %d ",KOPrefs::instance()->mHourSize);
int startY = endY -hi;
mAgenda->insertItem(todo,currentDate,curCol,startY,endY);
if (startY < mMinY[curCol]) mMinY[curCol] = startY;
if (endY > mMaxY[curCol]) mMaxY[curCol] = endY;
}
}
}
// ---------- display Todos] --------------
++curCol;
}
mAgenda->hideUnused();
mAllDayAgenda->hideUnused();
mAgenda->checkScrollBoundaries();
-
deleteSelectedDateTime();
-
createDayLabels();
emit incidenceSelected( 0 );
if ( globalFlagBlockAgenda == 2 ) {
if ( KOPrefs::instance()->mSetTimeToDayStartAt )
setStartHour( KOPrefs::instance()->mDayBegins );
else if ( KOPrefs::instance()->mCenterOnCurrentTime )
setStartHour( QTime::currentTime ().hour() );
- // qApp->processEvents();
}
qApp->processEvents();
- //qDebug("qApp->processEvents(); END ");
globalFlagBlockAgenda = 0;
-
- // mAgenda->hideUnused();
- //mAllDayAgenda->hideUnused();
mAllDayAgenda->drawContentsToPainter();
mAgenda->drawContentsToPainter();
repaintAgenda();
onlyOne = false;
- // mAgenda->finishUpdate();
- //mAllDayAgenda->finishUpdate();
-
- // repaintAgenda();
- //qApp->processEvents();
- // globalFlagBlockAgenda = 0;
}
void KOAgendaView::repaintAgenda()
{
- // mAllDayAgenda->drawContentsToPainter();
-// mAllDayAgenda->viewport()->repaint( false );
-// mAgenda->drawContentsToPainter();
-// mAgenda->viewport()->repaint( false );
-// qApp->processEvents();
-
- //qDebug("KOAgendaView::repaintAgenda() ");
- //qApp->processEvents();
mAgenda->viewport()->repaint( false );
mAllDayAgenda->viewport()->repaint( false );
mAgenda->finishUpdate();
mAllDayAgenda->finishUpdate();
}
void KOAgendaView::clearView()
{
- // kdDebug() << "ClearView" << endl;
mAllDayAgenda->clear();
mAgenda->clear();
}
void KOAgendaView::clearList()
{
- // kdDebug() << "ClearView" << endl;
clearView();
mAllDayAgenda->hideUnused();
mAgenda->hideUnused();
}
void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd,
const QDate &td)
{
#ifndef KORG_NOPRINTER
if (fd == td)
calPrinter->preview(CalPrinter::Day, fd, td);
else
calPrinter->preview(CalPrinter::Week, fd, td);
#endif
}
// void KOAgendaView::updateMovedTodo()
// {
// // updateConfig();
// // emit updateTodoViews();
// }
void KOAgendaView::slotShowDateView( int mode , int d )
{