summaryrefslogtreecommitdiffstats
path: root/kabc/plugins/evolution/dbwrapper.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
commitffe8a83e053396df448e9413828527613ca3bd46 (patch)
treea73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kabc/plugins/evolution/dbwrapper.cpp
parent682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff)
downloadtdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz
tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kabc/plugins/evolution/dbwrapper.cpp')
-rw-r--r--kabc/plugins/evolution/dbwrapper.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/kabc/plugins/evolution/dbwrapper.cpp b/kabc/plugins/evolution/dbwrapper.cpp
index cc566344c..bcc641191 100644
--- a/kabc/plugins/evolution/dbwrapper.cpp
+++ b/kabc/plugins/evolution/dbwrapper.cpp
@@ -1,6 +1,6 @@
#include <db.h>
-#include <qfile.h>
+#include <tqfile.h>
#include "dbwrapper.h"
@@ -9,8 +9,8 @@ using namespace Evolution;
struct DBIterator::Data {
DBWrapper *wrapper;
- QString key;
- QString data;
+ TQString key;
+ TQString data;
DBC* cursor;
bool atEnd;
};
@@ -55,13 +55,13 @@ DBIterator& DBIterator::operator=( const DBIterator& rhs ) {
return *this;
}
-QString DBIterator::key()const{
+TQString DBIterator::key()const{
return data->key;
}
-QString DBIterator::value()const {
+TQString DBIterator::value()const {
return data->data;
}
-QString DBIterator::operator*() {
+TQString DBIterator::operator*() {
return data->data;
}
DBIterator& DBIterator::operator++() {
@@ -71,8 +71,8 @@ DBIterator& DBIterator::operator++() {
if ( data->cursor )
if ( data->cursor->c_get(data->cursor, &key, &val,DB_NEXT ) != 0 )
data->atEnd = true;
- data->key = QString::fromUtf8( (char*)key.data, key.size );
- data->data = QString::fromUtf8( (char*)val.data, val.size );
+ data->key = TQString::fromUtf8( (char*)key.data, key.size );
+ data->data = TQString::fromUtf8( (char*)val.data, val.size );
return *this;
}
DBIterator& DBIterator::operator--() {
@@ -82,8 +82,8 @@ DBIterator& DBIterator::operator--() {
if ( data->cursor )
if ( data->cursor->c_get(data->cursor, &key, &val,DB_PREV ) != 0 )
data->atEnd = true;
- data->key = QString::fromUtf8( (char*)key.data, key.size );
- data->data = QString::fromUtf8( (char*)val.data, val.size );
+ data->key = TQString::fromUtf8( (char*)key.data, key.size );
+ data->data = TQString::fromUtf8( (char*)val.data, val.size );
return *this;
}
bool DBIterator::operator==( const DBIterator& rhs ) {
@@ -107,9 +107,9 @@ DBWrapper::~DBWrapper() {
data->db->close(data->db, 0 );
delete data;
}
-bool DBWrapper::open( const QString& file, bool on) {
+bool DBWrapper::open( const TQString& file, bool on) {
data->only = on;
- return !data->db->open(data->db, QFile::encodeName( file ), NULL, DB_HASH, 0, 0666 );
+ return !data->db->open(data->db, TQFile::encodeName( file ), NULL, DB_HASH, 0, 0666 );
}
bool DBWrapper::save() {
return true;
@@ -134,8 +134,8 @@ DBIterator DBWrapper::begin() {
}
it.data->cursor = cursor;
- it.data->key = QString::fromUtf8((char*)key.data, key.size );
- it.data->data = QString::fromUtf8((char*)val.data, val.size );
+ it.data->key = TQString::fromUtf8((char*)key.data, key.size );
+ it.data->data = TQString::fromUtf8((char*)val.data, val.size );
return it;
}
@@ -145,26 +145,26 @@ DBIterator DBWrapper::end() {
return it;
}
-bool DBWrapper::find( const QString& _key, QString& _val ) {
+bool DBWrapper::find( const TQString& _key, TQString& _val ) {
DBT key, val;
::memset(&key, 0, sizeof(key) );
::memset(&val, 0, sizeof(val) );
- QCString db_key = _key.local8Bit();
+ TQCString db_key = _key.local8Bit();
key.data = db_key.data();
key.size = db_key.size();
int ret = data->db->get(data->db, NULL, &key, &val, 0 );
if (!ret) {
- _val = QString::fromUtf8( (char*)val.data, val.size );
+ _val = TQString::fromUtf8( (char*)val.data, val.size );
qWarning("key: %s val: %sXXX", (char*)key.data, (char*)val.data );
return true;
}
return false;
}
-bool DBWrapper::add( const QString& _key, const QString& _val ) {
- QCString db_key = _key.local8Bit();
- QCString db_val = _val.local8Bit();
+bool DBWrapper::add( const TQString& _key, const TQString& _val ) {
+ TQCString db_key = _key.local8Bit();
+ TQCString db_val = _val.local8Bit();
DBT key, val;
::memset(&key, 0, sizeof(key) );
::memset(&val, 0, sizeof(val) );
@@ -176,8 +176,8 @@ bool DBWrapper::add( const QString& _key, const QString& _val ) {
return !data->db->put(data->db, NULL, &key, &val, 0 );
}
-bool DBWrapper::remove( const QString& _key ) {
- QCString db_key = _key.local8Bit();
+bool DBWrapper::remove( const TQString& _key ) {
+ TQCString db_key = _key.local8Bit();
DBT key;
memset(&key, 0, sizeof(key) );
key.data = db_key.data();