summaryrefslogtreecommitdiff
path: root/core/pim/todo/tableview.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/todo/tableview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/tableview.cpp14
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
@@ -25,14 +25,17 @@
Boston, MA 02111-1307, USA.
*/
#include <stdlib.h>
+#include <cmath>
#include <qlineedit.h>
#include <qtimer.h>
#include <qpoint.h>
#include <qpopupmenu.h>
+#include <qpe/config.h>
+
#include "mainwindow.h"
//#include "tableitems.h"
#include "tableview.h"
@@ -43,8 +46,14 @@ namespace {
static const int RowHeight = 20;
}
+void TableView::initConfig() {
+ Config config( "todo" );
+ config.setGroup( "Options" );
+ m_completeStrokeWidth = config.readNumEntry( "CompleteStrokeWidth", 8 );
+}
+
TableView::TableView( MainWindow* window, QWidget* wid )
: QTable( wid ), TodoView( window ) {
setUpdatesEnabled( false );
viewport()->setUpdatesEnabled( false );
@@ -95,8 +104,11 @@ TableView::TableView( MainWindow* window, QWidget* wid )
viewport()->update();
setSortOrder( 0 );
setAscending( TRUE );
m_first = true;
+
+ /* now let's init the config */
+ initConfig();
}
/* a new day has started
* update the day
*/
@@ -487,9 +499,9 @@ void TableView::timerEvent( QTimerEvent* ev ) {
*/
void TableView::contentsMouseReleaseEvent( QMouseEvent* e) {
int row = rowAt(m_prevP.y());
if ( row == rowAt( e->y() ) && row != -1 ) {
- if ( abs( m_prevP.x() - e->x() ) >= 8 ) {
+ if ( ::abs( m_prevP.x() - e->x() ) >= m_completeStrokeWidth ) {
qWarning("current row %d", row );
OTodo todo = sorted()[row];
todo.setCompleted( !todo.isCompleted() );
TodoView::update( todo.uid(), todo );