summaryrefslogtreecommitdiff
authorzecke <zecke>2004-11-18 21:55:17 (UTC)
committer zecke <zecke>2004-11-18 21:55:17 (UTC)
commitfdef8103e849b674c95d01785259e072bcfb5a4b (patch) (side-by-side diff)
tree411432edf236f8858094598617383dea95c14c3a
parentc94afa23120bb72709973ae4711106e6e502fe65 (diff)
downloadopie-fdef8103e849b674c95d01785259e072bcfb5a4b.zip
opie-fdef8103e849b674c95d01785259e072bcfb5a4b.tar.gz
opie-fdef8103e849b674c95d01785259e072bcfb5a4b.tar.bz2
-Kill owarn statements from the code
-Kill magic numbers and use enum values
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/todo/main.cpp1
-rw-r--r--core/pim/todo/mainwindow.cpp16
-rw-r--r--core/pim/todo/tableview.cpp32
-rw-r--r--core/pim/todo/todomanager.cpp7
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
@@ -38,5 +38,4 @@ int main( int argc, char **argv )
Todo::MainWindow mw;
int t = time.elapsed();
- Opie::Core::owarn << "QTime " << t/1000 << oendl;
mw.setCaption( QObject::tr("Opie Todolist"));
QObject::connect( &a, SIGNAL( flush() ), &mw, SLOT( slotFlush() ) );
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
@@ -297,5 +297,4 @@ QPopupMenu* MainWindow::contextMenu( int , bool recur ) {
}
QPopupMenu* MainWindow::options() {
- owarn << "Options" << oendl;
return m_options;
}
@@ -316,12 +315,10 @@ OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) {
cat = -1;
- 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;
return m_todoMgr.sorted( asc, sortOrder, filter, cat );
@@ -375,5 +372,4 @@ void MainWindow::closeEvent( QCloseEvent* e ) {
bool quit = false;
if ( m_todoMgr.saveAll() ){
- owarn << "saved" << oendl;
quit = true;
}else {
@@ -538,5 +534,4 @@ void MainWindow::setCategory( int c) {
- owarn << "Iterating over cats " << c << oendl;
for ( unsigned int i = 1; i < m_catMenu->count(); i++ )
m_catMenu->setItemChecked(i, c == (int)i );
@@ -684,5 +679,4 @@ void MainWindow::slotShow( int uid ) {
- owarn << "slotShow" << oendl;
currentShow()->slotShow( event( uid ) );
m_stack->raiseWidget( currentShow()->widget() );
@@ -743,5 +737,4 @@ void MainWindow::setReadAhead( uint count ) {
}
void MainWindow::slotQuickEntered() {
- owarn << "entered" << oendl;
OPimTodo todo = quickEditor()->todo();
if (todo.isEmpty() )
@@ -790,5 +783,4 @@ void MainWindow::slotComplete( const OPimTodo& todo ) {
if ( to2.recurrence().nextOcurrence( to2.dueDate().addDays(1), date ) ) {
int dayDiff = to.dueDate().daysTo( date );
- owarn << "day diff is " << dayDiff << oendl;
QDate inval;
/* generate a new uid for the old record */
@@ -954,5 +946,4 @@ namespace {
OPimNotifyManager::Alarms::ConstIterator it;
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 );
}
@@ -962,5 +953,4 @@ namespace {
OPimNotifyManager::Alarms::ConstIterator it;
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
@@ -139,5 +139,5 @@ TableView::TableView( MainWindow* window, QWidget* wid )
viewport()->setUpdatesEnabled( true );
viewport()->update();
- setSortOrder( 0 );
+ setSortOrder( Opie::OPimTodoAccess::Completed );
setAscending( TRUE );
m_first = true;
@@ -196,5 +196,4 @@ void TableView::showOverDue( bool ) {
void TableView::updateView( ) {
- owarn << "update view" << oendl;
m_row = false;
static int id;
@@ -210,5 +209,4 @@ void TableView::updateView( ) {
end = sorted().end();
- owarn << "setTodos" << oendl;
QTime time;
time.start();
@@ -255,10 +253,8 @@ void TableView::removeEvent( int ) {
updateView();
}
-void TableView::setShowCompleted( bool b) {
- owarn << "Show Completed " << b << oendl;
+void TableView::setShowCompleted( bool ) {
updateView();
}
void TableView::setShowDeadline( bool b ) {
- owarn << "Show Deadline " << b << oendl;
if ( b )
showColumn( 3 );
@@ -283,5 +279,4 @@ void TableView::setShowDeadline( bool b ) {
}
void TableView::setShowCategory( const QString& str) {
- owarn << "setShowCategory" << oendl;
if ( str != m_oleCat || m_first )
updateView();
@@ -348,6 +343,4 @@ void TableView::slotPressed(int row, int col, int,
const QPoint& point) {
- owarn << "pressed row " << row << " col " << col << " x:" << point.x()
- << "+y:" << point.y() << oendl;
m_prevP = point;
/* TextColumn column */
@@ -356,5 +349,4 @@ void TableView::slotPressed(int row, int col, int,
}
void TableView::slotValueChanged( int, int ) {
- owarn << "Value Changed" << oendl;
}
void TableView::slotCurrentChanged(int, int ) {
@@ -372,5 +364,20 @@ 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 );
setAscending( asc );
@@ -495,5 +502,4 @@ 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 ) {
QWidget* wid = cellWidget(row, 1 );
@@ -531,5 +537,4 @@ void TableView::slotPriority() {
*/
void TableView::timerEvent( QTimerEvent* ) {
-// Opie::Core::owarn << "sorted " << sorted().count() << oendl;
if (sorted().count() == 0 )
return;
@@ -579,5 +584,4 @@ void TableView::contentsMouseReleaseEvent( QMouseEvent* e) {
int colOld = columnAt(m_prevP.x() );
int colNew = columnAt(e->x() );
- owarn << "colNew: " << colNew << " colOld: " << colOld << oendl;
if ( row == rowAt( e->y() ) && row != -1 &&
colOld != colNew ) {
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
@@ -38,8 +38,4 @@ TodoManager::TodoManager( QObject *obj )
: QObject( obj ) {
m_db = 0l;
- QTime time;
- time.start();
- int el = time.elapsed();
- owarn << "QTimer for loading " << el/1000 << oendl;
}
TodoManager::~TodoManager() {
@@ -50,5 +46,4 @@ OPimTodo TodoManager::event(int uid ) {
}
void TodoManager::updateList() {
- owarn << "update lists" << oendl;
m_list = m_db->allRecords();
}
@@ -60,5 +55,5 @@ 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 );
m_it = m_list.begin();