Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 14 |
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 | |||
@@ -106,34 +106,32 @@ void KOTodoViewItem::construct() | |||
106 | else { | 106 | else { |
107 | setText(4,mTodo->dtDueTimeStr()); | 107 | setText(4,mTodo->dtDueTimeStr()); |
108 | QTime t = mTodo->dtDue().time(); | 108 | QTime t = mTodo->dtDue().time(); |
109 | keyt.sprintf("%02d%02d",t.hour(),t.minute()); | 109 | keyt.sprintf("%02d%02d",t.hour(),t.minute()); |
110 | //setSortKey(4,keyt); | 110 | //setSortKey(4,keyt); |
111 | } | 111 | } |
112 | } else { | 112 | } else { |
113 | setText(3,""); | 113 | setText(3,""); |
114 | setText(4,""); | 114 | setText(4,""); |
115 | } | 115 | } |
116 | setSortKey(3,keyd); | 116 | setSortKey(3,keyd); |
117 | setSortKey(4,keyt); | 117 | setSortKey(4,keyt); |
118 | 118 | ||
119 | if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); | 119 | if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); |
120 | else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); | 120 | else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); |
121 | 121 | ||
122 | |||
123 | |||
124 | keyd = ""; | 122 | keyd = ""; |
125 | keyt = ""; | 123 | keyt = ""; |
126 | 124 | ||
127 | if (mTodo->isRunning() ) { | 125 | if (mTodo->isRunning() ) { |
128 | QDate d = mTodo->runStart().date(); | 126 | QDate d = mTodo->runStart().date(); |
129 | QTime t = mTodo->runStart().time(); | 127 | QTime t = mTodo->runStart().time(); |
130 | skeyt.sprintf("%02d%02d",t.hour(),t.minute()); | 128 | skeyt.sprintf("%02d%02d",t.hour(),t.minute()); |
131 | skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 129 | skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
132 | keyd = KGlobal::locale()->formatDate( d , true); | 130 | keyd = KGlobal::locale()->formatDate( d , true); |
133 | keyt = KGlobal::locale()->formatTime( t ); | 131 | keyt = KGlobal::locale()->formatTime( t ); |
134 | 132 | ||
135 | } else { | 133 | } else { |
136 | 134 | ||
137 | if (mTodo->hasStartDate()) { | 135 | if (mTodo->hasStartDate()) { |
138 | keyd = mTodo->dtStartDateStr(); | 136 | keyd = mTodo->dtStartDateStr(); |
139 | QDate d = mTodo->dtStart().date(); | 137 | QDate d = mTodo->dtStart().date(); |
@@ -147,44 +145,40 @@ void KOTodoViewItem::construct() | |||
147 | } | 145 | } |
148 | 146 | ||
149 | } | 147 | } |
150 | } | 148 | } |
151 | setText(5,keyd); | 149 | setText(5,keyd); |
152 | setText(6,keyt); | 150 | setText(6,keyt); |
153 | setSortKey(5,skeyd); | 151 | setSortKey(5,skeyd); |
154 | setSortKey(6,skeyt); | 152 | setSortKey(6,skeyt); |
155 | 153 | ||
156 | //setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); | 154 | //setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); |
157 | setText(7,mTodo->categoriesStr()); | 155 | setText(7,mTodo->categoriesStr()); |
158 | setText(8,KOPrefs::instance()->calName( mTodo->calID())); | 156 | setText(8,KOPrefs::instance()->calName( mTodo->calID())); |
159 | setText(9, KGlobal::locale()->formatDateTime( mTodo->lastModified(), true, true )); | 157 | setText(9, KGlobal::locale()->formatDateTime( mTodo->lastModified(), true, true )); |
160 | setText(10, KGlobal::locale()->formatDateTime( mTodo->created(), true, true )); | 158 | setText(10, KGlobal::locale()->formatDateTime( mTodo->created(), true, true )); |
161 | setText(11, KGlobal::locale()->formatDateTime( mTodo->lastModifiedSub(), true, true )); | 159 | setText(11, KGlobal::locale()->formatDateTime( mTodo->lastModifiedSub(), true, true )); |
162 | QString key; | 160 | QString key; |
163 | QDate d = mTodo->lastModified().date(); | 161 | QDate d; |
164 | QTime t = mTodo->lastModified().time(); | 162 | QTime t; |
165 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | 163 | setSortKey(9,mTodo->lastModifiedSortKey()); |
166 | setSortKey(9,key); | ||
167 | d = mTodo->created().date(); | 164 | d = mTodo->created().date(); |
168 | t = mTodo->created().time(); | 165 | t = mTodo->created().time(); |
169 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | 166 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); |
170 | setSortKey(10,key); | 167 | setSortKey(10,key); |
171 | d = mTodo->lastModifiedSub().date(); | 168 | setSortKey(11,mTodo->lastModifiedSubSortKey()); |
172 | t = mTodo->lastModifiedSub().time(); | ||
173 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | ||
174 | setSortKey(11,key); | ||
175 | 169 | ||
176 | #if 0 | 170 | #if 0 |
177 | // Find sort id in description. It's the text behind the last '#' character | 171 | // Find sort id in description. It's the text behind the last '#' character |
178 | // found in the description. White spaces are removed from beginning and end | 172 | // found in the description. White spaces are removed from beginning and end |
179 | // of sort id. | 173 | // of sort id. |
180 | int pos = mTodo->description().findRev('#'); | 174 | int pos = mTodo->description().findRev('#'); |
181 | if (pos < 0) { | 175 | if (pos < 0) { |
182 | setText(6,""); | 176 | setText(6,""); |
183 | } else { | 177 | } else { |
184 | QString str = mTodo->description().mid(pos+1); | 178 | QString str = mTodo->description().mid(pos+1); |
185 | str.stripWhiteSpace(); | 179 | str.stripWhiteSpace(); |
186 | setText(6,str); | 180 | setText(6,str); |
187 | } | 181 | } |
188 | #endif | 182 | #endif |
189 | 183 | ||
190 | m_known = false; | 184 | m_known = false; |