summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoviewitem.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoviewitem.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index bdef94c..848e9e7 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -98,101 +98,95 @@ void KOTodoViewItem::construct()
if (mTodo->hasDueDate()) {
setText(3, mTodo->dtDueDateStr());
QDate d = mTodo->dtDue().date();
keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
// setSortKey(3,keyd);
if (mTodo->doesFloat()) {
setText(4,"");
}
else {
setText(4,mTodo->dtDueTimeStr());
QTime t = mTodo->dtDue().time();
keyt.sprintf("%02d%02d",t.hour(),t.minute());
//setSortKey(4,keyt);
}
} else {
setText(3,"");
setText(4,"");
}
setSortKey(3,keyd);
setSortKey(4,keyt);
if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt);
else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);
-
-
keyd = "";
keyt = "";
if (mTodo->isRunning() ) {
QDate d = mTodo->runStart().date();
QTime t = mTodo->runStart().time();
skeyt.sprintf("%02d%02d",t.hour(),t.minute());
skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
keyd = KGlobal::locale()->formatDate( d , true);
keyt = KGlobal::locale()->formatTime( t );
} else {
if (mTodo->hasStartDate()) {
keyd = mTodo->dtStartDateStr();
QDate d = mTodo->dtStart().date();
skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
if ( !mTodo->doesFloat()) {
keyt = mTodo->dtStartTimeStr();
QTime t = mTodo->dtStart().time();
skeyt.sprintf("%02d%02d",t.hour(),t.minute());
}
}
}
setText(5,keyd);
setText(6,keyt);
setSortKey(5,skeyd);
setSortKey(6,skeyt);
//setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No"));
setText(7,mTodo->categoriesStr());
setText(8,KOPrefs::instance()->calName( mTodo->calID()));
setText(9, KGlobal::locale()->formatDateTime( mTodo->lastModified(), true, true ));
setText(10, KGlobal::locale()->formatDateTime( mTodo->created(), true, true ));
setText(11, KGlobal::locale()->formatDateTime( mTodo->lastModifiedSub(), true, true ));
QString key;
- QDate d = mTodo->lastModified().date();
- QTime t = mTodo->lastModified().time();
- key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() );
- setSortKey(9,key);
+ QDate d;
+ QTime t;
+ setSortKey(9,mTodo->lastModifiedSortKey());
d = mTodo->created().date();
t = mTodo->created().time();
key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() );
setSortKey(10,key);
- d = mTodo->lastModifiedSub().date();
- t = mTodo->lastModifiedSub().time();
- key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() );
- setSortKey(11,key);
+ setSortKey(11,mTodo->lastModifiedSubSortKey());
#if 0
// Find sort id in description. It's the text behind the last '#' character
// found in the description. White spaces are removed from beginning and end
// of sort id.
int pos = mTodo->description().findRev('#');
if (pos < 0) {
setText(6,"");
} else {
QString str = mTodo->description().mid(pos+1);
str.stripWhiteSpace();
setText(6,str);
}
#endif
m_known = false;
m_init = false;
setMyPixmap();
}
void KOTodoViewItem::setMyPixmap()
{
int size = 5;