summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaitem.cpp') (more/less context) (show 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 )
#endif
}
QPtrList<KOAgendaItem> KOAgendaItem::conflictItems()
{
return mConflictItems;
}
void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci)
{
mConflictItems = ci;
KOAgendaItem *item;
for ( item=mConflictItems.first(); item != 0;
item=mConflictItems.next() ) {
item->addConflictItem(this);
}
}
void KOAgendaItem::addConflictItem(KOAgendaItem *ci)
{
if (mConflictItems.find(ci)<0)
mConflictItems.append(ci);
}
+
+bool KOAgendaItem::checkLayout()
+{
+ if ( !mConflictItems.count() )
+ return true;
+ int max = 0;
+ KOAgendaItem *item;
+ for ( item=mConflictItems.first(); item != 0;
+ item=mConflictItems.next() ) {
+ if ( item->subCells() > max )
+ max = item->subCells();
+ }
+ if ( max > subCells() ) {
+ setSubCells( max );
+ return false;
+ }
+ return true;
+}