From: <ibr...@us...> - 2013-12-12 20:24:49
|
Revision: 4983 http://sourceforge.net/p/tora/code/4983 Author: ibre5041 Date: 2013-12-12 20:24:45 +0000 (Thu, 12 Dec 2013) Log Message: ----------- do not commit rows one-by-one Modified Paths: -------------- trunk/tora/src/result/toresulttabledata.cpp Modified: trunk/tora/src/result/toresulttabledata.cpp =================================================================== --- trunk/tora/src/result/toresulttabledata.cpp 2013-12-12 08:15:31 UTC (rev 4982) +++ trunk/tora/src/result/toresulttabledata.cpp 2013-12-12 20:24:45 UTC (rev 4983) @@ -243,8 +243,8 @@ return; QModelIndex current = Edit->selectionModel()->currentIndex(); - int row = current.row(); - int col = current.column(); + int row = current.isValid() ? current.row() : 0; + int col = current.isValid() ? current.column() : 0; if (col < 1) col = 1; // can't select hidden first column @@ -252,19 +252,14 @@ if (action == firstAct) row = 0; else if (action == previousAct) - row--; + row = (std::max)(--row, 0); else if (action == nextAct) - row++; + row = (std::min)(++row, Edit->model()->rowCount() - 1); else if (action == lastAct) row = Edit->model()->rowCount() - 1; else return; // not a nav action - if (row < 0) - row = 0; - if (row >= Edit->model()->rowCount()) - row = Edit->model()->rowCount() - 1; - QModelIndex left = Edit->model()->createIndex(row, col); Edit->selectionModel()->select(QItemSelection(left, left), QItemSelectionModel::ClearAndSelect); @@ -454,6 +449,7 @@ if (!error) { + conn->commit(); ProgressBar->setValue(Changes.size()); Changes.clear(); } @@ -581,7 +577,6 @@ conn->rollback(); return 0; } - conn->commit(); return q.rowsProcessed(); } } @@ -646,9 +641,6 @@ // TODO use event query toQuery q(conn, sql, toQueryParams()); q.eof(); - //TODO add commit button - //if (toConfigurationSingle::Instance().autoCommit()) - conn->commit(); return q.rowsProcessed(); } } @@ -687,7 +679,6 @@ conn->rollback(); return 0; } - conn->commit(); return q.rowsProcessed(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |