Diffstat (limited to 'noncore/apps/tableviewer/db/common.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tableviewer/db/common.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/noncore/apps/tableviewer/db/common.cpp b/noncore/apps/tableviewer/db/common.cpp index 4c70e54..71844a5 100644 --- a/noncore/apps/tableviewer/db/common.cpp +++ b/noncore/apps/tableviewer/db/common.cpp @@ -13,25 +13,25 @@ ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <stdlib.h> #include <qstring.h> #include <qheader.h> #include <qvector.h> #include <qdatetime.h> -#include <timestring.h> +#include <qpe/timestring.h> #include "common.h" #include "datacache.h" #include <assert.h> static const int del_flag = 0x1; static const int new_flag = 0x2; /* Helper function */ int parseNextNumber(QString *q) { QChar c; uint i; @@ -301,27 +301,27 @@ void TVVariant::load(QDataStream &s ) { QDate *x = new QDate; s >> *x; d->value.ptr = x; } break; case Int: { int x; s >> x; d->value.i = x; } - break; + break; default: - qFatal("Unrecognized data type"); + qFatal("Unrecognized data type"); } } void TVVariant::save( QDataStream &s ) const { s << type(); switch( d->typ ) { case String: s << *((QString *)d->value.ptr); break; case Date: @@ -381,25 +381,25 @@ const QString TVVariant::toString() const return QString::null; } return QString::null; } // TODO DO, this properly, */ int TVVariant::toInt() const { if(d->typ == Int) return d->value.i; if(d->typ == String) { - QString tmpq(*(QString *)d->value.ptr); + QString tmpq(*(QString *)d->value.ptr); return parseNextNumber(&tmpq); } return 0; } const QDate TVVariant::toDate() const { if(d->typ == Date) return *((QDate *)d->value.ptr); if(d->typ == String) { @@ -675,27 +675,27 @@ bool TVVariant::close(TVVariant n) \brief document me! document me! */ Key::Key() : kname(), kexample(), kflags(0) { } Key::Key(QString name, TVVariant example, int flags = 0) : kname(name), kexample(example), kflags(flags) { } Key::Key(const Key &other) { - kname = other.kname; - kexample = other.kexample; - kflags = other.kflags; + kname = other.kname; + kexample = other.kexample; + kflags = other.kflags; } Key& Key::operator=(const Key& key) { kname = key.kname; kexample = key.kexample; kflags = key.kflags; return *this; } QString Key::name() const { @@ -769,53 +769,53 @@ void Key::setNewFlag(bool v) /*! Constructs a KeyList */ KeyList::KeyList() : QIntDict<Key>(20) { setAutoDelete(TRUE); } /* Should be deep copy, but isn't */ KeyList::KeyList(const KeyList &k) : QIntDict<Key>(k) { KeyListIterator it(k); - while(it.current()) { - replace(it.currentKey(), new Key(*it.current())); - ++it; - } + while(it.current()) { + replace(it.currentKey(), new Key(*it.current())); + ++it; + } setAutoDelete(TRUE); } /*! Destroys a KeyList */ KeyList::~KeyList() { } /* Do a comparision base on Keys */ bool KeyList::operator!=(const KeyList &other) { KeyListIterator it(*this); if (other.getNumFields() != getNumFields()) - return TRUE; + return TRUE; while(it.current()) { - //it.currentKey(), it.current(); - if (other.getKeyName(it.currentKey()) != getKeyName(it.currentKey())) - return TRUE; - if (other.getKeyType(it.currentKey()) != getKeyType(it.currentKey())) - return TRUE; - ++it; + //it.currentKey(), it.current(); + if (other.getKeyName(it.currentKey()) != getKeyName(it.currentKey())) + return TRUE; + if (other.getKeyType(it.currentKey()) != getKeyType(it.currentKey())) + return TRUE; + ++it; } return FALSE; } /*! Returns the number of keys stored in the KeyList */ int KeyList::getNumFields() const { return count(); } @@ -1173,25 +1173,25 @@ TVVariant DataElem::getField(QString qs) const */ void DataElem::setField(int i, QString q) { /* from the type of the field, parse q and store */ TVVariant::KeyType kt = contained->getKeyType(i); TVVariant t = TVVariant(q); switch(kt) { case TVVariant::Int: { t.asInt(); setField(i, t); - return; + return; } case TVVariant::String: { t.asString(); setField(i, t); return; } case TVVariant::Date: { t.asDate(); setField(i, t); return; } case TVVariant::Time: { @@ -1261,25 +1261,25 @@ void DataElem::unsetField(QString qs) /*! Converts the data element to a Rich Text QString */ QString DataElem::toQString() const { /* lets make an attempt at this function */ int i; QString scratch = ""; QIntDictIterator<TVVariant> it(values); while (it.current()) { - i = it.currentKey(); + i = it.currentKey(); if(hasValidValue(i)) { scratch += "<B>" + contained->getKeyName(i) + ":</B> "; scratch += getField(i).toString(); scratch += "<br>"; } ++it; } return scratch; } /*! formats individual fields to strings so can be displayed */ QString DataElem::toQString(int i) const |