summaryrefslogtreecommitdiffabout
path: root/korganizer/kolistview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kolistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 7022e02..be51694 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -391,26 +391,26 @@ void KOListView::setCat()
}
void KOListView::setAlarm()
{
KOAlarmPrefs kap( this);
if ( !kap.exec() )
return;
QStringList itemList;
QPtrList<KOListViewItem> sel ;
QListViewItem *qitem = mListView->firstChild ();
while ( qitem ) {
if ( qitem->isSelected() ) {
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() )
sel.append(((KOListViewItem *)qitem));
} else
sel.append(((KOListViewItem *)qitem));
}
}
qitem = qitem->nextSibling();
}
int count = 0;
KOListViewItem * item, *temp;
item = sel.first();
Incidence* inc;
@@ -479,25 +479,25 @@ void KOListView::setCategories( bool removeOld )
QListViewItem *qitem = mListView->firstChild ();
while ( qitem ) {
if ( qitem->isSelected() ) {
sel.append(((KOListViewItem *)qitem));
}
qitem = qitem->nextSibling();
}
KOListViewItem * item, *temp;
item = sel.first();
if( item ) {
Incidence* inc = item->data() ;
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,
i18n("The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?").arg( inc->summary().left ( 25 ) ),
i18n("Todo has subtodos"),
i18n("Yes"),
i18n("No"));
if (result == KMessageBox::Cancel) item = 0;
if (result == KMessageBox::Yes) setSub = true;
}
while ( item ) {
inc = item->data();
if ( removeOld ) {
inc->setCategories( catList, setSub );
@@ -602,35 +602,35 @@ void KOListView::saveDescriptionToFile()
i18n("Overwrite!"), i18n("Cancel"), 0,
0, 1 );
if ( result != 0 ) {
createbup = false;
}
}
if ( createbup ) {
QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") +
KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false);
Incidence *incidence = delSel.first();
icount = 0;
while ( incidence ) {
- if ( incidence->type() == "Journal" ) {
+ if ( incidence->typeID() == journalID ) {
text += "\n************************************\n";
text += i18n("Journal from: ") +incidence->dtStartDateStr( false );
text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false);
text +="\n" + i18n("Description: ") + "\n"+ incidence->description();
++icount;
} else {
if ( !incidence->description().isEmpty() ) {
text += "\n************************************\n";
- if ( incidence->type() == "Todo" )
+ if ( incidence->typeID() == todoID )
text += i18n("To-Do: ");
text += incidence->summary();
if ( incidence->hasStartDate() )
text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false );
text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false);
if ( !incidence->location().isEmpty() )
text += "\n" +i18n("Location: ") + incidence->location();
text += "\n" + i18n("Description: ") + "\n" + incidence->description();
++icount;
}
}
@@ -660,25 +660,25 @@ void KOListView::saveToFile()
writeToFile( true );
}
void KOListView::writeToFile( bool iCal )
{
int icount = 0;
QPtrList<Incidence> delSel ;
QListViewItem *item = mListView->firstChild ();
bool journal = iCal; // warn only for vCal
while ( item ) {
if ( item->isSelected() ) {
if ( !journal )
- if ( ((KOListViewItem *)item)->data()->type() == "Journal")
+ if ( ((KOListViewItem *)item)->data()->typeID() == journalID )
journal = true;
delSel.append(((KOListViewItem *)item)->data());
++icount;
}
item = item->nextSibling();
}
if ( !iCal && journal ) {
int result = KMessageBox::warningContinueCancel(this,
i18n("The journal entries can not be\nexported to a vCalendar file."),
i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
true);