summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
Unidiff
Diffstat (limited to 'korganizer/koagendaitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 38bd93a..042a789 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -743,24 +743,42 @@ void KOAgendaItem::dropEvent( QDropEvent *e )
743#endif 743#endif
744} 744}
745 745
746 746
747QPtrList<KOAgendaItem> KOAgendaItem::conflictItems() 747QPtrList<KOAgendaItem> KOAgendaItem::conflictItems()
748{ 748{
749 return mConflictItems; 749 return mConflictItems;
750} 750}
751 751
752void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci) 752void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci)
753{ 753{
754 mConflictItems = ci; 754 mConflictItems = ci;
755 KOAgendaItem *item; 755 KOAgendaItem *item;
756 for ( item=mConflictItems.first(); item != 0; 756 for ( item=mConflictItems.first(); item != 0;
757 item=mConflictItems.next() ) { 757 item=mConflictItems.next() ) {
758 item->addConflictItem(this); 758 item->addConflictItem(this);
759 } 759 }
760} 760}
761 761
762void KOAgendaItem::addConflictItem(KOAgendaItem *ci) 762void KOAgendaItem::addConflictItem(KOAgendaItem *ci)
763{ 763{
764 if (mConflictItems.find(ci)<0) 764 if (mConflictItems.find(ci)<0)
765 mConflictItems.append(ci); 765 mConflictItems.append(ci);
766} 766}
767
768bool KOAgendaItem::checkLayout()
769{
770 if ( !mConflictItems.count() )
771 return true;
772 int max = 0;
773 KOAgendaItem *item;
774 for ( item=mConflictItems.first(); item != 0;
775 item=mConflictItems.next() ) {
776 if ( item->subCells() > max )
777 max = item->subCells();
778 }
779 if ( max > subCells() ) {
780 setSubCells( max );
781 return false;
782 }
783 return true;
784}