summaryrefslogtreecommitdiff
path: root/noncore/apps/tableviewer
authormickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
committer mickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
commit16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff)
tree0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/apps/tableviewer
parent8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff)
downloadopie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/apps/tableviewer') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tableviewer/db/common.cpp28
-rw-r--r--noncore/apps/tableviewer/db/datacache.cpp12
-rw-r--r--noncore/apps/tableviewer/db/xmlsource.cpp30
-rw-r--r--noncore/apps/tableviewer/tableviewer.cpp14
-rw-r--r--noncore/apps/tableviewer/tableviewer.pro8
-rw-r--r--noncore/apps/tableviewer/ui/tvlistview.cpp9
6 files changed, 66 insertions, 35 deletions
diff --git a/noncore/apps/tableviewer/db/common.cpp b/noncore/apps/tableviewer/db/common.cpp
index dbf9370..6e544ba 100644
--- a/noncore/apps/tableviewer/db/common.cpp
+++ b/noncore/apps/tableviewer/db/common.cpp
@@ -14,21 +14,29 @@
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include <stdlib.h> 20#include "common.h"
21#include "datacache.h"
22
23/* OPIE */
24#include <opie2/odebug.h>
25#include <qpe/timestring.h>
26using namespace Opie::Core;
27
28/* QT */
21#include <qstring.h> 29#include <qstring.h>
22#include <qheader.h> 30#include <qheader.h>
23#include <qvector.h> 31#include <qvector.h>
24#include <qdatetime.h> 32#include <qdatetime.h>
25#include <qpe/timestring.h> 33
26#include "common.h" 34/* STD */
27#include "datacache.h"
28#include <assert.h> 35#include <assert.h>
36#include <stdlib.h>
29 37
30static const int del_flag = 0x1; 38static const int del_flag = 0x1;
31static const int new_flag = 0x2; 39static const int new_flag = 0x2;
32 40
33/* Helper function */ 41/* Helper function */
34 42
@@ -309,13 +317,13 @@ void TVVariant::load(QDataStream &s )
309 int x; 317 int x;
310 s >> x; 318 s >> x;
311 d->value.i = x; 319 d->value.i = x;
312 } 320 }
313 break; 321 break;
314 default: 322 default:
315 qFatal("Unrecognized data type"); 323 ofatal << "Unrecognized data type" << oendl;
316 } 324 }
317} 325}
318 326
319void TVVariant::save( QDataStream &s ) const 327void TVVariant::save( QDataStream &s ) const
320{ 328{
321 s << type(); 329 s << type();
@@ -1075,13 +1083,13 @@ QDataStream &operator>>( QDataStream &s, DataElem &d)
1075 int size; 1083 int size;
1076 TVVariant t; 1084 TVVariant t;
1077 int index = 0; 1085 int index = 0;
1078 1086
1079 s >> size; /* redundent data but makes streaming easier */ 1087 s >> size; /* redundent data but makes streaming easier */
1080 if (size != d.getNumFields()) { 1088 if (size != d.getNumFields()) {
1081 qWarning("DataSize mis-match"); 1089 owarn << "DataSize mis-match" << oendl;
1082 return s; /* sanity check failed.. don't load */ 1090 return s; /* sanity check failed.. don't load */
1083 } 1091 }
1084 1092
1085 for(i = 0; i < size; i++) { 1093 for(i = 0; i < size; i++) {
1086 s >> (Q_UINT16)index; 1094 s >> (Q_UINT16)index;
1087 s >> t; 1095 s >> t;
@@ -1374,13 +1382,13 @@ bool DataElem::contains(int i, TVVariant v) const
1374 /* meaningless for dates */ 1382 /* meaningless for dates */
1375 case TVVariant::Int: 1383 case TVVariant::Int:
1376 case TVVariant::Time: 1384 case TVVariant::Time:
1377 case TVVariant::Date: 1385 case TVVariant::Date:
1378 break; 1386 break;
1379 default: 1387 default:
1380 qWarning("Tried to compare unknown data type"); 1388 owarn << "Tried to compare unknown data type" << oendl;
1381 } 1389 }
1382 return FALSE; 1390 return FALSE;
1383} 1391}
1384 1392
1385bool DataElem::startsWith(int i, TVVariant v) const 1393bool DataElem::startsWith(int i, TVVariant v) const
1386{ 1394{
@@ -1400,13 +1408,13 @@ bool DataElem::startsWith(int i, TVVariant v) const
1400 /* meaningless for dates */ 1408 /* meaningless for dates */
1401 case TVVariant::Int: 1409 case TVVariant::Int:
1402 case TVVariant::Time: 1410 case TVVariant::Time:
1403 case TVVariant::Date: 1411 case TVVariant::Date:
1404 return FALSE; 1412 return FALSE;
1405 default: 1413 default:
1406 qWarning("Tried to compare unknown data type"); 1414 owarn << "Tried to compare unknown data type" << oendl;
1407 } 1415 }
1408 return FALSE; 1416 return FALSE;
1409} 1417}
1410 1418
1411bool DataElem::endsWith(int i, TVVariant v) const 1419bool DataElem::endsWith(int i, TVVariant v) const
1412{ 1420{
@@ -1426,13 +1434,13 @@ bool DataElem::endsWith(int i, TVVariant v) const
1426 /* meaningless for dates */ 1434 /* meaningless for dates */
1427 case TVVariant::Int: 1435 case TVVariant::Int:
1428 case TVVariant::Time: 1436 case TVVariant::Time:
1429 case TVVariant::Date: 1437 case TVVariant::Date:
1430 return FALSE; 1438 return FALSE;
1431 default: 1439 default:
1432 qWarning("Tried to compare unknown data type"); 1440 owarn << "Tried to compare unknown data type" << oendl;
1433 } 1441 }
1434 return FALSE; 1442 return FALSE;
1435} 1443}
1436 1444
1437/*! 1445/*!
1438 Determins which of the first to parameters are closer to the third, target 1446 Determins which of the first to parameters are closer to the third, target
@@ -1458,13 +1466,13 @@ bool DataElem::closer(DataElem*d1, DataElem *d2, TVVariant target, int column)
1458 1466
1459 type = d1->getField(column).type(); 1467 type = d1->getField(column).type();
1460 1468
1461 if(d2) { 1469 if(d2) {
1462 if (type != d2->getField(column).type()) { 1470 if (type != d2->getField(column).type()) {
1463 /* can't do compare */ 1471 /* can't do compare */
1464 qWarning("Tried to compare two incompatable types"); 1472 owarn << "Tried to compare two incompatable types" << oendl;
1465 return FALSE; 1473 return FALSE;
1466 } 1474 }
1467 return target.closer(d1->getField(column), d2->getField(column)); 1475 return target.closer(d1->getField(column), d2->getField(column));
1468 } 1476 }
1469 return target.close(d1->getField(column)); 1477 return target.close(d1->getField(column));
1470} 1478}
diff --git a/noncore/apps/tableviewer/db/datacache.cpp b/noncore/apps/tableviewer/db/datacache.cpp
index 7c14eef..6380e1b 100644
--- a/noncore/apps/tableviewer/db/datacache.cpp
+++ b/noncore/apps/tableviewer/db/datacache.cpp
@@ -23,15 +23,23 @@
23 * otherwise any other data headings are allowed. 23 * otherwise any other data headings are allowed.
24 */ 24 */
25 25
26#include "datacache.h" 26#include "datacache.h"
27#include "xmlsource.h" 27#include "xmlsource.h"
28#include "csvsource.h" 28#include "csvsource.h"
29#include <stdlib.h> 29
30/* OPIE */
31#include <opie2/odebug.h>
32using namespace Opie::Core;
33
34/* QT */
30#include <qheader.h> 35#include <qheader.h>
31 36
37/* STD */
38#include <stdlib.h>
39
32#define INIT_TABLE_SIZE 128 40#define INIT_TABLE_SIZE 128
33 41
34/*! 42/*!
35 \class DBStore datastore.h 43 \class DBStore datastore.h
36 44
37 \brief The DBStore class is the class responsible for storing, sorting and 45 \brief The DBStore class is the class responsible for storing, sorting and
@@ -147,13 +155,13 @@ void DBStore::addItem(DataElem *delem)
147} 155}
148 156
149void DBStore::addItemInternal(DataElem *delem) 157void DBStore::addItemInternal(DataElem *delem)
150{ 158{
151 /* if already full, don't over fill, do a qWarning though */ 159 /* if already full, don't over fill, do a qWarning though */
152 if (full) { 160 if (full) {
153 qWarning("Attempted to add items to already full table"); 161 owarn << "Attempted to add items to already full table" << oendl;
154 return; 162 return;
155 } 163 }
156 164
157 master_table.insert(number_elems, delem); 165 master_table.insert(number_elems, delem);
158 166
159 current_elem = number_elems; 167 current_elem = number_elems;
diff --git a/noncore/apps/tableviewer/db/xmlsource.cpp b/noncore/apps/tableviewer/db/xmlsource.cpp
index 94fec36..4ca6aee 100644
--- a/noncore/apps/tableviewer/db/xmlsource.cpp
+++ b/noncore/apps/tableviewer/db/xmlsource.cpp
@@ -15,18 +15,24 @@
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "xmlsource.h" 20#include "xmlsource.h"
21#include <qdict.h>
22#include <stdlib.h>
23#include <qtextstream.h>
24#include "../xmlencodeattr.h" 21#include "../xmlencodeattr.h"
25 22
23/* OPIE */
24#include <opie2/odebug.h>
25using namespace Opie::Core;
26 26
27/* QT */
28#include <qdict.h>
29#include <qtextstream.h>
30
31/* STD */
32#include <stdlib.h>
27 33
28DBXml::DBXml(DBStore *d) 34DBXml::DBXml(DBStore *d)
29{ 35{
30 dstore = d; 36 dstore = d;
31} 37}
32 38
@@ -137,13 +143,13 @@ DBXmlHandler::DBXmlHandler(DBStore *ds)
137DBXmlHandler::~DBXmlHandler() 143DBXmlHandler::~DBXmlHandler()
138{ 144{
139} 145}
140 146
141QString DBXmlHandler::errorProtocol() 147QString DBXmlHandler::errorProtocol()
142{ 148{
143 qWarning("Error reading file"); 149 owarn << "Error reading file" << oendl;
144 return errorProt; 150 return errorProt;
145} 151}
146 152
147bool DBXmlHandler::startDocument() 153bool DBXmlHandler::startDocument()
148{ 154{
149 errorProt = ""; 155 errorProt = "";
@@ -169,13 +175,13 @@ bool DBXmlHandler::startElement(const QString&, const QString&,
169 if (state == StateHeader && qName == "key") { 175 if (state == StateHeader && qName == "key") {
170 /* Ok, adding a new key to our KeyList TODO */ 176 /* Ok, adding a new key to our KeyList TODO */
171 state = StateKey; 177 state = StateKey;
172 last_key_type = TVVariant::String; 178 last_key_type = TVVariant::String;
173 key = atts.value("name"); 179 key = atts.value("name");
174 if (key.isEmpty()) { 180 if (key.isEmpty()) {
175 qWarning("empty key name"); 181 owarn << "empty key name" << oendl;
176 return FALSE; 182 return FALSE;
177 } 183 }
178 if(!atts.value("type").isEmpty()) 184 if(!atts.value("type").isEmpty())
179 last_key_type = TVVariant::nameToType(atts.value("type")); 185 last_key_type = TVVariant::nameToType(atts.value("type"));
180 return TRUE; 186 return TRUE;
181 } 187 }
@@ -187,19 +193,19 @@ bool DBXmlHandler::startElement(const QString&, const QString&,
187 } 193 }
188 if (state == StateRecord) { 194 if (state == StateRecord) {
189 state = StateField; 195 state = StateField;
190 /* the qName is the name of a key */ 196 /* the qName is the name of a key */
191 if (!keyIndexList[qName]) { 197 if (!keyIndexList[qName]) {
192 /* invalid key, we failed */ 198 /* invalid key, we failed */
193 qWarning("Invalid key in record"); 199 owarn << "Invalid key in record" << oendl;
194 return FALSE; 200 return FALSE;
195 } 201 }
196 keyIndex = *keyIndexList[qName]; 202 keyIndex = *keyIndexList[qName];
197 return TRUE; 203 return TRUE;
198 } 204 }
199 qWarning("Unable to determine tag type"); 205 owarn << "Unable to determine tag type" << oendl;
200 return FALSE; 206 return FALSE;
201} 207}
202 208
203bool DBXmlHandler::endElement(const QString&, const QString&, 209bool DBXmlHandler::endElement(const QString&, const QString&,
204 const QString& qName) 210 const QString& qName)
205{ 211{
@@ -222,13 +228,13 @@ bool DBXmlHandler::endElement(const QString&, const QString&,
222 break; 228 break;
223 case StateDocument: 229 case StateDocument:
224 // we are done... 230 // we are done...
225 break; 231 break;
226 default: 232 default:
227 // should only get a 'endElement' from one of the above states. 233 // should only get a 'endElement' from one of the above states.
228 qWarning("Invalid end tag"); 234 owarn << "Invalid end tag" << oendl;
229 return FALSE; 235 return FALSE;
230 break; 236 break;
231 } 237 }
232 return TRUE; 238 return TRUE;
233} 239}
234 240
@@ -251,13 +257,13 @@ bool DBXmlHandler::characters(const QString& ch)
251 if (state == StateField) { 257 if (state == StateField) {
252 /* Ok, need to add data here */ 258 /* Ok, need to add data here */
253 current_data->setField(keyIndex, ch_simplified); 259 current_data->setField(keyIndex, ch_simplified);
254 return TRUE; 260 return TRUE;
255 } 261 }
256 262
257 qWarning("Junk characters found... ignored"); 263 owarn << "Junk characters found... ignored" << oendl;
258 return TRUE; 264 return TRUE;
259} 265}
260 266
261QString DBXmlHandler::errorString() 267QString DBXmlHandler::errorString()
262{ 268{
263 return "the document is not in the expected file format"; 269 return "the document is not in the expected file format";
@@ -267,31 +273,31 @@ bool DBXmlHandler::warning(const QXmlParseException& exception)
267{ 273{
268 errorProt += QString("warning parsing error: %1 in line %2, column %3\n" ) 274 errorProt += QString("warning parsing error: %1 in line %2, column %3\n" )
269 .arg(exception.message()) 275 .arg(exception.message())
270 .arg(exception.lineNumber()) 276 .arg(exception.lineNumber())
271 .arg(exception.columnNumber()); 277 .arg(exception.columnNumber());
272 278
273 qWarning(errorProt); 279 owarn << errorProt << oendl;
274 return QXmlDefaultHandler::fatalError(exception); 280 return QXmlDefaultHandler::fatalError(exception);
275} 281}
276 282
277bool DBXmlHandler::error(const QXmlParseException& exception) 283bool DBXmlHandler::error(const QXmlParseException& exception)
278{ 284{
279 errorProt += QString("error parsing error: %1 in line %2, column %3\n" ) 285 errorProt += QString("error parsing error: %1 in line %2, column %3\n" )
280 .arg(exception.message()) 286 .arg(exception.message())
281 .arg(exception.lineNumber()) 287 .arg(exception.lineNumber())
282 .arg(exception.columnNumber()); 288 .arg(exception.columnNumber());
283 289
284 qWarning(errorProt); 290 owarn << errorProt << oendl;
285 return QXmlDefaultHandler::fatalError(exception); 291 return QXmlDefaultHandler::fatalError(exception);
286} 292}
287 293
288bool DBXmlHandler::fatalError(const QXmlParseException& exception) 294bool DBXmlHandler::fatalError(const QXmlParseException& exception)
289{ 295{
290 errorProt += QString("fatal parsing error: %1 in line %2, column %3\n" ) 296 errorProt += QString("fatal parsing error: %1 in line %2, column %3\n" )
291 .arg(exception.message()) 297 .arg(exception.message())
292 .arg(exception.lineNumber()) 298 .arg(exception.lineNumber())
293 .arg(exception.columnNumber()); 299 .arg(exception.columnNumber());
294 300
295 qWarning(errorProt); 301 owarn << errorProt << oendl;
296 return QXmlDefaultHandler::fatalError(exception); 302 return QXmlDefaultHandler::fatalError(exception);
297} 303}
diff --git a/noncore/apps/tableviewer/tableviewer.cpp b/noncore/apps/tableviewer/tableviewer.cpp
index 102b94c..9538cb3 100644
--- a/noncore/apps/tableviewer/tableviewer.cpp
+++ b/noncore/apps/tableviewer/tableviewer.cpp
@@ -15,33 +15,35 @@
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21/* local includes */
22#include "tableviewer.h" 21#include "tableviewer.h"
23#include "ui/tvbrowseview.h" 22#include "ui/tvbrowseview.h"
24#include "ui/tvfilterview.h" 23#include "ui/tvfilterview.h"
25#include "ui/tvlistview.h" 24#include "ui/tvlistview.h"
26#include "ui/tveditview.h" 25#include "ui/tveditview.h"
27#include "ui/tvkeyedit.h" 26#include "ui/tvkeyedit.h"
28#include "db/datacache.h" 27#include "db/datacache.h"
29 28
30/* QPE includes */ 29/* OPIE */
30#include <opie2/odebug.h>
31#include <qpe/fileselector.h> 31#include <qpe/fileselector.h>
32#include <qpe/resource.h> 32#include <qpe/resource.h>
33#include <qtoolbar.h> 33using namespace Opie::Core;
34 34
35/* QTE includes */ 35/* QT */
36#include <qmenubar.h> 36#include <qmenubar.h>
37#include <qtoolbar.h>
37#include <qpopupmenu.h> 38#include <qpopupmenu.h>
38#include <qapplication.h> 39#include <qapplication.h>
39#include <qwidgetstack.h> 40#include <qwidgetstack.h>
40#include <qlayout.h> 41#include <qlayout.h>
41#include <qbuffer.h> 42#include <qbuffer.h>
43
42/*! 44/*!
43 \class TableViewerWindow 45 \class TableViewerWindow
44 \brief The main window widget of the application 46 \brief The main window widget of the application
45 47
46 This is the main widget of the table viewer application. 48 This is the main widget of the table viewer application.
47 It is the co-ordination point. 49 It is the co-ordination point.
@@ -198,13 +200,13 @@ void TableViewerWindow::saveDocument()
198 return; 200 return;
199 201
200 FileManager fm; 202 FileManager fm;
201 QIODevice *dev = fm.saveFile(doc); 203 QIODevice *dev = fm.saveFile(doc);
202 204
203 if(!ds->saveSource(dev, doc.type())){ 205 if(!ds->saveSource(dev, doc.type())){
204 qWarning("Save unsuccessful"); 206 owarn << "Save unsuccessful" << oendl;
205 return; 207 return;
206 } 208 }
207 dev->close(); 209 dev->close();
208 dirty = FALSE; 210 dirty = FALSE;
209} 211}
210 212
@@ -285,13 +287,13 @@ void TableViewerWindow::openDocument(const DocLnk &f)
285 scratch += " - "; 287 scratch += " - ";
286 scratch += ds->getName(); 288 scratch += ds->getName();
287 setCaption(tr(scratch)); 289 setCaption(tr(scratch));
288 290
289 dirty = FALSE; 291 dirty = FALSE;
290 } else { 292 } else {
291 qWarning(tr("could not load Document")); 293 owarn << tr("could not load Document") << oendl;
292 } 294 }
293 dev->close(); 295 dev->close();
294} 296}
295 297
296/*! 298/*!
297 Moves to the first item of the current table 299 Moves to the first item of the current table
diff --git a/noncore/apps/tableviewer/tableviewer.pro b/noncore/apps/tableviewer/tableviewer.pro
index 1de23bb..564f50f 100644
--- a/noncore/apps/tableviewer/tableviewer.pro
+++ b/noncore/apps/tableviewer/tableviewer.pro
@@ -1,7 +1,7 @@
1 CONFIG = qt warn_on quick-app 1 CONFIG = qt warn_on quick-app
2 SUBDIRS = db ui 2 SUBDIRS = db ui
3 HEADERS = tableviewer.h \ 3 HEADERS = tableviewer.h \
4 xmlencodeattr.h \ 4 xmlencodeattr.h \
5 ui/commonwidgets.h \ 5 ui/commonwidgets.h \
6 ui/tvbrowseview.h \ 6 ui/tvbrowseview.h \
7 ui/tvlistview.h \ 7 ui/tvlistview.h \
@@ -28,11 +28,11 @@ SOURCES = main.cpp \
28 db/datacache.cpp \ 28 db/datacache.cpp \
29 db/xmlsource.cpp \ 29 db/xmlsource.cpp \
30 db/csvsource.cpp \ 30 db/csvsource.cpp \
31 db/common.cpp 31 db/common.cpp
32 INTERFACES= ui/tvkeyedit_gen.ui 32 INTERFACES= ui/tvkeyedit_gen.ui
33 TARGET = tableviewer 33 TARGET = tableviewer
34INCLUDEPATH += $(OPIEDIR)/include 34 INCLUDEPATH+= $(OPIEDIR)/include
35DEPENDPATH += $(OPIEDIR)/include 35 DEPENDPATH+= $(OPIEDIR)/include
36 LIBS += -lqpe -lopiecore2 36 LIBS += -lqpe -lopiecore2
37 37
38include ( $(OPIEDIR)/include.pro ) 38include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/apps/tableviewer/ui/tvlistview.cpp b/noncore/apps/tableviewer/ui/tvlistview.cpp
index b10ff1d..c3e6432 100644
--- a/noncore/apps/tableviewer/ui/tvlistview.cpp
+++ b/noncore/apps/tableviewer/ui/tvlistview.cpp
@@ -14,14 +14,21 @@
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20
20#include "tvlistview.h" 21#include "tvlistview.h"
21#include "../db/common.h" 22#include "../db/common.h"
23
24/* OPIE */
25#include <opie2/odebug.h>
26using namespace Opie::Core;
27
28/* QT */
22#include <qtoolbutton.h> 29#include <qtoolbutton.h>
23#include <qlistview.h> 30#include <qlistview.h>
24#include <qlayout.h> 31#include <qlayout.h>
25 32
26void TVListViewPrivate::setColumnWidth(int column, int width) 33void TVListViewPrivate::setColumnWidth(int column, int width)
27{ 34{
@@ -160,13 +167,13 @@ void TVListView::first()
160 delete it; 167 delete it;
161 it = new QListViewItemIterator(listViewDisplay); 168 it = new QListViewItemIterator(listViewDisplay);
162} 169}
163 170
164void TVListView::last() 171void TVListView::last()
165{ 172{
166 qWarning("TVListView::last not yet implemented"); 173 owarn << "TVListView::last not yet implemented" << oendl;
167} 174}
168 175
169void TVListView::next() 176void TVListView::next()
170{ 177{
171 QListViewItemIterator tmp = *it; 178 QListViewItemIterator tmp = *it;
172 (*it)++; 179 (*it)++;