summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
authorzautrix <zautrix>2005-06-08 10:56:24 (UTC)
committer zautrix <zautrix>2005-06-08 10:56:24 (UTC)
commit2448916479b456ca7c880427a80e8e32e95b2fba (patch) (side-by-side diff)
tree83be907f0eccb43ffc44a7f1bc07995c32760cb5 /korganizer/koagendaview.cpp
parent793d117812b4da36c9c11d90cccba347cbc6e208 (diff)
downloadkdepimpi-2448916479b456ca7c880427a80e8e32e95b2fba.zip
kdepimpi-2448916479b456ca7c880427a80e8e32e95b2fba.tar.gz
kdepimpi-2448916479b456ca7c880427a80e8e32e95b2fba.tar.bz2
more type API changes
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 1320a2e..b2b136a 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -578,13 +578,13 @@ void KOAgendaView::toggleAllDay()
}
void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld )
{
calendar()->addIncidence( inc );
if ( incOld ) {
- if ( incOld->type() == "Todo" )
+ if ( incOld->typeID() == todoID )
emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED );
else
emit incidenceChanged(incOld, KOGlobals::EVENTEDITED);
}
}
@@ -964,21 +964,21 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
// if ( type == KOAgenda::RESIZETOP )
// qDebug("RESIZETOP ");
// if ( type == KOAgenda::RESIZEBOTTOM )
// qDebug("RESIZEBOTTOM ");
// if ( type == KOAgenda::MOVE )
// qDebug("MOVE ");
- if ( item->incidence()->type() == "Event" ) {
+ if ( item->incidence()->typeID() == eventID ) {
startDt =item->incidence()->dtStart();
endDt = item->incidence()->dtEnd();
lenInSecs = startDt.secsTo( endDt );
}
// emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED );
- if ( item->incidence()->type()=="Todo" && item->mLastMoveXPos > 0 ) {
+ if ( item->incidence()->typeID()== todoID && item->mLastMoveXPos > 0 ) {
startDate = mSelectedDates[item->mLastMoveXPos];
} else {
if (item->cellX() < 0) {
startDate = (mSelectedDates.first()).addDays(item->cellX());
} else {
startDate = mSelectedDates[item->cellX()];
@@ -988,13 +988,13 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
if (item->incidence()->doesFloat()) {
endDt.setDate(startDate.addDays(item->cellWidth() - 1));
} else {
if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE )
startDt.setTime(mAgenda->gyToTime(item->cellYTop()));
- if ( item->incidence()->type() == "Event" ) {
+ if ( item->incidence()->typeID() == eventID ) {
if ( type == KOAgenda::MOVE ) {
endDt = startDt.addSecs(lenInSecs);
} else if ( type == KOAgenda::RESIZEBOTTOM ) {
if (item->lastMultiItem()) {
endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1));
@@ -1018,16 +1018,16 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
else
endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time());
endDt.setDate(startDate);
}
}
}
- if ( item->incidence()->type() == "Event" ) {
+ if ( item->incidence()->typeID() == eventID ) {
item->incidence()->setDtStart(startDt);
(static_cast<Event*>(item->incidence()))->setDtEnd(endDt);
- } else if ( item->incidence()->type() == "Todo" ) {
+ } else if ( item->incidence()->typeID() == todoID ) {
Todo* to = static_cast<Todo*>(item->incidence());
to->setDtDue(endDt);
if ( to->hasStartDate() ) {
if (to->dtStart() >= to->dtDue() )
to->setDtStart(to->dtDue().addDays( -2 ));
@@ -1035,13 +1035,13 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
}
//qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() );
item->incidence()->setRevision(item->incidence()->revision()+1);
item->setItemDate(startDt.date());
//item->updateItem();
- if ( item->incidence()->type() == "Todo" ) {
+ if ( item->incidence()->typeID() == todoID ) {
emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED );
}
else
emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED);
item->updateItem();