-rw-r--r-- | core/pim/todo/tableview.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp index 6299113..743deb7 100644 --- a/core/pim/todo/tableview.cpp +++ b/core/pim/todo/tableview.cpp | |||
@@ -26,12 +26,15 @@ | |||
26 | 26 | ||
27 | */ | 27 | */ |
28 | #include <stdlib.h> | 28 | #include <stdlib.h> |
29 | #include <cmath> | ||
29 | 30 | ||
30 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
31 | #include <qtimer.h> | 32 | #include <qtimer.h> |
32 | #include <qpoint.h> | 33 | #include <qpoint.h> |
33 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
34 | 35 | ||
36 | #include <qpe/config.h> | ||
37 | |||
35 | #include "mainwindow.h" | 38 | #include "mainwindow.h" |
36 | //#include "tableitems.h" | 39 | //#include "tableitems.h" |
37 | #include "tableview.h" | 40 | #include "tableview.h" |
@@ -44,6 +47,12 @@ namespace { | |||
44 | } | 47 | } |
45 | 48 | ||
46 | 49 | ||
50 | void TableView::initConfig() { | ||
51 | Config config( "todo" ); | ||
52 | config.setGroup( "Options" ); | ||
53 | m_completeStrokeWidth = config.readNumEntry( "CompleteStrokeWidth", 8 ); | ||
54 | } | ||
55 | |||
47 | TableView::TableView( MainWindow* window, QWidget* wid ) | 56 | TableView::TableView( MainWindow* window, QWidget* wid ) |
48 | : QTable( wid ), TodoView( window ) { | 57 | : QTable( wid ), TodoView( window ) { |
49 | setUpdatesEnabled( false ); | 58 | setUpdatesEnabled( false ); |
@@ -96,6 +105,9 @@ TableView::TableView( MainWindow* window, QWidget* wid ) | |||
96 | setSortOrder( 0 ); | 105 | setSortOrder( 0 ); |
97 | setAscending( TRUE ); | 106 | setAscending( TRUE ); |
98 | m_first = true; | 107 | m_first = true; |
108 | |||
109 | /* now let's init the config */ | ||
110 | initConfig(); | ||
99 | } | 111 | } |
100 | /* a new day has started | 112 | /* a new day has started |
101 | * update the day | 113 | * update the day |
@@ -488,7 +500,7 @@ void TableView::timerEvent( QTimerEvent* ev ) { | |||
488 | void TableView::contentsMouseReleaseEvent( QMouseEvent* e) { | 500 | void TableView::contentsMouseReleaseEvent( QMouseEvent* e) { |
489 | int row = rowAt(m_prevP.y()); | 501 | int row = rowAt(m_prevP.y()); |
490 | if ( row == rowAt( e->y() ) && row != -1 ) { | 502 | if ( row == rowAt( e->y() ) && row != -1 ) { |
491 | if ( abs( m_prevP.x() - e->x() ) >= 8 ) { | 503 | if ( ::abs( m_prevP.x() - e->x() ) >= m_completeStrokeWidth ) { |
492 | qWarning("current row %d", row ); | 504 | qWarning("current row %d", row ); |
493 | OTodo todo = sorted()[row]; | 505 | OTodo todo = sorted()[row]; |
494 | todo.setCompleted( !todo.isCompleted() ); | 506 | todo.setCompleted( !todo.isCompleted() ); |