summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Unidiff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 720ad78..7c7466b 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -167,19 +167,19 @@ MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Inciden
167 while ( inc ) { 167 while ( inc ) {
168 QDateTime dt ; 168 QDateTime dt ;
169 QString tempText = "<a "; 169 QString tempText = "<a ";
170 bool ok; 170 bool ok;
171 dt = inc->getNextOccurence( start, &ok ); 171 dt = inc->getNextOccurence( start, &ok );
172 if ( !ok ) continue; 172 if ( !ok ) continue;
173 if ( inc->type() == "Event" ) { 173 if ( inc->typeID() == eventID ) {
174 tempText += "href=\"event:"; 174 tempText += "href=\"event:";
175 } else if ( inc->type() == "Todo" ) { 175 } else if ( inc->typeID() == todoID ) {
176 tempText += "href=\"todo:"; 176 tempText += "href=\"todo:";
177 } 177 }
178 tempText += inc->uid() + "\">"; 178 tempText += inc->uid() + "\">";
179 if ( inc->type() == "Todo" ) 179 if ( inc->typeID() == todoID )
180 tempText += i18n("Todo: "); 180 tempText += i18n("Todo: ");
181 if ( inc->summary().length() > 0 ) 181 if ( inc->summary().length() > 0 )
182 tempText += inc->summary(); 182 tempText += inc->summary();
183 else 183 else
184 tempText += i18n("-no summary-"); 184 tempText += i18n("-no summary-");
185 QString timestr; 185 QString timestr;
@@ -970,18 +970,18 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b
970 970
971 //qDebug("%s %d %s %d", localMod.toString().latin1() , local->revision(), remoteMod.toString().latin1(), remote->revision()); 971 //qDebug("%s %d %s %d", localMod.toString().latin1() , local->revision(), remoteMod.toString().latin1(), remote->revision());
972 //qDebug("%d %d %d %d ", localMod.time().second(), localMod.time().msec(), remoteMod.time().second(), remoteMod.time().msec() ); 972 //qDebug("%d %d %d %d ", localMod.time().second(), localMod.time().msec(), remoteMod.time().second(), remoteMod.time().msec() );
973 //full = true; //debug only 973 //full = true; //debug only
974 if ( full ) { 974 if ( full ) {
975 bool equ = false; 975 bool equ = false;
976 if ( local->type() == "Event" ) { 976 if ( local->typeID() == eventID ) {
977 equ = (*((Event*) local) == *((Event*) remote)); 977 equ = (*((Event*) local) == *((Event*) remote));
978 } 978 }
979 else if ( local->type() =="Todo" ) 979 else if ( local->typeID() == todoID )
980 equ = (*((Todo*) local) == (*(Todo*) remote)); 980 equ = (*((Todo*) local) == (*(Todo*) remote));
981 else if ( local->type() =="Journal" ) 981 else if ( local->typeID() == journalID )
982 equ = (*((Journal*) local) == *((Journal*) remote)); 982 equ = (*((Journal*) local) == *((Journal*) remote));
983 if ( equ ) { 983 if ( equ ) {
984 //qDebug("equal "); 984 //qDebug("equal ");
985 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 985 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
986 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); 986 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) );
987 } 987 }
@@ -1096,23 +1096,23 @@ Event* CalendarView::getLastSyncEvent()
1096void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) 1096void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete )
1097{ 1097{
1098 if ( lastSync.count() == 0 ) { 1098 if ( lastSync.count() == 0 ) {
1099 //qDebug(" lastSync.count() == 0"); 1099 //qDebug(" lastSync.count() == 0");
1100 return; 1100 return;
1101 } 1101 }
1102 if ( toDelete->type() == "Journal" ) 1102 if ( toDelete->typeID() == journalID )
1103 return; 1103 return;
1104 1104
1105 Event* eve = lastSync.first(); 1105 Event* eve = lastSync.first();
1106 1106
1107 while ( eve ) { 1107 while ( eve ) {
1108 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name 1108 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name
1109 if ( !id.isEmpty() ) { 1109 if ( !id.isEmpty() ) {
1110 QString des = eve->description(); 1110 QString des = eve->description();
1111 QString pref = "e"; 1111 QString pref = "e";
1112 if ( toDelete->type() == "Todo" ) 1112 if ( toDelete->typeID() == todoID )
1113 pref = "t"; 1113 pref = "t";
1114 des += pref+ id + ","; 1114 des += pref+ id + ",";
1115 eve->setReadOnly( false ); 1115 eve->setReadOnly( false );
1116 eve->setDescription( des ); 1116 eve->setDescription( des );
1117 //qDebug("setdes %s ", des.latin1()); 1117 //qDebug("setdes %s ", des.latin1());
1118 eve->setReadOnly( true ); 1118 eve->setReadOnly( true );
@@ -1283,13 +1283,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1283 } 1283 }
1284 } else { // no conflict ********** add or delete remote 1284 } else { // no conflict ********** add or delete remote
1285 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ 1285 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){
1286 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1286 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1287 QString des = eventLSync->description(); 1287 QString des = eventLSync->description();
1288 QString pref = "e"; 1288 QString pref = "e";
1289 if ( inR->type() == "Todo" ) 1289 if ( inR->typeID() == todoID )
1290 pref = "t"; 1290 pref = "t";
1291 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 1291 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
1292 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); 1292 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE );
1293 //remote->deleteIncidence( inR ); 1293 //remote->deleteIncidence( inR );
1294 ++deletedEventR; 1294 ++deletedEventR;
1295 } else { 1295 } else {
@@ -1340,13 +1340,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1340 bar.setProgress( incCounter ); 1340 bar.setProgress( incCounter );
1341 ++incCounter; 1341 ++incCounter;
1342 uid = inL->uid(); 1342 uid = inL->uid();
1343 bool skipIncidence = false; 1343 bool skipIncidence = false;
1344 if ( uid.left(15) == QString("last-syncEvent-") ) 1344 if ( uid.left(15) == QString("last-syncEvent-") )
1345 skipIncidence = true; 1345 skipIncidence = true;
1346 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) 1346 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID )
1347 skipIncidence = true; 1347 skipIncidence = true;
1348 if ( !skipIncidence ) { 1348 if ( !skipIncidence ) {
1349 inR = remote->incidence( uid ); 1349 inR = remote->incidence( uid );
1350 if ( ! inR ) { 1350 if ( ! inR ) {
1351 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ 1351 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){
1352 // no conflict ********** add or delete local 1352 // no conflict ********** add or delete local
@@ -1396,20 +1396,20 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1396 remRem = er.count(); 1396 remRem = er.count();
1397 inR = er.first(); 1397 inR = er.first();
1398 QDateTime dt; 1398 QDateTime dt;
1399 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) ); 1399 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) );
1400 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 ); 1400 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 );
1401 while ( inR ) { 1401 while ( inR ) {
1402 if ( inR->type() == "Todo" ) { 1402 if ( inR->typeID() == todoID ) {
1403 Todo * t = (Todo*)inR; 1403 Todo * t = (Todo*)inR;
1404 if ( t->hasDueDate() ) 1404 if ( t->hasDueDate() )
1405 dt = t->dtDue(); 1405 dt = t->dtDue();
1406 else 1406 else
1407 dt = cur.addSecs( 62 ); 1407 dt = cur.addSecs( 62 );
1408 } 1408 }
1409 else if (inR->type() == "Event" ) { 1409 else if (inR->typeID() == eventID ) {
1410 bool ok; 1410 bool ok;
1411 dt = inR->getNextOccurence( cur, &ok ); 1411 dt = inR->getNextOccurence( cur, &ok );
1412 if ( !ok ) 1412 if ( !ok )
1413 dt = cur.addSecs( -62 ); 1413 dt = cur.addSecs( -62 );
1414 } 1414 }
1415 else 1415 else
@@ -2474,13 +2474,13 @@ void CalendarView::edit_cut()
2474{ 2474{
2475 Event *anEvent=0; 2475 Event *anEvent=0;
2476 2476
2477 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2477 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2478 2478
2479 if (mViewManager->currentView()->isEventView()) { 2479 if (mViewManager->currentView()->isEventView()) {
2480 if ( incidence && incidence->type() == "Event" ) { 2480 if ( incidence && incidence->typeID() == eventID ) {
2481 anEvent = static_cast<Event *>(incidence); 2481 anEvent = static_cast<Event *>(incidence);
2482 } 2482 }
2483 } 2483 }
2484 2484
2485 if (!anEvent) { 2485 if (!anEvent) {
2486 KNotifyClient::beep(); 2486 KNotifyClient::beep();
@@ -2495,13 +2495,13 @@ void CalendarView::edit_copy()
2495{ 2495{
2496 Event *anEvent=0; 2496 Event *anEvent=0;
2497 2497
2498 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2498 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2499 2499
2500 if (mViewManager->currentView()->isEventView()) { 2500 if (mViewManager->currentView()->isEventView()) {
2501 if ( incidence && incidence->type() == "Event" ) { 2501 if ( incidence && incidence->typeID() == eventID ) {
2502 anEvent = static_cast<Event *>(incidence); 2502 anEvent = static_cast<Event *>(incidence);
2503 } 2503 }
2504 } 2504 }
2505 2505
2506 if (!anEvent) { 2506 if (!anEvent) {
2507 KNotifyClient::beep(); 2507 KNotifyClient::beep();
@@ -2547,13 +2547,13 @@ void CalendarView::edit_options()
2547void CalendarView::slotSelectPickerDate( QDate d) 2547void CalendarView::slotSelectPickerDate( QDate d)
2548{ 2548{
2549 mDateFrame->hide(); 2549 mDateFrame->hide();
2550 if ( mDatePickerMode == 1 ) { 2550 if ( mDatePickerMode == 1 ) {
2551 mNavigator->slotDaySelect( d ); 2551 mNavigator->slotDaySelect( d );
2552 } else if ( mDatePickerMode == 2 ) { 2552 } else if ( mDatePickerMode == 2 ) {
2553 if ( mMoveIncidence->type() == "Todo" ) { 2553 if ( mMoveIncidence->typeID() == todoID ) {
2554 Todo * to = (Todo *) mMoveIncidence; 2554 Todo * to = (Todo *) mMoveIncidence;
2555 QTime tim; 2555 QTime tim;
2556 int len = 0; 2556 int len = 0;
2557 if ( to->hasStartDate() && to->hasDueDate() ) 2557 if ( to->hasStartDate() && to->hasDueDate() )
2558 len = to->dtStart().secsTo( to->dtDue()); 2558 len = to->dtStart().secsTo( to->dtDue());
2559 if ( to->hasDueDate() ) 2559 if ( to->hasDueDate() )
@@ -2578,13 +2578,13 @@ void CalendarView::slotSelectPickerDate( QDate d)
2578 } else { 2578 } else {
2579 if ( mMoveIncidence->doesRecur() ) { 2579 if ( mMoveIncidence->doesRecur() ) {
2580#if 0 2580#if 0
2581 // PENDING implement this 2581 // PENDING implement this
2582 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2582 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2583 mCalendar()->addIncidence( newInc ); 2583 mCalendar()->addIncidence( newInc );
2584 if ( mMoveIncidence->type() == "Todo" ) 2584 if ( mMoveIncidence->typeID() == todoID )
2585 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 2585 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2586 else 2586 else
2587 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 2587 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2588 mMoveIncidence = newInc; 2588 mMoveIncidence = newInc;
2589 2589
2590#endif 2590#endif
@@ -2764,13 +2764,13 @@ void CalendarView::moveIncidence(Incidence * inc )
2764{ 2764{
2765 if ( !inc ) return; 2765 if ( !inc ) return;
2766 showDatePickerPopup(); 2766 showDatePickerPopup();
2767 mDatePickerMode = 2; 2767 mDatePickerMode = 2;
2768 mMoveIncidence = inc ; 2768 mMoveIncidence = inc ;
2769 QDate da; 2769 QDate da;
2770 if ( mMoveIncidence->type() == "Todo" ) { 2770 if ( mMoveIncidence->typeID() == todoID ) {
2771 Todo * to = (Todo *) mMoveIncidence; 2771 Todo * to = (Todo *) mMoveIncidence;
2772 if ( to->hasDueDate() ) 2772 if ( to->hasDueDate() )
2773 da = to->dtDue().date(); 2773 da = to->dtDue().date();
2774 else 2774 else
2775 da = QDate::currentDate(); 2775 da = QDate::currentDate();
2776 } else { 2776 } else {
@@ -2897,13 +2897,13 @@ void CalendarView::cancelIncidence(Incidence * inc )
2897} 2897}
2898void CalendarView::cloneIncidence(Incidence * orgInc ) 2898void CalendarView::cloneIncidence(Incidence * orgInc )
2899{ 2899{
2900 Incidence * newInc = orgInc->clone(); 2900 Incidence * newInc = orgInc->clone();
2901 newInc->recreate(); 2901 newInc->recreate();
2902 2902
2903 if ( newInc->type() == "Todo" ) { 2903 if ( newInc->typeID() == todoID ) {
2904 Todo* t = (Todo*) newInc; 2904 Todo* t = (Todo*) newInc;
2905 bool cloneSub = false; 2905 bool cloneSub = false;
2906 if ( orgInc->relations().count() ) { 2906 if ( orgInc->relations().count() ) {
2907 int result = KMessageBox::warningYesNoCancel(this, 2907 int result = KMessageBox::warningYesNoCancel(this,
2908 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ), 2908 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ),
2909 i18n("Todo has subtodos"), 2909 i18n("Todo has subtodos"),
@@ -3161,13 +3161,13 @@ void CalendarView::appointment_show()
3161{ 3161{
3162 Event *anEvent = 0; 3162 Event *anEvent = 0;
3163 3163
3164 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3164 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3165 3165
3166 if (mViewManager->currentView()->isEventView()) { 3166 if (mViewManager->currentView()->isEventView()) {
3167 if ( incidence && incidence->type() == "Event" ) { 3167 if ( incidence && incidence->typeID() == eventID ) {
3168 anEvent = static_cast<Event *>(incidence); 3168 anEvent = static_cast<Event *>(incidence);
3169 } 3169 }
3170 } 3170 }
3171 3171
3172 if (!anEvent) { 3172 if (!anEvent) {
3173 KNotifyClient::beep(); 3173 KNotifyClient::beep();
@@ -3181,13 +3181,13 @@ void CalendarView::appointment_edit()
3181{ 3181{
3182 Event *anEvent = 0; 3182 Event *anEvent = 0;
3183 3183
3184 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3184 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3185 3185
3186 if (mViewManager->currentView()->isEventView()) { 3186 if (mViewManager->currentView()->isEventView()) {
3187 if ( incidence && incidence->type() == "Event" ) { 3187 if ( incidence && incidence->typeID() == eventID ) {
3188 anEvent = static_cast<Event *>(incidence); 3188 anEvent = static_cast<Event *>(incidence);
3189 } 3189 }
3190 } 3190 }
3191 3191
3192 if (!anEvent) { 3192 if (!anEvent) {
3193 KNotifyClient::beep(); 3193 KNotifyClient::beep();
@@ -3201,13 +3201,13 @@ void CalendarView::appointment_delete()
3201{ 3201{
3202 Event *anEvent = 0; 3202 Event *anEvent = 0;
3203 3203
3204 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3204 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3205 3205
3206 if (mViewManager->currentView()->isEventView()) { 3206 if (mViewManager->currentView()->isEventView()) {
3207 if ( incidence && incidence->type() == "Event" ) { 3207 if ( incidence && incidence->typeID() == eventID ) {
3208 anEvent = static_cast<Event *>(incidence); 3208 anEvent = static_cast<Event *>(incidence);
3209 } 3209 }
3210 } 3210 }
3211 3211
3212 if (!anEvent) { 3212 if (!anEvent) {
3213 KNotifyClient::beep(); 3213 KNotifyClient::beep();
@@ -3402,13 +3402,13 @@ void CalendarView::action_mail()
3402 return; 3402 return;
3403 } 3403 }
3404 3404
3405 CalendarLocal cal_tmp; 3405 CalendarLocal cal_tmp;
3406 Event *event = 0; 3406 Event *event = 0;
3407 Event *ev = 0; 3407 Event *ev = 0;
3408 if ( incidence && incidence->type() == "Event" ) { 3408 if ( incidence && incidence->typeID() == eventID ) {
3409 event = static_cast<Event *>(incidence); 3409 event = static_cast<Event *>(incidence);
3410 ev = new Event(*event); 3410 ev = new Event(*event);
3411 cal_tmp.addEvent(ev); 3411 cal_tmp.addEvent(ev);
3412 } 3412 }
3413 ICalFormat mForm(); 3413 ICalFormat mForm();
3414 QString attachment = mForm.toString( &cal_tmp ); 3414 QString attachment = mForm.toString( &cal_tmp );
@@ -3447,16 +3447,16 @@ void CalendarView::schedule_publish(Incidence *incidence)
3447 if (incidence == 0) { 3447 if (incidence == 0) {
3448 incidence = mViewManager->currentView()->selectedIncidences().first(); 3448 incidence = mViewManager->currentView()->selectedIncidences().first();
3449 if (incidence == 0) { 3449 if (incidence == 0) {
3450 incidence = mTodoList->selectedIncidences().first(); 3450 incidence = mTodoList->selectedIncidences().first();
3451 } 3451 }
3452 } 3452 }
3453 if ( incidence && incidence->type() == "Event" ) { 3453 if ( incidence && incidence->typeID() == eventID ) {
3454 event = static_cast<Event *>(incidence); 3454 event = static_cast<Event *>(incidence);
3455 } else { 3455 } else {
3456 if ( incidence && incidence->type() == "Todo" ) { 3456 if ( incidence && incidence->typeID() == todoID ) {
3457 todo = static_cast<Todo *>(incidence); 3457 todo = static_cast<Todo *>(incidence);
3458 } 3458 }
3459 } 3459 }
3460 3460
3461 if (!event && !todo) { 3461 if (!event && !todo) {
3462 KMessageBox::sorry(this,i18n("No event selected.")); 3462 KMessageBox::sorry(this,i18n("No event selected."));
@@ -3562,16 +3562,16 @@ void CalendarView::schedule(Scheduler::Method method, Incidence *incidence)
3562 if (incidence == 0) { 3562 if (incidence == 0) {
3563 incidence = mViewManager->currentView()->selectedIncidences().first(); 3563 incidence = mViewManager->currentView()->selectedIncidences().first();
3564 if (incidence == 0) { 3564 if (incidence == 0) {
3565 incidence = mTodoList->selectedIncidences().first(); 3565 incidence = mTodoList->selectedIncidences().first();
3566 } 3566 }
3567 } 3567 }
3568 if ( incidence && incidence->type() == "Event" ) { 3568 if ( incidence && incidence->typeID() == eventID ) {
3569 event = static_cast<Event *>(incidence); 3569 event = static_cast<Event *>(incidence);
3570 } 3570 }
3571 if ( incidence && incidence->type() == "Todo" ) { 3571 if ( incidence && incidence->typeID() == todoID ) {
3572 todo = static_cast<Todo *>(incidence); 3572 todo = static_cast<Todo *>(incidence);
3573 } 3573 }
3574 3574
3575 if (!event && !todo) { 3575 if (!event && !todo) {
3576 KMessageBox::sorry(this,i18n("No event selected.")); 3576 KMessageBox::sorry(this,i18n("No event selected."));
3577 return; 3577 return;
@@ -3769,13 +3769,13 @@ void CalendarView::processIncidenceSelection( Incidence *incidence )
3769 if ( incidence == mSelectedIncidence ) return; 3769 if ( incidence == mSelectedIncidence ) return;
3770 3770
3771 mSelectedIncidence = incidence; 3771 mSelectedIncidence = incidence;
3772 3772
3773 emit incidenceSelected( mSelectedIncidence ); 3773 emit incidenceSelected( mSelectedIncidence );
3774 3774
3775 if ( incidence && incidence->type() == "Event" ) { 3775 if ( incidence && incidence->typeID() == eventID ) {
3776 Event *event = static_cast<Event *>( incidence ); 3776 Event *event = static_cast<Event *>( incidence );
3777 if ( event->organizer() == KOPrefs::instance()->email() ) { 3777 if ( event->organizer() == KOPrefs::instance()->email() ) {
3778 emit organizerEventsSelected( true ); 3778 emit organizerEventsSelected( true );
3779 } else { 3779 } else {
3780 emit organizerEventsSelected(false); 3780 emit organizerEventsSelected(false);
3781 } 3781 }
@@ -3784,13 +3784,13 @@ void CalendarView::processIncidenceSelection( Incidence *incidence )
3784 emit groupEventsSelected( true ); 3784 emit groupEventsSelected( true );
3785 } else { 3785 } else {
3786 emit groupEventsSelected(false); 3786 emit groupEventsSelected(false);
3787 } 3787 }
3788 return; 3788 return;
3789 } else { 3789 } else {
3790 if ( incidence && incidence->type() == "Todo" ) { 3790 if ( incidence && incidence->typeID() == todoID ) {
3791 emit todoSelected( true ); 3791 emit todoSelected( true );
3792 Todo *event = static_cast<Todo *>( incidence ); 3792 Todo *event = static_cast<Todo *>( incidence );
3793 if ( event->organizer() == KOPrefs::instance()->email() ) { 3793 if ( event->organizer() == KOPrefs::instance()->email() ) {
3794 emit organizerEventsSelected( true ); 3794 emit organizerEventsSelected( true );
3795 } else { 3795 } else {
3796 emit organizerEventsSelected(false); 3796 emit organizerEventsSelected(false);
@@ -3807,13 +3807,13 @@ void CalendarView::processIncidenceSelection( Incidence *incidence )
3807 emit organizerEventsSelected(false); 3807 emit organizerEventsSelected(false);
3808 emit groupEventsSelected(false); 3808 emit groupEventsSelected(false);
3809 } 3809 }
3810 return; 3810 return;
3811 } 3811 }
3812 3812
3813 /* if ( incidence && incidence->type() == "Todo" ) { 3813 /* if ( incidence && incidence->typeID() == todoID ) {
3814 emit todoSelected( true ); 3814 emit todoSelected( true );
3815 } else { 3815 } else {
3816 emit todoSelected( false ); 3816 emit todoSelected( false );
3817 }*/ 3817 }*/
3818} 3818}
3819 3819
@@ -4062,18 +4062,18 @@ void CalendarView::calendarModified( bool modified, Calendar * )
4062 setModified( modified ); 4062 setModified( modified );
4063} 4063}
4064 4064
4065Todo *CalendarView::selectedTodo() 4065Todo *CalendarView::selectedTodo()
4066{ 4066{
4067 Incidence *incidence = currentSelection(); 4067 Incidence *incidence = currentSelection();
4068 if ( incidence && incidence->type() == "Todo" ) { 4068 if ( incidence && incidence->typeID() == todoID ) {
4069 return static_cast<Todo *>( incidence ); 4069 return static_cast<Todo *>( incidence );
4070 } 4070 }
4071 4071
4072 incidence = mTodoList->selectedIncidences().first(); 4072 incidence = mTodoList->selectedIncidences().first();
4073 if ( incidence && incidence->type() == "Todo" ) { 4073 if ( incidence && incidence->typeID() == todoID ) {
4074 return static_cast<Todo *>( incidence ); 4074 return static_cast<Todo *>( incidence );
4075 } 4075 }
4076 4076
4077 return 0; 4077 return 0;
4078} 4078}
4079 4079