-rw-r--r-- | korganizer/kotodoviewitem.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index ae0b334..347d982 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp | |||
@@ -78,8 +78,10 @@ void KOTodoViewItem::construct() | |||
78 | // qDebug("KOTodoViewItem::construct() "); | 78 | // qDebug("KOTodoViewItem::construct() "); |
79 | m_init = true; | 79 | m_init = true; |
80 | QString keyd = "=="; | 80 | QString keyd = "=="; |
81 | QString keyt = "=="; | 81 | QString keyt = "=="; |
82 | QString skeyd = "=="; | ||
83 | QString skeyt = "=="; | ||
82 | 84 | ||
83 | setOn(mTodo->isCompleted()); | 85 | setOn(mTodo->isCompleted()); |
84 | setText(0,mTodo->summary()); | 86 | setText(0,mTodo->summary()); |
85 | setText(1,QString::number(mTodo->priority())); | 87 | setText(1,QString::number(mTodo->priority())); |
@@ -95,17 +97,17 @@ void KOTodoViewItem::construct() | |||
95 | if (mTodo->hasDueDate()) { | 97 | if (mTodo->hasDueDate()) { |
96 | setText(3, mTodo->dtDueDateStr()); | 98 | setText(3, mTodo->dtDueDateStr()); |
97 | QDate d = mTodo->dtDue().date(); | 99 | QDate d = mTodo->dtDue().date(); |
98 | keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 100 | keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
99 | setSortKey(3,keyd); | 101 | // setSortKey(3,keyd); |
100 | if (mTodo->doesFloat()) { | 102 | if (mTodo->doesFloat()) { |
101 | setText(4,""); | 103 | setText(4,""); |
102 | } | 104 | } |
103 | else { | 105 | else { |
104 | setText(4,mTodo->dtDueTimeStr()); | 106 | setText(4,mTodo->dtDueTimeStr()); |
105 | QTime t = mTodo->dtDue().time(); | 107 | QTime t = mTodo->dtDue().time(); |
106 | keyt.sprintf("%02d%02d",t.hour(),t.minute()); | 108 | keyt.sprintf("%02d%02d",t.hour(),t.minute()); |
107 | setSortKey(4,keyt); | 109 | //setSortKey(4,keyt); |
108 | } | 110 | } |
109 | } else { | 111 | } else { |
110 | setText(3,""); | 112 | setText(3,""); |
111 | setText(4,""); | 113 | setText(4,""); |
@@ -115,10 +117,33 @@ void KOTodoViewItem::construct() | |||
115 | 117 | ||
116 | if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); | 118 | if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); |
117 | else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); | 119 | else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); |
118 | 120 | ||
119 | setText(5,mTodo->cancelled() ? i18n("Yes") : i18n("No")); | 121 | |
120 | setText(6,mTodo->categoriesStr()); | 122 | |
123 | if (mTodo->hasStartDate()) { | ||
124 | setText(5, mTodo->dtStartDateStr()); | ||
125 | QDate d = mTodo->dtStart().date(); | ||
126 | skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | ||
127 | |||
128 | if (mTodo->doesFloat()) { | ||
129 | setText(6,""); | ||
130 | } | ||
131 | else { | ||
132 | setText(6,mTodo->dtStartTimeStr()); | ||
133 | QTime t = mTodo->dtStart().time(); | ||
134 | skeyt.sprintf("%02d%02d",t.hour(),t.minute()); | ||
135 | |||
136 | } | ||
137 | } else { | ||
138 | setText(5,""); | ||
139 | setText(6,""); | ||
140 | } | ||
141 | setSortKey(5,skeyd); | ||
142 | setSortKey(6,skeyt); | ||
143 | |||
144 | setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); | ||
145 | setText(8,mTodo->categoriesStr()); | ||
121 | 146 | ||
122 | #if 0 | 147 | #if 0 |
123 | // Find sort id in description. It's the text behind the last '#' character | 148 | // Find sort id in description. It's the text behind the last '#' character |
124 | // found in the description. White spaces are removed from beginning and end | 149 | // found in the description. White spaces are removed from beginning and end |