-rw-r--r-- | core/pim/todo/todotable.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/core/pim/todo/todotable.h b/core/pim/todo/todotable.h index 7539df1..387dddb 100644 --- a/core/pim/todo/todotable.h +++ b/core/pim/todo/todotable.h | |||
@@ -147,99 +147,96 @@ signals: | |||
147 | void signalNotFound(); | 147 | void signalNotFound(); |
148 | void signalWrapAround(); | 148 | void signalWrapAround(); |
149 | void showDetails( const ToDoEvent & ); | 149 | void showDetails( const ToDoEvent & ); |
150 | protected: | 150 | protected: |
151 | void keyPressEvent( QKeyEvent *e ); | 151 | void keyPressEvent( QKeyEvent *e ); |
152 | 152 | ||
153 | private: | 153 | private: |
154 | void updateVisible(); | 154 | void updateVisible(); |
155 | void viewportPaintEvent( QPaintEvent * ); | 155 | void viewportPaintEvent( QPaintEvent * ); |
156 | void internalAddEntries( QList<ToDoEvent> &list); | 156 | void internalAddEntries( QList<ToDoEvent> &list); |
157 | inline void insertIntoTable( ToDoEvent *todo, int row ); | 157 | inline void insertIntoTable( ToDoEvent *todo, int row ); |
158 | void updateJournal( const ToDoEvent &todo, journal_action action); | 158 | void updateJournal( const ToDoEvent &todo, journal_action action); |
159 | void mergeJournal(); | 159 | void mergeJournal(); |
160 | void journalFreeReplaceEntry( const ToDoEvent &todo, int row ); | 160 | void journalFreeReplaceEntry( const ToDoEvent &todo, int row ); |
161 | void journalFreeRemoveEntry( int row ); | 161 | void journalFreeRemoveEntry( int row ); |
162 | inline void realignTable( int row ); | 162 | inline void realignTable( int row ); |
163 | void loadFile( const QString &strFile); | 163 | void loadFile( const QString &strFile); |
164 | 164 | ||
165 | private slots: | 165 | private slots: |
166 | void slotClicked( int row, int col, int button, const QPoint &pos ); | 166 | void slotClicked( int row, int col, int button, const QPoint &pos ); |
167 | void slotPressed( int row, int col, int button, const QPoint &pos ); | 167 | void slotPressed( int row, int col, int button, const QPoint &pos ); |
168 | void slotCheckPriority(int row, int col ); | 168 | void slotCheckPriority(int row, int col ); |
169 | void slotCurrentChanged(int row, int col ); | 169 | void slotCurrentChanged(int row, int col ); |
170 | void slotDoFind( const QString &findString, bool caseSensetive, | 170 | void slotDoFind( const QString &findString, bool caseSensetive, |
171 | bool backwards, int category ); | 171 | bool backwards, int category ); |
172 | void slotShowMenu(); | 172 | void slotShowMenu(); |
173 | void rowHeightChanged( int row ); | 173 | void rowHeightChanged( int row ); |
174 | void slotCheckDay(); // check the day | 174 | void slotCheckDay(); // check the day |
175 | 175 | ||
176 | private: | 176 | private: |
177 | friend class TodoWindow; | 177 | friend class TodoWindow; |
178 | 178 | ||
179 | QMap<CheckItem*, ToDoEvent *> todoList; | 179 | QMap<CheckItem*, ToDoEvent *> todoList; |
180 | QStringList categoryList; | 180 | QStringList categoryList; |
181 | bool showComp; | 181 | bool showComp; |
182 | QString showCat; | 182 | QString showCat; |
183 | QTimer *menuTimer; | 183 | QTimer *menuTimer; |
184 | QDate mDay; | 184 | QDate mDay; |
185 | QTimer *mDayTimer; // see if the day changed | 185 | QTimer *mDayTimer; // see if the day changed |
186 | bool enablePainting; | 186 | bool enablePainting; |
187 | Categories mCat; | 187 | Categories mCat; |
188 | int currFindRow; | 188 | int currFindRow; |
189 | bool showDeadl:1; | 189 | bool showDeadl:1; |
190 | }; | 190 | }; |
191 | 191 | ||
192 | 192 | ||
193 | inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) | 193 | inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) |
194 | { | 194 | { |
195 | int rows = numRows(); | ||
196 | ++rows; | ||
197 | setNumRows( rows ); | ||
198 | QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A') | 195 | QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A') |
199 | + todo->priority() ) | 196 | + todo->priority() ) |
200 | + Qtopia::buildSortKey( todo->description() ); | 197 | + Qtopia::buildSortKey( todo->description() ); |
201 | CheckItem *chk = new CheckItem( this, sortKey ); | 198 | CheckItem *chk = new CheckItem( this, sortKey ); |
202 | chk->setChecked( todo->isCompleted() ); | 199 | chk->setChecked( todo->isCompleted() ); |
203 | ComboItem *cmb = new ComboItem( this, QTableItem::WhenCurrent ); | 200 | ComboItem *cmb = new ComboItem( this, QTableItem::WhenCurrent ); |
204 | cmb->setText( QString::number( todo->priority() ) ); | 201 | cmb->setText( QString::number( todo->priority() ) ); |
205 | QString sum = todo->summary(); | 202 | QString sum = todo->summary(); |
206 | QTableItem *ti = new TodoTextItem( this, sum.isEmpty() ? todo->description().left(40).simplifyWhiteSpace() : sum ); | 203 | QTableItem *ti = new TodoTextItem( this, sum.isEmpty() ? todo->description().left(40).simplifyWhiteSpace() : sum ); |
207 | ti->setReplaceable( false ); | 204 | ti->setReplaceable( false ); |
208 | 205 | ||
209 | DueTextItem *due = new DueTextItem(this, todo ); | 206 | DueTextItem *due = new DueTextItem(this, todo ); |
210 | setItem( row, 3, due); | 207 | setItem( row, 3, due); |
211 | 208 | ||
212 | setItem( row, 0, chk ); | 209 | setItem( row, 0, chk ); |
213 | setItem( row, 1, cmb ); | 210 | setItem( row, 1, cmb ); |
214 | setItem( row, 2, ti ); | 211 | setItem( row, 2, ti ); |
215 | 212 | ||
216 | 213 | ||
217 | todoList.insert( chk, todo ); | 214 | todoList.insert( chk, todo ); |
218 | } | 215 | } |
219 | 216 | ||
220 | inline void TodoTable::realignTable( int row ) | 217 | inline void TodoTable::realignTable( int row ) |
221 | { | 218 | { |
222 | QTableItem *ti1, | 219 | QTableItem *ti1, |
223 | *ti2, | 220 | *ti2, |
224 | *ti3, | 221 | *ti3, |
225 | *ti4; | 222 | *ti4; |
226 | int totalRows = numRows(); | 223 | int totalRows = numRows(); |
227 | for ( int curr = row; curr < totalRows - 1; curr++ ) { | 224 | for ( int curr = row; curr < totalRows - 1; curr++ ) { |
228 | // this is bad, we must take the item out and then | 225 | // this is bad, we must take the item out and then |
229 | // set it. In the end, it behaves no worse (time wise) | 226 | // set it. In the end, it behaves no worse (time wise) |
230 | // then the old way of saving the entries to file, clearing | 227 | // then the old way of saving the entries to file, clearing |
231 | // the table re-reading in the file and resetting the table | 228 | // the table re-reading in the file and resetting the table |
232 | ti1 = item( curr + 1, 0 ); | 229 | ti1 = item( curr + 1, 0 ); |
233 | ti2 = item( curr + 1, 1 ); | 230 | ti2 = item( curr + 1, 1 ); |
234 | ti3 = item( curr + 1, 2 ); | 231 | ti3 = item( curr + 1, 2 ); |
235 | ti4 = item( curr + 1, 3 ); | 232 | ti4 = item( curr + 1, 3 ); |
236 | takeItem( ti1 ); | 233 | takeItem( ti1 ); |
237 | takeItem( ti2 ); | 234 | takeItem( ti2 ); |
238 | takeItem( ti3 ); | 235 | takeItem( ti3 ); |
239 | takeItem( ti4 ); | 236 | takeItem( ti4 ); |
240 | setItem( curr, 0, ti1 ); | 237 | setItem( curr, 0, ti1 ); |
241 | setItem( curr, 1, ti2 ); | 238 | setItem( curr, 1, ti2 ); |
242 | setItem( curr, 2, ti3 ); | 239 | setItem( curr, 2, ti3 ); |
243 | setItem( curr, 3, ti4 ); | 240 | setItem( curr, 3, ti4 ); |
244 | } | 241 | } |
245 | setNumRows( totalRows - 1 ); | 242 | setNumRows( totalRows - 1 ); |