summaryrefslogtreecommitdiff
path: root/noncore/apps/tableviewer/db
Side-by-side diff
Diffstat (limited to 'noncore/apps/tableviewer/db') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tableviewer/db/common.cpp40
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
@@ -17,17 +17,17 @@
** 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 */
@@ -305,19 +305,19 @@ void TVVariant::load(QDataStream &s )
}
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 ) {
@@ -385,17 +385,17 @@ const QString TVVariant::toString() const
// 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
{
@@ -679,19 +679,19 @@ bool TVVariant::close(TVVariant n)
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;
@@ -773,45 +773,45 @@ 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
@@ -1177,17 +1177,17 @@ void DataElem::setField(int i, QString q)
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();
@@ -1265,17 +1265,17 @@ 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;