diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
commit | 4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch) | |
tree | b0a7cd1c184f0003c0292eb416ed27f674f9cc43 /kbabel/kbabeldict/modules/dbsearchengine2/database.h | |
parent | 1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff) | |
download | tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/kbabeldict/modules/dbsearchengine2/database.h')
-rw-r--r-- | kbabel/kbabeldict/modules/dbsearchengine2/database.h | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/database.h b/kbabel/kbabeldict/modules/dbsearchengine2/database.h index c447fa59..d6ed3482 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/database.h +++ b/kbabel/kbabeldict/modules/dbsearchengine2/database.h @@ -8,11 +8,11 @@ #ifndef DATABASE_2_H #define DATABASE_2_H -#include <qstring.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluelist.h> #include <db4/db_cxx.h> -#include <qobject.h> -#include <qregexp.h> +#include <tqobject.h> +#include <tqregexp.h> #include "dbentries.h" @@ -43,7 +43,7 @@ public: class DataBase : Db { public: - DataBase(QString dbpath, QString dbname, QString dblang); + DataBase(TQString dbpath, TQString dbname, TQString dblang); int open(DBTYPE type,unsigned int flags=0); @@ -105,12 +105,12 @@ int get(DBItem * key,DBItem *data){ int close(unsigned int i) {return Db::close( i); } //For scrolling - // int getFirst(DBItem *key,DBItem *data,QString table); - // int getNext(DBItem *key,DBItem *data,QString table); - // bool isEnd(QString table); + // int getFirst(DBItem *key,DBItem *data,TQString table); + // int getNext(DBItem *key,DBItem *data,TQString table); + // bool isEnd(TQString table); private: - QString filename; - QString database; + TQString filename; + TQString database; DBTYPE mytype; }; @@ -122,26 +122,26 @@ class QueryResult //from DBInterface to KDBSearchEngine { public: QueryResult(); - QueryResult(QString r); - QueryResult(QString r,QString o,int s); - void setRichResult(QString r) { richr=r; } - void setRichOriginal(QString r) { richo=r; } + QueryResult(TQString r); + QueryResult(TQString r,TQString o,int s); + void setRichResult(TQString r) { richr=r; } + void setRichOriginal(TQString r) { richo=r; } - QString richResult() {return richr;} - QString richOriginal() {return richo;} + TQString richResult() {return richr;} + TQString richOriginal() {return richo;} - QString result(){ return res; } - QString original() {return orig; } + TQString result(){ return res; } + TQString original() {return orig; } int score() {return sco;} //info contains originalkey,catalog,date,author etc... ResultInfo info(){ResultInfo i; i.info="no info"; return i;} private: - QString res; - QString orig; - QString richr; - QString richo; + TQString res; + TQString orig; + TQString richr; + TQString richo; int sco; }; @@ -158,34 +158,34 @@ class DataBaseInterface : public QObject public: //move result list typedef to AbstractAlgorthm or somewhere else - typedef QValueList<QueryResult> ResultList; + typedef TQValueList<QueryResult> ResultList; typedef QPair<DBItemMainKey,DBItemMainData> MainEntry; - DataBaseInterface( QString dir, DBSESettings *sets); + DataBaseInterface( TQString dir, DBSESettings *sets); ~DataBaseInterface(); //Ask the Database to stop now. void stop(bool b=true) {_stopNow=b;} //Search words - ResultList wordsMatch(QString query,SearchFilter *filter=0,bool notify=true); + ResultList wordsMatch(TQString query,SearchFilter *filter=0,bool notify=true); //Edit database functions. //addEntry and sync all the tables - bool addEntry(QString original,QString translated,InputInfo *info); + bool addEntry(TQString original,TQString translated,InputInfo *info); //FIXME:implement me! - bool removeEntry(QString original); + bool removeEntry(TQString original); //FIXME: go persistent! - QMap<QString,float> correlation(QString word,SearchFilter *filter=0,bool notify=true,float minSign=0.2); + TQMap<TQString,float> correlation(TQString word,SearchFilter *filter=0,bool notify=true,float minSign=0.2); // Read the database - MainEntry get(const QString& query,SearchFilter *filter=0); + MainEntry get(const TQString& query,SearchFilter *filter=0); MainEntry getFromIndex(uint i); - DBItemMultiIndex::IndexList getAlpha(const QString& query); - DBItemMultiIndex::IndexList getWordIndex(const QString& query); - MainEntry getSentence(const QString& query); + DBItemMultiIndex::IndexList getAlpha(const TQString& query); + DBItemMultiIndex::IndexList getWordIndex(const TQString& query); + MainEntry getSentence(const TQString& query); //Database status check functions bool mainOk() {return main!=0;} @@ -206,7 +206,7 @@ class DataBaseInterface : public QObject DBSESettings *getSettings() {return settings;} private: - DataBase * openMyDataBase(const QString& prefix,const QString& name,const QString& l,DBTYPE tt); + DataBase * openMyDataBase(const TQString& prefix,const TQString& name,const TQString& l,DBTYPE tt); DataBase *main; DataBase *numindex; DataBase *wordsindex; @@ -222,14 +222,14 @@ class DataBaseInterface : public QObject //FIXME:Move to KBabel common library. public: - QString format( QString _s,QString t); - QString formatRegExp(QString _s, QString t, QString tre,QString stringSearch,QString stringReplace); - static QStringList words(QString s); - static QStringList sentences(QString s); - static QStringList sentencesSeparator(QString s); - static QString simple(QString str,bool ck=false); - static bool isUpper(QChar s); - static bool isLower(QChar s); + TQString format( TQString _s,TQString t); + TQString formatRegExp(TQString _s, TQString t, TQString tre,TQString stringSearch,TQString stringReplace); + static TQStringList words(TQString s); + static TQStringList sentences(TQString s); + static TQStringList sentencesSeparator(TQString s); + static TQString simple(TQString str,bool ck=false); + static bool isUpper(TQChar s); + static bool isLower(TQChar s); }; |