summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
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
@@ -343,27 +343,18 @@ void KOAgenda::marcus_bains()
343} 343}
344 344
345 345
346void KOAgenda::changeColumns(int columns) 346void KOAgenda::changeColumns(int columns)
347{ 347{
348 if (columns == 0) { 348 if (columns == 0) {
349 kdDebug() << "KOAgenda::changeColumns() called with argument 0" << endl; 349 qDebug("KOAgenda::changeColumns() called with argument 0 ");
350 return; 350 return;
351 } 351 }
352
353 clear(); 352 clear();
354
355 mColumns = columns; 353 mColumns = columns;
356// setMinimumSize(mColumns * 10, mGridSpacingY + 1);
357// init();
358// update();
359 //qDebug("KOAgenda::changeColumns ");
360 computeSizes(); 354 computeSizes();
361 // QResizeEvent event( size(), size() );
362
363 //QApplication::sendEvent( this, &event );
364} 355}
365 356
366/* 357/*
367 This is the eventFilter function, which gets all events from the KOAgendaItems 358 This is the eventFilter function, which gets all events from the KOAgendaItems
368 contained in the agenda. It has to handle moving and resizing for all items. 359 contained in the agenda. It has to handle moving and resizing for all items.
369*/ 360*/
@@ -1745,25 +1736,22 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
1745} 1736}
1746/* 1737/*
1747 Insert KOAgendaItem into agenda. 1738 Insert KOAgendaItem into agenda.
1748*/ 1739*/
1749KOAgendaItem *KOAgenda::insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom) 1740KOAgendaItem *KOAgenda::insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom)
1750{ 1741{
1751 //kdDebug() << "KOAgenda::insertItem:" << event->summary() << "-" << qd.toString() << " ;top, bottom:" << YTop << "," << YBottom << endl;
1752
1753 if (mAllDayMode) { 1742 if (mAllDayMode) {
1754 kdDebug() << "KOAgenda: calling insertItem in all-day mode is illegal." << endl; 1743 qDebug("KOAgenda: calling insertItem in all-day mode is illegal. ");
1755 return 0; 1744 return 0;
1756 } 1745 }
1757 1746
1758 KOAgendaItem *agendaItem = getNewItem(event,qd,viewport()); 1747 KOAgendaItem *agendaItem = getNewItem(event,qd,viewport());
1759 //agendaItem->setFrameStyle(WinPanel|Raised); 1748 //agendaItem->setFrameStyle(WinPanel|Raised);
1760 1749
1761 int YSize = YBottom - YTop + 1; 1750 int YSize = YBottom - YTop + 1;
1762 if (YSize < 0) { 1751 if (YSize < 0) {
1763 kdDebug() << "KOAgenda::insertItem(): Text: " << agendaItem->text() << " YSize<0" << endl;
1764 YSize = 1; 1752 YSize = 1;
1765 } 1753 }
1766 int iheight = mGridSpacingY * YSize; 1754 int iheight = mGridSpacingY * YSize;
1767 1755
1768 agendaItem->resize(mGridSpacingX,iheight ); 1756 agendaItem->resize(mGridSpacingX,iheight );
1769 agendaItem->setCellXY(X,YTop,YBottom); 1757 agendaItem->setCellXY(X,YTop,YBottom);
@@ -1887,15 +1875,15 @@ void KOAgenda::resizeEvent ( QResizeEvent *ev )
1887 1875
1888} 1876}
1889void KOAgenda::computeSizes() 1877void KOAgenda::computeSizes()
1890{ 1878{
1891 if ( globalFlagBlockStartup ) 1879 if ( globalFlagBlockStartup )
1892 return; 1880 return;
1893 1881 int frameOffset = frameWidth() * 2 +1;
1894 if (mAllDayMode) { 1882 if (mAllDayMode) {
1895 mGridSpacingX = (width()-3) / mColumns; 1883 mGridSpacingX = (width()-frameOffset) / mColumns;
1896 mGridSpacingY = height() - 2 * frameWidth() - 1; 1884 mGridSpacingY = height() - 2 * frameWidth() - 1;
1897 resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY + 1); 1885 resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY + 1);
1898// mGridSpacingY = height(); 1886// mGridSpacingY = height();
1899// resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 ); 1887// resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 );
1900 1888
1901 KOAgendaItem *item; 1889 KOAgendaItem *item;
@@ -1907,13 +1895,13 @@ void KOAgenda::computeSizes()
1907 (mColumns - 1 - item->cellX()) * mGridSpacingX : 1895 (mColumns - 1 - item->cellX()) * mGridSpacingX :
1908 item->cellX() * mGridSpacingX, 1896 item->cellX() * mGridSpacingX,
1909 item->subCell() * subCellWidth); 1897 item->subCell() * subCellWidth);
1910 } 1898 }
1911 KOPrefs::instance()->mAllDaySize = mGridSpacingY; 1899 KOPrefs::instance()->mAllDaySize = mGridSpacingY;
1912 } else { 1900 } else {
1913 mGridSpacingX = (width() - verticalScrollBar()->width()-3)/mColumns; 1901 mGridSpacingX = (width() - verticalScrollBar()->width()-frameOffset)/mColumns;
1914 if (height() > mGridSpacingY * mRows + 1 ) { 1902 if (height() > mGridSpacingY * mRows + 1 ) {
1915 KOPrefs::instance()->mHourSize = ((height())/mRows)+1; 1903 KOPrefs::instance()->mHourSize = ((height())/mRows)+1;
1916 mGridSpacingY = KOPrefs::instance()->mHourSize ; 1904 mGridSpacingY = KOPrefs::instance()->mHourSize ;
1917 resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 ); 1905 resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 );
1918 emit resizedSignal(); 1906 emit resizedSignal();
1919 } else 1907 } else