summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
Unidiff
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 796d633..d9d1283 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1791,102 +1791,102 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
1791 globalFlagBlockAgendaItemUpdate = 0; 1791 globalFlagBlockAgendaItemUpdate = 0;
1792 item->repaintMe(); 1792 item->repaintMe();
1793 globalFlagBlockAgendaItemUpdate = 1; 1793 globalFlagBlockAgendaItemUpdate = 1;
1794 item->repaint(); 1794 item->repaint();
1795} 1795}
1796/* 1796/*
1797 Insert KOAgendaItem into agenda. 1797 Insert KOAgendaItem into agenda.
1798*/ 1798*/
1799KOAgendaItem *KOAgenda::insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom) 1799KOAgendaItem *KOAgenda::insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom)
1800{ 1800{
1801 if (mAllDayMode) { 1801 if (mAllDayMode) {
1802 qDebug("KOAgenda: calling insertItem in all-day mode is illegal. "); 1802 qDebug("KOAgenda: calling insertItem in all-day mode is illegal. ");
1803 return 0; 1803 return 0;
1804 } 1804 }
1805 1805
1806 KOAgendaItem *agendaItem = getNewItem(event,qd,viewport()); 1806 KOAgendaItem *agendaItem = getNewItem(event,qd,viewport());
1807 //agendaItem->setFrameStyle(WinPanel|Raised); 1807 //agendaItem->setFrameStyle(WinPanel|Raised);
1808 1808
1809 int YSize = YBottom - YTop + 1; 1809 int YSize = YBottom - YTop + 1;
1810 if (YSize < 0) { 1810 if (YSize < 0) {
1811 YSize = 1; 1811 YSize = 1;
1812 } 1812 }
1813 int iheight = mGridSpacingY * YSize; 1813 int iheight = mGridSpacingY * YSize;
1814 1814
1815 agendaItem->resize(mGridSpacingX,iheight ); 1815 agendaItem->resize(mGridSpacingX,iheight );
1816 agendaItem->setCellXY(X,YTop,YBottom); 1816 agendaItem->setCellXY(X,YTop,YBottom);
1817 agendaItem->setCellXWidth(X); 1817 agendaItem->setCellXWidth(X);
1818 1818
1819 //addChild(agendaItem,X*mGridSpacingX,YTop*mGridSpacingY); 1819 //addChild(agendaItem,X*mGridSpacingX,YTop*mGridSpacingY);
1820 mItems.append(agendaItem); 1820 mItems.append(agendaItem);
1821 1821
1822 placeSubCells(agendaItem); 1822 placeSubCells(agendaItem);
1823 1823
1824 //agendaItem->show(); 1824 //agendaItem->show();
1825 1825
1826 1826
1827 return agendaItem; 1827 return agendaItem;
1828} 1828}
1829 1829
1830 1830
1831/* 1831/*
1832 Insert all-day KOAgendaItem into agenda. 1832 Insert all-day KOAgendaItem into agenda.
1833*/ 1833*/
1834KOAgendaItem *KOAgenda::insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd) 1834KOAgendaItem *KOAgenda::insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd)
1835{ 1835{
1836 if (!mAllDayMode) { 1836 if (!mAllDayMode) {
1837 return 0; 1837 return 0;
1838 } 1838 }
1839 1839 //qDebug("insertallday %s -- %d - %d ",qd.toString().latin1(), XBegin, XEnd );
1840 KOAgendaItem *agendaItem = getNewItem(event,qd,viewport()); 1840 KOAgendaItem *agendaItem = getNewItem(event,qd,viewport());
1841 1841
1842 agendaItem->setCellXY(XBegin,0,0); 1842 agendaItem->setCellXY(XBegin,0,0);
1843 agendaItem->setCellXWidth(XEnd); 1843 agendaItem->setCellXWidth(XEnd);
1844 agendaItem->resizeMe(mGridSpacingX, mGridSpacingX * agendaItem->cellWidth(),mGridSpacingY); 1844 agendaItem->resizeMe(mGridSpacingX, mGridSpacingX * agendaItem->cellWidth(),mGridSpacingY, true );
1845 1845
1846 //addChild(agendaItem,XBegin*mGridSpacingX,0); 1846 //addChild(agendaItem,XBegin*mGridSpacingX,0);
1847 mItems.append(agendaItem); 1847 mItems.append(agendaItem);
1848 1848
1849 placeSubCells(agendaItem); 1849 placeSubCells(agendaItem);
1850 1850
1851 //agendaItem->show(); 1851 //agendaItem->show();
1852 1852
1853 return agendaItem; 1853 return agendaItem;
1854} 1854}
1855 1855
1856 1856
1857void KOAgenda::insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, 1857void KOAgenda::insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd,
1858 int YTop,int YBottom) 1858 int YTop,int YBottom)
1859{ 1859{
1860 if (mAllDayMode) { 1860 if (mAllDayMode) {
1861 ; 1861 ;
1862 return; 1862 return;
1863 } 1863 }
1864 1864
1865 int cellX,cellYTop,cellYBottom; 1865 int cellX,cellYTop,cellYBottom;
1866 QString newtext; 1866 QString newtext;
1867 int width = XEnd - XBegin + 1; 1867 int width = XEnd - XBegin + 1;
1868 int count = 0; 1868 int count = 0;
1869 KOAgendaItem *current = 0; 1869 KOAgendaItem *current = 0;
1870 QPtrList<KOAgendaItem> multiItems; 1870 QPtrList<KOAgendaItem> multiItems;
1871 for (cellX = XBegin;cellX <= XEnd;++cellX) { 1871 for (cellX = XBegin;cellX <= XEnd;++cellX) {
1872 if (cellX == XBegin) cellYTop = YTop; 1872 if (cellX == XBegin) cellYTop = YTop;
1873 else cellYTop = 0; 1873 else cellYTop = 0;
1874 if (cellX == XEnd) cellYBottom = YBottom; 1874 if (cellX == XEnd) cellYBottom = YBottom;
1875 else cellYBottom = rows() - 1; 1875 else cellYBottom = rows() - 1;
1876 newtext = QString("(%1/%2): ").arg(++count).arg(width); 1876 newtext = QString("(%1/%2): ").arg(++count).arg(width);
1877 newtext.append(event->summary()); 1877 newtext.append(event->summary());
1878 current = insertItem(event,qd,cellX,cellYTop,cellYBottom); 1878 current = insertItem(event,qd,cellX,cellYTop,cellYBottom);
1879 current->setText(newtext); 1879 current->setText(newtext);
1880 multiItems.append(current); 1880 multiItems.append(current);
1881 } 1881 }
1882 1882
1883 KOAgendaItem *next = 0; 1883 KOAgendaItem *next = 0;
1884 KOAgendaItem *last = multiItems.last(); 1884 KOAgendaItem *last = multiItems.last();
1885 KOAgendaItem *first = multiItems.first(); 1885 KOAgendaItem *first = multiItems.first();
1886 KOAgendaItem *setFirst,*setLast; 1886 KOAgendaItem *setFirst,*setLast;
1887 current = first; 1887 current = first;
1888 while (current) { 1888 while (current) {
1889 next = multiItems.next(); 1889 next = multiItems.next();
1890 if (current == first) setFirst = 0; 1890 if (current == first) setFirst = 0;
1891 else setFirst = first; 1891 else setFirst = first;
1892 if (current == last) setLast = 0; 1892 if (current == last) setLast = 0;