summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show 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
@@ -175,13 +175,13 @@ void IncomingDialog::retrieve()
for(message = messages.first();message;message = messages.next()) {
IncidenceBase *inc = message->event();
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 {
FreeBusy *fb = static_cast<FreeBusy *>(item->event());
item->setText(0, "FreeBusy");
@@ -252,13 +252,13 @@ 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();
}
}
@@ -287,13 +287,13 @@ 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());
KOCounterDialog *eventViewer = new KOCounterDialog(this);
@@ -365,13 +365,13 @@ bool IncomingDialog::incomeDeclineCounter(ScheduleItemIn *item)
return false;
}
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;
emit numMessagesChanged(mMessageListView->childCount());
return true;
@@ -399,13 +399,13 @@ bool IncomingDialog::incomeDefault(ScheduleItemIn *item)
}
return false;
}
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);
FreeBusy *freebusy = new FreeBusy(mCalendar, start, end);
@@ -434,13 +434,13 @@ bool IncomingDialog::incomeRequest(ScheduleItemIn *item)
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()) ) {
incomeRequest(item);
}
@@ -462,13 +462,13 @@ bool IncomingDialog::automaticAction(ScheduleItemIn *item)
}
} else return false;
}
}
}
- 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()) )
autoAction = acceptMessage(item);
} else return false;
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();
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp
index e165017..dea8981 100644
--- a/korganizer/koeditorrecurrence.cpp
+++ b/korganizer/koeditorrecurrence.cpp
@@ -868,13 +868,13 @@ 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();
setDefaults( event->dtStart(), dtEnd, true );
QBitArray rDays( 7 );
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index e5ff8af..02f13c7 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -145,26 +145,26 @@ void KOEventViewerDialog::setEvent(Event *event)
if ( !mSyncMode ) {
findButton( User1 )->setText( i18n("Agenda"));
}
}
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
@@ -379,13 +379,13 @@ 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 ) ;
p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ;
x += half+half + 4;
@@ -1940,13 +1940,13 @@ void KOMonthView::showContextMenu( Incidence *incidence )
mContextMenu->showIncidencePopup(incidence);
else {
//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
@@ -52,22 +52,22 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
mIncidence = ev;
mMethod = method;
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
setText(2,i18n("no time"));
setText(4,i18n("no time"));
@@ -85,13 +85,13 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
else {
setText(3,i18n("no time"));
}
}
//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()) {
setText(2,event->dtStartTimeStr());
}
@@ -103,13 +103,13 @@ 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());
//Must try and get this to the users local settings
setText(3,KGlobal::locale()->formatDate( freebusy->dtEnd().date() ) );
@@ -238,16 +238,16 @@ void OutgoingDialog::deleteItem()
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) {
KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this);
if (event) eventViewer->setEvent(event);
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 6de1566..0afa0a7 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
@@ -335,13 +335,13 @@ void Alarm::setTime(const QDateTime &alarmTime)
mParent->updated();
}
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 ) ;
}
else
@@ -378,13 +378,13 @@ QString Alarm::offsetText()
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() );
} else {
return mOffset.end( mParent->dtStart() );