author | zecke <zecke> | 2004-11-18 21:55:17 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-18 21:55:17 (UTC) |
commit | fdef8103e849b674c95d01785259e072bcfb5a4b (patch) (side-by-side diff) | |
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 ) int t = time.elapsed(); - Opie::Core::owarn << "QTime " << t/1000 << oendl; 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 ) { QPopupMenu* MainWindow::options() { - owarn << "Options" << oendl; return m_options; @@ -317,10 +316,8 @@ OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { - owarn << " Category " << cat << " " << m_curCat << oendl; - - int filter = 1; + int filter = OPimTodoAccess::FilterCategory; if (!m_completed ) - filter |= 4; + filter |= OPimTodoAccess::DoNotShowCompleted; if (m_overdue) - filter |= 2; + filter |= OPimTodoAccess::OnlyOverDue; @@ -376,3 +373,2 @@ void MainWindow::closeEvent( QCloseEvent* e ) { if ( m_todoMgr.saveAll() ){ - owarn << "saved" << oendl; quit = true; @@ -539,3 +535,2 @@ void MainWindow::setCategory( int c) { - owarn << "Iterating over cats " << c << oendl; for ( unsigned int i = 1; i < m_catMenu->count(); i++ ) @@ -685,3 +680,2 @@ void MainWindow::slotShow( int uid ) { - owarn << "slotShow" << oendl; currentShow()->slotShow( event( uid ) ); @@ -744,3 +738,2 @@ void MainWindow::setReadAhead( uint count ) { void MainWindow::slotQuickEntered() { - owarn << "entered" << oendl; OPimTodo todo = quickEditor()->todo(); @@ -791,3 +784,2 @@ void MainWindow::slotComplete( const OPimTodo& todo ) { int dayDiff = to.dueDate().daysTo( date ); - owarn << "day diff is " << dayDiff << oendl; QDate inval; @@ -955,3 +947,2 @@ namespace { for ( it = als.begin(); it != als.end(); ++it ) { - owarn << "Adding alarm for " << (*it).dateTime().toString() << oendl; AlarmServer::addAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid ); @@ -963,3 +954,2 @@ namespace { for ( it = als.begin(); it != als.end(); ++it ) { - owarn << "Removinf alarm for " << (*it).dateTime().toString() << oendl; 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 ) viewport()->update(); - setSortOrder( 0 ); + setSortOrder( Opie::OPimTodoAccess::Completed ); setAscending( TRUE ); @@ -197,3 +197,2 @@ void TableView::showOverDue( bool ) { void TableView::updateView( ) { - owarn << "update view" << oendl; m_row = false; @@ -211,3 +210,2 @@ void TableView::updateView( ) { - owarn << "setTodos" << oendl; QTime time; @@ -256,4 +254,3 @@ void TableView::removeEvent( int ) { } -void TableView::setShowCompleted( bool b) { - owarn << "Show Completed " << b << oendl; +void TableView::setShowCompleted( bool ) { updateView(); @@ -261,3 +258,2 @@ void TableView::setShowCompleted( bool b) { void TableView::setShowDeadline( bool b ) { - owarn << "Show Deadline " << b << oendl; if ( b ) @@ -284,3 +280,2 @@ void TableView::setShowDeadline( bool b ) { void TableView::setShowCategory( const QString& str) { - owarn << "setShowCategory" << oendl; if ( str != m_oleCat || m_first ) @@ -349,4 +344,2 @@ void TableView::slotPressed(int row, int col, int, - owarn << "pressed row " << row << " col " << col << " x:" << point.x() - << "+y:" << point.y() << oendl; m_prevP = point; @@ -357,3 +350,2 @@ void TableView::slotPressed(int row, int col, int, void TableView::slotValueChanged( int, int ) { - owarn << "Value Changed" << oendl; } @@ -373,3 +365,18 @@ QWidget* TableView::widget() { void TableView::sortColumn( int col, bool asc, bool ) { - owarn << "bool " << asc << oendl; + switch(col) { + case 1: + col = Opie::OPimTodoAccess::Priority; + break; + case 2: + col = Opie::OPimTodoAccess::SortSummary; + break; + case 3: + col = Opie::OPimTodoAccess::Deadline; + break; + case 0: + default: + col = Opie::OPimTodoAccess::Completed; + break; + } + setSortOrder( col ); @@ -496,3 +503,2 @@ QWidget* TableView::createEditor(int row, int col, bool )const { void TableView::setCellContentFromEditor(int row, int col ) { - owarn << "set cell content from editor" << oendl; if ( col == 1 ) { @@ -532,3 +538,2 @@ void TableView::slotPriority() { void TableView::timerEvent( QTimerEvent* ) { -// Opie::Core::owarn << "sorted " << sorted().count() << oendl; if (sorted().count() == 0 ) @@ -580,3 +585,2 @@ void TableView::contentsMouseReleaseEvent( QMouseEvent* e) { int colNew = columnAt(e->x() ); - owarn << "colNew: " << colNew << " colOld: " << colOld << oendl; 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 ) m_db = 0l; - QTime time; - time.start(); - int el = time.elapsed(); - owarn << "QTimer for loading " << el/1000 << oendl; } @@ -51,3 +47,2 @@ OPimTodo TodoManager::event(int uid ) { void TodoManager::updateList() { - owarn << "update lists" << oendl; m_list = m_db->allRecords(); @@ -61,3 +56,3 @@ OPimTodoAccess::List TodoManager::sorted( bool asc, int so, int f, int cat ) { OPimTodoAccess::List::Iterator TodoManager::overDue() { - int filter = 2 | 1; + int filter = Opie::OPimTodoAccess::FilterCategory | Opie::OPimTodoAccess::OnlyOverDue; m_list = m_db->sorted(m_asc, m_sortOrder, filter, m_ca ); |