summaryrefslogtreecommitdiffabout
path: root/korganizer/kolistview.cpp
Unidiff
Diffstat (limited to 'korganizer/kolistview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kolistview.cpp41
1 files changed, 21 insertions, 20 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index bbf83d9..fd86095 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -373,4 +373,2 @@ void KOListView::setAlarm()
373 return; 373 return;
374
375
376 QStringList itemList; 374 QStringList itemList;
@@ -430,7 +428,5 @@ void KOListView::setAlarm()
430 } 428 }
431 temp = item; 429 ListItemVisitor v(item, mStartDate );
430 inc->accept(v);
432 item = sel.next(); 431 item = sel.next();
433 mUidDict.remove( inc->uid() );
434 delete temp;;
435 addIncidence( inc );
436 } 432 }
@@ -445,2 +441,3 @@ void KOListView::setCategories( bool removeOld )
445 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); 441 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
442 csd->setColorEnabled();
446 if (! csd->exec()) { 443 if (! csd->exec()) {
@@ -453,3 +450,3 @@ void KOListView::setCategories( bool removeOld )
453 // return; 450 // return;
454 catList.sort(); 451 //catList.sort();
455 QString categoriesStr = catList.join(","); 452 QString categoriesStr = catList.join(",");
@@ -467,3 +464,14 @@ void KOListView::setCategories( bool removeOld )
467 item = sel.first(); 464 item = sel.first();
468 Incidence* inc; 465 if( item ) {
466 Incidence* inc = item->data() ;
467 bool setSub = false;
468 if( inc->type() == "Todo" && sel.count() == 1 && inc->relations().count() > 0 ) {
469 int result = KMessageBox::warningYesNoCancel(this,
470 i18n("The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?").arg( inc->summary().left ( 25 ) ),
471 i18n("Todo has subtodos"),
472 i18n("Yes"),
473 i18n("No"));
474 if (result == KMessageBox::Cancel) item = 0;
475 if (result == KMessageBox::Yes) setSub = true;
476 }
469 while ( item ) { 477 while ( item ) {
@@ -471,17 +479,10 @@ void KOListView::setCategories( bool removeOld )
471 if ( removeOld ) { 479 if ( removeOld ) {
472 inc->setCategories( categoriesStr ); 480 inc->setCategories( catList, setSub );
473 } else { 481 } else {
474 itemList = QStringList::split (",", inc->categoriesStr() ); 482 inc->addCategories( catList, setSub );
475 for( i = 0; i< catList.count(); ++i ) {
476 if ( !itemList.contains (catList[i]))
477 itemList.append( catList[i] );
478 }
479 itemList.sort();
480 inc->setCategories( itemList.join(",") );
481 } 483 }
482 temp = item; 484 ListItemVisitor v(item, mStartDate );
485 inc->accept(v);
483 item = sel.next(); 486 item = sel.next();
484 mUidDict.remove( inc->uid() ); 487 }
485 delete temp;;
486 addIncidence( inc );
487 } 488 }