summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/incomingdialog.cpp14
-rw-r--r--korganizer/koagendaview.cpp14
-rw-r--r--korganizer/koeditorrecurrence.cpp2
-rw-r--r--korganizer/koeventviewerdialog.cpp12
-rw-r--r--korganizer/komonthview.cpp4
-rw-r--r--korganizer/outgoingdialog.cpp12
-rw-r--r--libkcal/alarm.cpp4
7 files changed, 31 insertions, 31 deletions
diff --git a/korganizer/incomingdialog.cpp b/korganizer/incomingdialog.cpp
index 50e3077..fe78356 100644
--- a/korganizer/incomingdialog.cpp
+++ b/korganizer/incomingdialog.cpp
@@ -177,9 +177,9 @@ void IncomingDialog::retrieve()
Scheduler::Method method = (Scheduler::Method)message->method();
ScheduleMessage::Status status = message->status();
ScheduleItemIn *item = new ScheduleItemIn(mMessageListView,inc,method,status);
- if(inc->type()!="FreeBusy") {
+ if(inc->typeID() != freebusyID ) {
Incidence *incidence = static_cast<Incidence *>(inc);
ScheduleItemVisitor v(item);
if (!incidence->accept(v)) delete item;
} else {
@@ -254,9 +254,9 @@ void IncomingDialog::rejectMessage()
void IncomingDialog::showEvent(QListViewItem *item)
{
IncidenceBase *incidence = ((ScheduleItemIn *)item)->event();
- if( incidence && incidence->type() == "Event" ) {
+ if( incidence && incidence->typeID() == eventID ) {
Event *event = static_cast<Event *>(incidence);
KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this);
eventViewer->setEvent(event);
eventViewer->show();
@@ -289,9 +289,9 @@ bool IncomingDialog::incomeRefresh(ScheduleItemIn *item)
bool IncomingDialog::incomeCounter(ScheduleItemIn *item)
{
IncidenceBase *incidence = ((ScheduleItemIn *)item)->event();
// currently only events supportet - attetion at insertion below!
- if ( incidence->type() != "Event" ) return false;
+ if ( incidence->typeID() != eventID ) return false;
Event *counterEvent = static_cast<Event *>( incidence );
Event *even = mCalendar->event(counterEvent->uid());
@@ -367,9 +367,9 @@ bool IncomingDialog::incomeDeclineCounter(ScheduleItemIn *item)
bool IncomingDialog::incomeAdd(ScheduleItemIn *item)
{
IncidenceBase *incidence = ((ScheduleItemIn *)item)->event();
- if (incidence->type() == "Event" ) {
+ if (incidence->typeID() == eventID ) {
Event *refr = static_cast<Event *>( incidence );
mOutgoing->addMessage(refr,Scheduler::Refresh);
mScheduler->deleteTransaction( incidence );
delete item;
@@ -401,9 +401,9 @@ bool IncomingDialog::incomeDefault(ScheduleItemIn *item)
}
bool IncomingDialog::incomeRequest(ScheduleItemIn *item)
{
- if (item->event()->type()=="FreeBusy") {
+ if (item->event()->typeID() == freebusyID ) {
//handel freebusy request
IncidenceBase *inc = item->event();
QDateTime start = inc->dtStart();
QDateTime end = start.addDays(inc->duration()/86400);
@@ -436,9 +436,9 @@ bool IncomingDialog::automaticAction(ScheduleItemIn *item)
bool autoAction = false;
IncidenceBase *inc = item->event();
Scheduler::Method method = item->method();
- if( inc->type()=="FreeBusy" ) {
+ if( inc->typeID() == freebusyID ) {
if ( method==Scheduler::Request ) {
if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) {
// reply freebusy information
if ( checkOrganizerInAddressbook(inc->organizer()) ) {
@@ -464,9 +464,9 @@ bool IncomingDialog::automaticAction(ScheduleItemIn *item)
}
}
}
- if ( inc->type()=="Event" ) {
+ if ( inc->typeID() == eventID ) {
if ( method==Scheduler::Request || method==Scheduler::Publish ) {
if ( KOPrefs::instance()->mIMIPAutoInsertRequest==KOPrefs::addressbookAuto ) {
// insert event
if ( checkOrganizerInAddressbook(inc->organizer()) )
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 1320a2e..b2b136a 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -580,9 +580,9 @@ 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);
}
@@ -966,17 +966,17 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
// 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());
@@ -990,9 +990,9 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
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 ) {
@@ -1020,12 +1020,12 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
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() ) {
@@ -1037,9 +1037,9 @@ 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
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp
index e165017..dea8981 100644
--- a/korganizer/koeditorrecurrence.cpp
+++ b/korganizer/koeditorrecurrence.cpp
@@ -870,9 +870,9 @@ void KOEditorRecurrence::setDefaults( QDateTime from, QDateTime to, bool )
void KOEditorRecurrence::readEvent(Incidence *event)
{
QDateTime dtEnd;
- if ( event->type() == "Event" )
+ if ( event->typeID() == eventID )
dtEnd = ((Event*)event)->dtEnd();
else
dtEnd = ((Todo*)event)->dtDue();
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index e5ff8af..02f13c7 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -147,22 +147,22 @@ void KOEventViewerDialog::setEvent(Event *event)
}
}
void KOEventViewerDialog::setIncidence(Incidence *in )
{
- if ( in->type() == "Event" )
+ if ( in->typeID() == eventID )
setEvent( (Event*) in );
- else if ( in->type() =="Todo" )
+ else if ( in->typeID() == todoID )
setTodo( (Todo*) in );
- else if ( in->type() =="Journal" )
+ else if ( in->typeID() == journalID )
setJournal( (Journal*) in );
}
void KOEventViewerDialog::addIncidence(Incidence *in)
{
- if ( in->type() == "Event" )
+ if ( in->typeID() == eventID )
addEvent( (Event*) in );
- else if ( in->type() =="Todo" )
+ else if ( in->typeID() == todoID )
mEventViewer->setTodo( (Todo*) in, false );
- else if ( in->type() =="Journal" )
+ else if ( in->typeID() == journalID )
mEventViewer->setJournal( (Journal*) in, false );
if ( mSyncMode ) {
findButton( User1 )->setFocus();
setCaption(i18n("Conflict! Please choose entry"));
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 678cab6..c868270 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -381,9 +381,9 @@ void MonthViewItem::paint(QPainter *p)
x += sizeM/2 + 1;
x += sizeM + 1;
}
- if ( mIncidence->type() == "Todo" ){
+ if ( mIncidence->typeID() == todoID ){
Todo* td = ( Todo* ) mIncidence;
if ( td->isCompleted() ) {
int half = size/2;
p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ;
@@ -1942,9 +1942,9 @@ void KOMonthView::showContextMenu( Incidence *incidence )
//qDebug("KOMonthView::showContextMenu ");
mNewItemMenu->popup(QCursor::pos());
}
/*
- if( incidence && incidence->type() == "Event" ) {
+ if( incidence && incidence->typeID() == eventID ) {
Event *event = static_cast<Event *>(incidence);
mContextMenu->showEventPopup(event);
} else {
kdDebug() << "MonthView::showContextMenu(): cast failed." << endl;
diff --git a/korganizer/outgoingdialog.cpp b/korganizer/outgoingdialog.cpp
index 0fc90c4..7253c8e 100644
--- a/korganizer/outgoingdialog.cpp
+++ b/korganizer/outgoingdialog.cpp
@@ -54,18 +54,18 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
mRecipients = recipients;
// kdDebug() << "ScheduleItemOut: setting the summary" << endl;
//Set the summary
- if(ev->type() != "FreeBusy") {
+ if(ev->typeID() != freebusyID ) {
Incidence *incidence = static_cast<Incidence *>(ev);
setText(0,incidence->summary());
} else {
setText(0,i18n("Free Busy Object"));
}
// kdDebug() << "ScheduleItemOut: checking if the object is an event" << endl;
//If the object is an event
- if(ev->type()=="Event") {
+ if(ev->typeID()== eventID ) {
Event *event = static_cast<Event *>(ev);
setText(1,event->dtStartDateStr());
if (event->doesFloat()) { //If the event floats set the start and end times to no time
@@ -87,9 +87,9 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
}
}
//If the object is an Todo
- if(ev->type()=="Todo") {
+ if(ev->typeID() == todoID ) {
Todo *event = static_cast<Todo *>(ev);
if (event->hasStartDate()) {
setText(1,event->dtStartDateStr());
if (!event->doesFloat()) {
@@ -105,9 +105,9 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
}
// kdDebug() << "ScheduleItemOut: checking if the object is a FreeBusy object" << endl;
//If the object is a freebusy object
- if(ev->type() == "FreeBusy") {
+ if(ev->typeID() == freebusyID ) {
FreeBusy *freebusy = static_cast<FreeBusy *>(ev);
setText(1,freebusy->dtStartDateStr());
setText(2,freebusy->dtStartTimeStr());
@@ -240,12 +240,12 @@ void OutgoingDialog::showEvent(QListViewItem *qitem)
{
ScheduleItemOut *item = (ScheduleItemOut *)qitem;
Event *event = 0;
Todo *todo = 0;
- if ( item->event()->type()=="Event" ) {
+ if ( item->event()->typeID() == eventID ) {
event = static_cast<Event *>(item->event());
}
- if ( item->event()->type()=="Todo" ) {
+ if ( item->event()->typeID() == todoID ) {
todo = static_cast<Todo *>(item->event());
}
QString sendText;
if (event || todo) {
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 6de1566..0afa0a7 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
@@ -337,9 +337,9 @@ void Alarm::setTime(const QDateTime &alarmTime)
}
int Alarm::offset()
{
if ( hasTime() ) {
- if (mParent->type()=="Todo") {
+ if (mParent->typeID() == todoID ) {
Todo *t = static_cast<Todo*>(mParent);
return t->dtDue().secsTo( mAlarmTime ) ;
} else
return mParent->dtStart().secsTo( mAlarmTime ) ;
@@ -380,9 +380,9 @@ QDateTime Alarm::time() const
if ( hasTime() )
return mAlarmTime;
else
{
- if (mParent->type()=="Todo") {
+ if (mParent->typeID() == todoID ) {
Todo *t = static_cast<Todo*>(mParent);
return mOffset.end( t->dtDue() );
} else if (mEndOffset) {
return mOffset.end( mParent->dtEnd() );