author | zecke <zecke> | 2002-11-02 13:47:01 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-11-02 13:47:01 (UTC) |
commit | d21d693d91af8ee8fb54478a6db67f5a0590a767 (patch) (side-by-side diff) | |
tree | b38c34f39d70d056fb99cdd35515e2308b06c74a /core/pim/todo/tableview.cpp | |
parent | f655415f77b200f9edfbe5732cd5f8da2b4dec47 (diff) | |
download | opie-d21d693d91af8ee8fb54478a6db67f5a0590a767.zip opie-d21d693d91af8ee8fb54478a6db67f5a0590a767.tar.gz opie-d21d693d91af8ee8fb54478a6db67f5a0590a767.tar.bz2 |
Cut some warning
and applied trekres customStrokeWidth patch
-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 @@ -23,30 +23,39 @@ If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 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" using namespace Todo; namespace { static const int BoxSize = 14; 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 ); m_enablePaint = false; setNumRows(0); @@ -93,12 +102,15 @@ TableView::TableView( MainWindow* window, QWidget* wid ) setUpdatesEnabled( true ); viewport()->setUpdatesEnabled( true ); viewport()->update(); setSortOrder( 0 ); setAscending( TRUE ); m_first = true; + + /* now let's init the config */ + initConfig(); } /* a new day has started * update the day */ void TableView::newDay() { clear(); @@ -485,13 +497,13 @@ void TableView::timerEvent( QTimerEvent* ev ) { * if the distance between the two points is greater than * 8 we mark the underlying todo as completed and do a repaint */ 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 ); updateView(); return; |