author | zecke <zecke> | 2004-11-18 21:55:17 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-18 21:55:17 (UTC) |
commit | fdef8103e849b674c95d01785259e072bcfb5a4b (patch) (unidiff) | |
tree | 411432edf236f8858094598617383dea95c14c3a | |
parent | c94afa23120bb72709973ae4711106e6e502fe65 (diff) | |
download | opie-fdef8103e849b674c95d01785259e072bcfb5a4b.zip opie-fdef8103e849b674c95d01785259e072bcfb5a4b.tar.gz opie-fdef8103e849b674c95d01785259e072bcfb5a4b.tar.bz2 |
-Kill owarn statements from the code
-Kill magic numbers and use enum values
-rw-r--r-- | core/pim/todo/main.cpp | 1 | ||||
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 16 | ||||
-rw-r--r-- | core/pim/todo/tableview.cpp | 32 | ||||
-rw-r--r-- | core/pim/todo/todomanager.cpp | 7 |
4 files changed, 22 insertions, 34 deletions
diff --git a/core/pim/todo/main.cpp b/core/pim/todo/main.cpp index d070ff8..a336ba3 100644 --- a/core/pim/todo/main.cpp +++ b/core/pim/todo/main.cpp | |||
@@ -39,3 +39,2 @@ int main( int argc, char **argv ) | |||
39 | int t = time.elapsed(); | 39 | int t = time.elapsed(); |
40 | Opie::Core::owarn << "QTime " << t/1000 << oendl; | ||
41 | mw.setCaption( QObject::tr("Opie Todolist")); | 40 | mw.setCaption( QObject::tr("Opie Todolist")); |
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index 2002e87..9424c23 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -298,3 +298,2 @@ QPopupMenu* MainWindow::contextMenu( int , bool recur ) { | |||
298 | QPopupMenu* MainWindow::options() { | 298 | QPopupMenu* MainWindow::options() { |
299 | owarn << "Options" << oendl; | ||
300 | return m_options; | 299 | return m_options; |
@@ -317,10 +316,8 @@ OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { | |||
317 | 316 | ||
318 | owarn << " Category " << cat << " " << m_curCat << oendl; | 317 | int filter = OPimTodoAccess::FilterCategory; |
319 | |||
320 | int filter = 1; | ||
321 | 318 | ||
322 | if (!m_completed ) | 319 | if (!m_completed ) |
323 | filter |= 4; | 320 | filter |= OPimTodoAccess::DoNotShowCompleted; |
324 | if (m_overdue) | 321 | if (m_overdue) |
325 | filter |= 2; | 322 | filter |= OPimTodoAccess::OnlyOverDue; |
326 | 323 | ||
@@ -376,3 +373,2 @@ void MainWindow::closeEvent( QCloseEvent* e ) { | |||
376 | if ( m_todoMgr.saveAll() ){ | 373 | if ( m_todoMgr.saveAll() ){ |
377 | owarn << "saved" << oendl; | ||
378 | quit = true; | 374 | quit = true; |
@@ -539,3 +535,2 @@ void MainWindow::setCategory( int c) { | |||
539 | 535 | ||
540 | owarn << "Iterating over cats " << c << oendl; | ||
541 | for ( unsigned int i = 1; i < m_catMenu->count(); i++ ) | 536 | for ( unsigned int i = 1; i < m_catMenu->count(); i++ ) |
@@ -685,3 +680,2 @@ void MainWindow::slotShow( int uid ) { | |||
685 | 680 | ||
686 | owarn << "slotShow" << oendl; | ||
687 | currentShow()->slotShow( event( uid ) ); | 681 | currentShow()->slotShow( event( uid ) ); |
@@ -744,3 +738,2 @@ void MainWindow::setReadAhead( uint count ) { | |||
744 | void MainWindow::slotQuickEntered() { | 738 | void MainWindow::slotQuickEntered() { |
745 | owarn << "entered" << oendl; | ||
746 | OPimTodo todo = quickEditor()->todo(); | 739 | OPimTodo todo = quickEditor()->todo(); |
@@ -791,3 +784,2 @@ void MainWindow::slotComplete( const OPimTodo& todo ) { | |||
791 | int dayDiff = to.dueDate().daysTo( date ); | 784 | int dayDiff = to.dueDate().daysTo( date ); |
792 | owarn << "day diff is " << dayDiff << oendl; | ||
793 | QDate inval; | 785 | QDate inval; |
@@ -955,3 +947,2 @@ namespace { | |||
955 | for ( it = als.begin(); it != als.end(); ++it ) { | 947 | for ( it = als.begin(); it != als.end(); ++it ) { |
956 | owarn << "Adding alarm for " << (*it).dateTime().toString() << oendl; | ||
957 | AlarmServer::addAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid ); | 948 | AlarmServer::addAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid ); |
@@ -963,3 +954,2 @@ namespace { | |||
963 | for ( it = als.begin(); it != als.end(); ++it ) { | 954 | for ( it = als.begin(); it != als.end(); ++it ) { |
964 | owarn << "Removinf alarm for " << (*it).dateTime().toString() << oendl; | ||
965 | AlarmServer::deleteAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid ); | 955 | AlarmServer::deleteAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid ); |
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp index b7458d8..221faca 100644 --- a/core/pim/todo/tableview.cpp +++ b/core/pim/todo/tableview.cpp | |||
@@ -140,3 +140,3 @@ TableView::TableView( MainWindow* window, QWidget* wid ) | |||
140 | viewport()->update(); | 140 | viewport()->update(); |
141 | setSortOrder( 0 ); | 141 | setSortOrder( Opie::OPimTodoAccess::Completed ); |
142 | setAscending( TRUE ); | 142 | setAscending( TRUE ); |
@@ -197,3 +197,2 @@ void TableView::showOverDue( bool ) { | |||
197 | void TableView::updateView( ) { | 197 | void TableView::updateView( ) { |
198 | owarn << "update view" << oendl; | ||
199 | m_row = false; | 198 | m_row = false; |
@@ -211,3 +210,2 @@ void TableView::updateView( ) { | |||
211 | 210 | ||
212 | owarn << "setTodos" << oendl; | ||
213 | QTime time; | 211 | QTime time; |
@@ -256,4 +254,3 @@ void TableView::removeEvent( int ) { | |||
256 | } | 254 | } |
257 | void TableView::setShowCompleted( bool b) { | 255 | void TableView::setShowCompleted( bool ) { |
258 | owarn << "Show Completed " << b << oendl; | ||
259 | updateView(); | 256 | updateView(); |
@@ -261,3 +258,2 @@ void TableView::setShowCompleted( bool b) { | |||
261 | void TableView::setShowDeadline( bool b ) { | 258 | void TableView::setShowDeadline( bool b ) { |
262 | owarn << "Show Deadline " << b << oendl; | ||
263 | if ( b ) | 259 | if ( b ) |
@@ -284,3 +280,2 @@ void TableView::setShowDeadline( bool b ) { | |||
284 | void TableView::setShowCategory( const QString& str) { | 280 | void TableView::setShowCategory( const QString& str) { |
285 | owarn << "setShowCategory" << oendl; | ||
286 | if ( str != m_oleCat || m_first ) | 281 | if ( str != m_oleCat || m_first ) |
@@ -349,4 +344,2 @@ void TableView::slotPressed(int row, int col, int, | |||
349 | 344 | ||
350 | owarn << "pressed row " << row << " col " << col << " x:" << point.x() | ||
351 | << "+y:" << point.y() << oendl; | ||
352 | m_prevP = point; | 345 | m_prevP = point; |
@@ -357,3 +350,2 @@ void TableView::slotPressed(int row, int col, int, | |||
357 | void TableView::slotValueChanged( int, int ) { | 350 | void TableView::slotValueChanged( int, int ) { |
358 | owarn << "Value Changed" << oendl; | ||
359 | } | 351 | } |
@@ -373,3 +365,18 @@ QWidget* TableView::widget() { | |||
373 | void TableView::sortColumn( int col, bool asc, bool ) { | 365 | void TableView::sortColumn( int col, bool asc, bool ) { |
374 | owarn << "bool " << asc << oendl; | 366 | switch(col) { |
367 | case 1: | ||
368 | col = Opie::OPimTodoAccess::Priority; | ||
369 | break; | ||
370 | case 2: | ||
371 | col = Opie::OPimTodoAccess::SortSummary; | ||
372 | break; | ||
373 | case 3: | ||
374 | col = Opie::OPimTodoAccess::Deadline; | ||
375 | break; | ||
376 | case 0: | ||
377 | default: | ||
378 | col = Opie::OPimTodoAccess::Completed; | ||
379 | break; | ||
380 | } | ||
381 | |||
375 | setSortOrder( col ); | 382 | setSortOrder( col ); |
@@ -496,3 +503,2 @@ QWidget* TableView::createEditor(int row, int col, bool )const { | |||
496 | void TableView::setCellContentFromEditor(int row, int col ) { | 503 | void TableView::setCellContentFromEditor(int row, int col ) { |
497 | owarn << "set cell content from editor" << oendl; | ||
498 | if ( col == 1 ) { | 504 | if ( col == 1 ) { |
@@ -532,3 +538,2 @@ void TableView::slotPriority() { | |||
532 | void TableView::timerEvent( QTimerEvent* ) { | 538 | void TableView::timerEvent( QTimerEvent* ) { |
533 | // Opie::Core::owarn << "sorted " << sorted().count() << oendl; | ||
534 | if (sorted().count() == 0 ) | 539 | if (sorted().count() == 0 ) |
@@ -580,3 +585,2 @@ void TableView::contentsMouseReleaseEvent( QMouseEvent* e) { | |||
580 | int colNew = columnAt(e->x() ); | 585 | int colNew = columnAt(e->x() ); |
581 | owarn << "colNew: " << colNew << " colOld: " << colOld << oendl; | ||
582 | if ( row == rowAt( e->y() ) && row != -1 && | 586 | if ( row == rowAt( e->y() ) && row != -1 && |
diff --git a/core/pim/todo/todomanager.cpp b/core/pim/todo/todomanager.cpp index c4b8fbc..7136f9a 100644 --- a/core/pim/todo/todomanager.cpp +++ b/core/pim/todo/todomanager.cpp | |||
@@ -39,6 +39,2 @@ TodoManager::TodoManager( QObject *obj ) | |||
39 | m_db = 0l; | 39 | m_db = 0l; |
40 | QTime time; | ||
41 | time.start(); | ||
42 | int el = time.elapsed(); | ||
43 | owarn << "QTimer for loading " << el/1000 << oendl; | ||
44 | } | 40 | } |
@@ -51,3 +47,2 @@ OPimTodo TodoManager::event(int uid ) { | |||
51 | void TodoManager::updateList() { | 47 | void TodoManager::updateList() { |
52 | owarn << "update lists" << oendl; | ||
53 | m_list = m_db->allRecords(); | 48 | m_list = m_db->allRecords(); |
@@ -61,3 +56,3 @@ OPimTodoAccess::List TodoManager::sorted( bool asc, int so, int f, int cat ) { | |||
61 | OPimTodoAccess::List::Iterator TodoManager::overDue() { | 56 | OPimTodoAccess::List::Iterator TodoManager::overDue() { |
62 | int filter = 2 | 1; | 57 | int filter = Opie::OPimTodoAccess::FilterCategory | Opie::OPimTodoAccess::OnlyOverDue; |
63 | m_list = m_db->sorted(m_asc, m_sortOrder, filter, m_ca ); | 58 | m_list = m_db->sorted(m_asc, m_sortOrder, filter, m_ca ); |