summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp62
-rw-r--r--korganizer/koagenda.cpp4
-rw-r--r--korganizer/koagendaitem.cpp16
-rw-r--r--korganizer/kolistview.cpp12
-rw-r--r--korganizer/kotodoview.cpp4
-rw-r--r--korganizer/kowhatsnextview.cpp10
-rw-r--r--korganizer/mainwindow.cpp10
7 files changed, 59 insertions, 59 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 720ad78..7c7466b 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -172,5 +172,5 @@ MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Inciden
if ( !ok ) continue;
- if ( inc->type() == "Event" ) {
+ if ( inc->typeID() == eventID ) {
tempText += "href=\"event:";
- } else if ( inc->type() == "Todo" ) {
+ } else if ( inc->typeID() == todoID ) {
tempText += "href=\"todo:";
@@ -178,3 +178,3 @@ MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Inciden
tempText += inc->uid() + "\">";
- if ( inc->type() == "Todo" )
+ if ( inc->typeID() == todoID )
tempText += i18n("Todo: ");
@@ -975,8 +975,8 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b
bool equ = false;
- if ( local->type() == "Event" ) {
+ if ( local->typeID() == eventID ) {
equ = (*((Event*) local) == *((Event*) remote));
}
- else if ( local->type() =="Todo" )
+ else if ( local->typeID() == todoID )
equ = (*((Todo*) local) == (*(Todo*) remote));
- else if ( local->type() =="Journal" )
+ else if ( local->typeID() == journalID )
equ = (*((Journal*) local) == *((Journal*) remote));
@@ -1101,3 +1101,3 @@ void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* t
}
- if ( toDelete->type() == "Journal" )
+ if ( toDelete->typeID() == journalID )
return;
@@ -1111,3 +1111,3 @@ void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* t
QString pref = "e";
- if ( toDelete->type() == "Todo" )
+ if ( toDelete->typeID() == todoID )
pref = "t";
@@ -1288,3 +1288,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
QString pref = "e";
- if ( inR->type() == "Todo" )
+ if ( inR->typeID() == todoID )
pref = "t";
@@ -1345,3 +1345,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
skipIncidence = true;
- if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" )
+ if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID )
skipIncidence = true;
@@ -1401,3 +1401,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
while ( inR ) {
- if ( inR->type() == "Todo" ) {
+ if ( inR->typeID() == todoID ) {
Todo * t = (Todo*)inR;
@@ -1408,3 +1408,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
}
- else if (inR->type() == "Event" ) {
+ else if (inR->typeID() == eventID ) {
bool ok;
@@ -2479,3 +2479,3 @@ void CalendarView::edit_cut()
if (mViewManager->currentView()->isEventView()) {
- if ( incidence && incidence->type() == "Event" ) {
+ if ( incidence && incidence->typeID() == eventID ) {
anEvent = static_cast<Event *>(incidence);
@@ -2500,3 +2500,3 @@ void CalendarView::edit_copy()
if (mViewManager->currentView()->isEventView()) {
- if ( incidence && incidence->type() == "Event" ) {
+ if ( incidence && incidence->typeID() == eventID ) {
anEvent = static_cast<Event *>(incidence);
@@ -2552,3 +2552,3 @@ void CalendarView::slotSelectPickerDate( QDate d)
} else if ( mDatePickerMode == 2 ) {
- if ( mMoveIncidence->type() == "Todo" ) {
+ if ( mMoveIncidence->typeID() == todoID ) {
Todo * to = (Todo *) mMoveIncidence;
@@ -2583,3 +2583,3 @@ void CalendarView::slotSelectPickerDate( QDate d)
mCalendar()->addIncidence( newInc );
- if ( mMoveIncidence->type() == "Todo" )
+ if ( mMoveIncidence->typeID() == todoID )
emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
@@ -2769,3 +2769,3 @@ void CalendarView::moveIncidence(Incidence * inc )
QDate da;
- if ( mMoveIncidence->type() == "Todo" ) {
+ if ( mMoveIncidence->typeID() == todoID ) {
Todo * to = (Todo *) mMoveIncidence;
@@ -2902,3 +2902,3 @@ void CalendarView::cloneIncidence(Incidence * orgInc )
- if ( newInc->type() == "Todo" ) {
+ if ( newInc->typeID() == todoID ) {
Todo* t = (Todo*) newInc;
@@ -3166,3 +3166,3 @@ void CalendarView::appointment_show()
if (mViewManager->currentView()->isEventView()) {
- if ( incidence && incidence->type() == "Event" ) {
+ if ( incidence && incidence->typeID() == eventID ) {
anEvent = static_cast<Event *>(incidence);
@@ -3186,3 +3186,3 @@ void CalendarView::appointment_edit()
if (mViewManager->currentView()->isEventView()) {
- if ( incidence && incidence->type() == "Event" ) {
+ if ( incidence && incidence->typeID() == eventID ) {
anEvent = static_cast<Event *>(incidence);
@@ -3206,3 +3206,3 @@ void CalendarView::appointment_delete()
if (mViewManager->currentView()->isEventView()) {
- if ( incidence && incidence->type() == "Event" ) {
+ if ( incidence && incidence->typeID() == eventID ) {
anEvent = static_cast<Event *>(incidence);
@@ -3407,3 +3407,3 @@ void CalendarView::action_mail()
Event *ev = 0;
- if ( incidence && incidence->type() == "Event" ) {
+ if ( incidence && incidence->typeID() == eventID ) {
event = static_cast<Event *>(incidence);
@@ -3452,6 +3452,6 @@ void CalendarView::schedule_publish(Incidence *incidence)
}
- if ( incidence && incidence->type() == "Event" ) {
+ if ( incidence && incidence->typeID() == eventID ) {
event = static_cast<Event *>(incidence);
} else {
- if ( incidence && incidence->type() == "Todo" ) {
+ if ( incidence && incidence->typeID() == todoID ) {
todo = static_cast<Todo *>(incidence);
@@ -3567,6 +3567,6 @@ void CalendarView::schedule(Scheduler::Method method, Incidence *incidence)
}
- if ( incidence && incidence->type() == "Event" ) {
+ if ( incidence && incidence->typeID() == eventID ) {
event = static_cast<Event *>(incidence);
}
- if ( incidence && incidence->type() == "Todo" ) {
+ if ( incidence && incidence->typeID() == todoID ) {
todo = static_cast<Todo *>(incidence);
@@ -3774,3 +3774,3 @@ void CalendarView::processIncidenceSelection( Incidence *incidence )
- if ( incidence && incidence->type() == "Event" ) {
+ if ( incidence && incidence->typeID() == eventID ) {
Event *event = static_cast<Event *>( incidence );
@@ -3789,3 +3789,3 @@ void CalendarView::processIncidenceSelection( Incidence *incidence )
} else {
- if ( incidence && incidence->type() == "Todo" ) {
+ if ( incidence && incidence->typeID() == todoID ) {
emit todoSelected( true );
@@ -3812,3 +3812,3 @@ void CalendarView::processIncidenceSelection( Incidence *incidence )
- /* if ( incidence && incidence->type() == "Todo" ) {
+ /* if ( incidence && incidence->typeID() == todoID ) {
emit todoSelected( true );
@@ -4067,3 +4067,3 @@ Todo *CalendarView::selectedTodo()
Incidence *incidence = currentSelection();
- if ( incidence && incidence->type() == "Todo" ) {
+ if ( incidence && incidence->typeID() == todoID ) {
return static_cast<Todo *>( incidence );
@@ -4072,3 +4072,3 @@ Todo *CalendarView::selectedTodo()
incidence = mTodoList->selectedIncidences().first();
- if ( incidence && incidence->type() == "Todo" ) {
+ if ( incidence && incidence->typeID() == todoID ) {
return static_cast<Todo *>( incidence );
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 2a2acb1..fc213d8 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -755,3 +755,3 @@ void KOAgenda::startItemAction(QPoint viewportPos)
int gridDistanceY = (y - gy * mGridSpacingY);
- bool allowResize = ( mActionItem->incidence()->type() != "Todo" );
+ bool allowResize = ( mActionItem->incidence()->typeID() != todoID );
if (allowResize && gridDistanceY < mResizeBorderWidth &&
@@ -914,3 +914,3 @@ void KOAgenda::endItemAction()
- if ( placeItem->incidence()->type() == "Todo" ) {
+ if ( placeItem->incidence()->typeID() == todoID ) {
mSelectedItem = 0;
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index df2e478..5a3c4d2 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -108,3 +108,3 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd )
- if ( (incidence->type() == "Todo") &&
+ if ( (incidence->typeID() == todoID ) &&
( !((static_cast<Todo*>(incidence))->isCompleted()) &&
@@ -120,3 +120,3 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd )
if (cat.isEmpty()) {
- if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) )
+ if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) )
mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
@@ -126,3 +126,3 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd )
mBackgroundColor = *KOPrefs::instance()->categoryColor(cat);
- if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) {
+ if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) {
if ( mBackgroundColor == KOPrefs::instance()->mEventColor )
@@ -361,3 +361,3 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
static const QPixmap overduePxmp = SmallIcon("redcross16");
- if ( mIncidence->type() == "Todo" ) {
+ if ( mIncidence->typeID() == todoID ) {
Todo* tempTodo = static_cast<Todo*>(mIncidence);
@@ -542,3 +542,3 @@ void KOAgendaItem::computeText()
mDisplayedText = mIncidence->summary();
- if ( (mIncidence->type() == "Todo") ) {
+ if ( (mIncidence->typeID() == todoID ) ) {
if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
@@ -574,3 +574,3 @@ void KOAgendaItem::computeText()
if ( !mIncidence->doesFloat() ) {
- if ( mIncidence->type() == "Event" ) {
+ if ( mIncidence->typeID() == eventID ) {
if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) {
@@ -584,3 +584,3 @@ void KOAgendaItem::computeText()
}
- else if ( mIncidence->type() == "Todo" ) {
+ else if ( mIncidence->typeID() == todoID ) {
if (mIncidence->hasStartDate())
@@ -590,3 +590,3 @@ void KOAgendaItem::computeText()
}
- } else if ( mIncidence->type() == "Todo" ) {
+ } else if ( mIncidence->typeID() == todoID ) {
if (mIncidence->hasStartDate())
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 7022e02..be51694 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -402,4 +402,4 @@ void KOListView::setAlarm()
Incidence* inc = ((KOListViewItem *) qitem)->data();
- if ( inc->type() != "Journal" ) {
- if ( inc->type() == "Todo" ) {
+ if ( inc->typeID() != journalID ) {
+ if ( inc->typeID() == todoID ) {
if ( ((Todo*)inc)->hasDueDate() )
@@ -490,3 +490,3 @@ void KOListView::setCategories( bool removeOld )
bool setSub = false;
- if( inc->type() == "Todo" && sel.count() == 1 && inc->relations().count() > 0 ) {
+ if( inc->typeID() == todoID && sel.count() == 1 && inc->relations().count() > 0 ) {
int result = KMessageBox::warningYesNoCancel(this,
@@ -613,3 +613,3 @@ void KOListView::saveDescriptionToFile()
while ( incidence ) {
- if ( incidence->type() == "Journal" ) {
+ if ( incidence->typeID() == journalID ) {
text += "\n************************************\n";
@@ -623,3 +623,3 @@ void KOListView::saveDescriptionToFile()
text += "\n************************************\n";
- if ( incidence->type() == "Todo" )
+ if ( incidence->typeID() == todoID )
text += i18n("To-Do: ");
@@ -671,3 +671,3 @@ void KOListView::writeToFile( bool iCal )
if ( !journal )
- if ( ((KOListViewItem *)item)->data()->type() == "Journal")
+ if ( ((KOListViewItem *)item)->data()->typeID() == journalID )
journal = true;
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 5aaf360..2602487 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -704,3 +704,3 @@ void KOTodoView::updateView()
while ( incidence ) {
- if ( incidence->type() == "Todo") {
+ if ( incidence->typeID() == todoID ) {
//qDebug("related %s ",incidence->summary().latin1() );
@@ -846,3 +846,3 @@ QMap<Todo *,KOTodoViewItem *>::ConstIterator
Incidence *incidence = todo->relatedTo();
- if (incidence && incidence->type() == "Todo") {
+ if (incidence && incidence->typeID() == todoID ) {
Todo *relatedTodo = static_cast<Todo *>(incidence);
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 62d7ede..e8574a0 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -491,3 +491,3 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
noc = ev->getNextOccurence( cdt, &ok );
- if (! ok && ev->type() == "Event")
+ if (! ok && ev->typeID() == eventID)
return false;
@@ -498,3 +498,3 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
tempText += "<tr><td><b>";
- if (ev->type()=="Event") {
+ if (ev->typeID() == eventID ) {
if (reply) {
@@ -622,4 +622,4 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
tempText += "<a ";
- if (ev->type()=="Event") tempText += "href=\"event:";
- if (ev->type()=="Todo") tempText += "href=\"todo:";
+ if (ev->typeID() == eventID ) tempText += "href=\"event:";
+ if (ev->typeID() == todoID ) tempText += "href=\"todo:";
tempText += ev->uid() + "\">";
@@ -633,3 +633,3 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
int years = 0;
- if ( ev->type() =="Todo" ) {
+ if ( ev->typeID() == todoID ) {
years = noc.date().year() -((Todo*)ev)->dtDue().date().year();
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 53b65b2..481eab4 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1334,3 +1334,3 @@ void MainWindow::exportToPhone( int mode )
while ( incidence ) {
- if ( incidence->type() != "Journal" ) {
+ if ( incidence->typeID() != journalID ) {
bool add = true;
@@ -1338,3 +1338,3 @@ void MainWindow::exportToPhone( int mode )
QDateTime dt;
- if ( incidence->type() == "Todo" ) {
+ if ( incidence->typeID() == todoID ) {
Todo * t = (Todo*)incidence;
@@ -1598,3 +1598,3 @@ void MainWindow::processIncidenceSelection( Incidence *incidence )
QString startString = "";
- if ( incidence->type() != "Todo" ) {
+ if ( incidence->typeID() != todoID ) {
if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
@@ -1636,3 +1636,3 @@ void MainWindow::processIncidenceSelection( Incidence *incidence )
- if ( incidence->type() == "Event" ) {
+ if ( incidence->typeID() == eventID ) {
mShowAction->setText( i18n("Show Event...") );
@@ -1642,3 +1642,3 @@ void MainWindow::processIncidenceSelection( Incidence *incidence )
mNewSubTodoAction->setEnabled( false );
- } else if ( incidence->type() == "Todo" ) {
+ } else if ( incidence->typeID() == todoID ) {
mShowAction->setText( i18n("Show Todo...") );