summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 14f52b8..ed7a443 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -341,31 +341,22 @@ void KOAgenda::marcus_bains()
{
if(mMarcusBains) mMarcusBains->updateLocation(true);
}
void KOAgenda::changeColumns(int columns)
{
if (columns == 0) {
- kdDebug() << "KOAgenda::changeColumns() called with argument 0" << endl;
+ qDebug("KOAgenda::changeColumns() called with argument 0 ");
return;
}
-
clear();
-
mColumns = columns;
-// setMinimumSize(mColumns * 10, mGridSpacingY + 1);
-// init();
-// update();
- //qDebug("KOAgenda::changeColumns ");
computeSizes();
- // QResizeEvent event( size(), size() );
-
- //QApplication::sendEvent( this, &event );
}
/*
This is the eventFilter function, which gets all events from the KOAgendaItems
contained in the agenda. It has to handle moving and resizing for all items.
*/
bool KOAgenda::eventFilter ( QObject *object, QEvent *event )
{
@@ -1743,29 +1734,26 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
globalFlagBlockAgendaItemUpdate = 1;
item->repaint();
}
/*
Insert KOAgendaItem into agenda.
*/
KOAgendaItem *KOAgenda::insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom)
{
- //kdDebug() << "KOAgenda::insertItem:" << event->summary() << "-" << qd.toString() << " ;top, bottom:" << YTop << "," << YBottom << endl;
-
if (mAllDayMode) {
- kdDebug() << "KOAgenda: calling insertItem in all-day mode is illegal." << endl;
+ qDebug("KOAgenda: calling insertItem in all-day mode is illegal. ");
return 0;
}
KOAgendaItem *agendaItem = getNewItem(event,qd,viewport());
//agendaItem->setFrameStyle(WinPanel|Raised);
int YSize = YBottom - YTop + 1;
if (YSize < 0) {
- kdDebug() << "KOAgenda::insertItem(): Text: " << agendaItem->text() << " YSize<0" << endl;
YSize = 1;
}
int iheight = mGridSpacingY * YSize;
agendaItem->resize(mGridSpacingX,iheight );
agendaItem->setCellXY(X,YTop,YBottom);
agendaItem->setCellXWidth(X);
@@ -1885,19 +1873,19 @@ void KOAgenda::resizeEvent ( QResizeEvent *ev )
computeSizes();
return;
}
void KOAgenda::computeSizes()
{
if ( globalFlagBlockStartup )
return;
-
+ int frameOffset = frameWidth() * 2 +1;
if (mAllDayMode) {
- mGridSpacingX = (width()-3) / mColumns;
+ mGridSpacingX = (width()-frameOffset) / mColumns;
mGridSpacingY = height() - 2 * frameWidth() - 1;
resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY + 1);
// mGridSpacingY = height();
// resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 );
KOAgendaItem *item;
int subCellWidth;
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
@@ -1905,17 +1893,17 @@ void KOAgenda::computeSizes()
item->resize(mGridSpacingX * item->cellWidth(),subCellWidth);
moveChild(item,KOGlobals::self()->reverseLayout() ?
(mColumns - 1 - item->cellX()) * mGridSpacingX :
item->cellX() * mGridSpacingX,
item->subCell() * subCellWidth);
}
KOPrefs::instance()->mAllDaySize = mGridSpacingY;
} else {
- mGridSpacingX = (width() - verticalScrollBar()->width()-3)/mColumns;
+ mGridSpacingX = (width() - verticalScrollBar()->width()-frameOffset)/mColumns;
if (height() > mGridSpacingY * mRows + 1 ) {
KOPrefs::instance()->mHourSize = ((height())/mRows)+1;
mGridSpacingY = KOPrefs::instance()->mHourSize ;
resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 );
emit resizedSignal();
} else
resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 );
KOAgendaItem *item;