From 3e2908a91251482d91404464aaf98ce902a319ce Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 02 Jul 2005 22:11:57 +0000 Subject: added lm --- (limited to 'korganizer/kolistview.cpp') diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index ea037a9..cec0476 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -140,9 +140,14 @@ bool ListItemVisitor::visit(Event *e) mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); mItem->setText(10,e->categoriesStr()); mItem->setText(11, KOPrefs::instance()->calName( e->calID() )); - - QString key; - QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); + mItem->setText(12, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); + + QString key; + QDate d = e->lastModified().date(); + QTime t = e->lastModified().time(); + key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); + mItem->setSortKey(12,key); + t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); mItem->setSortKey(1,key); @@ -195,18 +200,21 @@ bool ListItemVisitor::visit(Todo *t) mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); mItem->setText(10,t->categoriesStr()); mItem->setText(11, KOPrefs::instance()->calName( t->calID() )); - + mItem->setText(12, KGlobal::locale()->formatDateTime( t->lastModified(), true, true )); QString key; - QDate d; + QDate d = t->lastModified().date(); + QTime tm = t->lastModified().time(); + key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); + mItem->setSortKey(12,key); if (t->hasDueDate()) { d = t->dtDue().date(); - QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); + tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); mItem->setSortKey(7,key); } if ( t->hasStartDate() ) { d = t->dtStart().date(); - QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); + tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); mItem->setSortKey(1,key); } @@ -237,9 +245,14 @@ bool ListItemVisitor::visit(Journal * j) mItem->setText(9,"---"); mItem->setText(10,j->categoriesStr()); mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); - - QString key; - QDate d = j->dtStart().date(); + mItem->setText(12, KGlobal::locale()->formatDateTime( j->lastModified(), true, true )); + + QString key; + QDate d = j->lastModified().date(); + QTime tm = j->lastModified().time(); + key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); + mItem->setSortKey(12,key); + d = j->dtStart().date(); key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); mItem->setSortKey(1,key); mItem->setSortKey(7,key); @@ -267,6 +280,7 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, mListView->addColumn(i18n("Cancelled")); mListView->addColumn(i18n("Categories")); mListView->addColumn(i18n("Calendar")); + mListView->addColumn(i18n("Last Modified")); mListView->setColumnAlignment(0,AlignLeft); mListView->setColumnAlignment(1,AlignLeft); @@ -280,10 +294,11 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, mListView->setColumnAlignment(9,AlignLeft); mListView->setColumnAlignment(10,AlignLeft); mListView->setColumnAlignment(11,AlignLeft); + mListView->setColumnAlignment(12,AlignLeft); mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); int iii = 0; - for ( iii = 0; iii< 12 ; ++iii ) + for ( iii = 0; iii< 13 ; ++iii ) mListView->setColumnWidthMode( iii, QListView::Manual ); QBoxLayout *layoutTop = new QVBoxLayout(this); -- cgit v0.9.0.2