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/tmx/tmxcompendiumdata.cpp | |
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/tmx/tmxcompendiumdata.cpp')
-rw-r--r-- | kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp b/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp index 3fa84aa4..7893e837 100644 --- a/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp +++ b/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp @@ -34,8 +34,8 @@ **************************************************************************** */ #include "tmxcompendiumdata.h" -#include <qdom.h> -#include <qfile.h> +#include <tqdom.h> +#include <tqfile.h> #include <tagextractor.h> #include <resources.h> @@ -47,8 +47,8 @@ using namespace KBabel; -TmxCompendiumData::TmxCompendiumData(QObject *parent) - : QObject(parent) +TmxCompendiumData::TmxCompendiumData(TQObject *parent) + : TQObject(parent) , _active(false) , _error(false) , _initialized(false) @@ -62,7 +62,7 @@ TmxCompendiumData::TmxCompendiumData(QObject *parent) } -bool TmxCompendiumData::load(const KURL& url, const QString& language) +bool TmxCompendiumData::load(const KURL& url, const TQString& language) { kdDebug(KBABEL_SEARCH) << "Load " << url.url() << " in " << language << endl; if(_active) @@ -79,13 +79,13 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) emit progressStarts(i18n("Loading TMX compendium")); - QDomDocument doc( "mydocument" ); + TQDomDocument doc( "mydocument" ); - QString target; + TQString target; if( KIO::NetAccess::download( url, target ) ) { - QFile f( target ); + TQFile f( target ); if ( !f.open( IO_ReadOnly ) ) { _error = true; @@ -102,7 +102,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) _errorMsg = i18n( "Cannot open the file." ); } - QDomElement docElem = doc.documentElement(); + TQDomElement docElem = doc.documentElement(); if( docElem.tagName() != "tmx" || !(docElem.hasAttribute("version") && docElem.attribute("version") == "1.4" ) ) @@ -131,7 +131,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) emit progressStarts(i18n("Building indices")); - QDomNodeList tuTags = docElem.elementsByTagName("tu"); + TQDomNodeList tuTags = docElem.elementsByTagName("tu"); uint total = tuTags.count(); _originals.clear(); @@ -149,11 +149,11 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) kapp->processEvents(100); } - QDomNodeList tuvTags = tuTags.item(i).toElement().elementsByTagName("tuv"); - QString english, other; + TQDomNodeList tuvTags = tuTags.item(i).toElement().elementsByTagName("tuv"); + TQString english, other; for( uint j = 0 ; j < tuvTags.count() ; j++ ) { - QDomElement el = tuvTags.item(j).toElement(); + TQDomElement el = tuvTags.item(j).toElement(); if( el.attribute("xml:lang").upper() == "EN" ) english = el.text(); if( el.attribute("xml:lang").upper().startsWith(language.upper()) ) other = el.text(); @@ -165,7 +165,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) _originals[lastindex] = english; _translations[lastindex] = other; - QString temp = english; + TQString temp = english; int *index = new int(lastindex); _exactDict.insert(temp,index); @@ -175,18 +175,18 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) if(!temp.isEmpty() && temp.length() > 1) { - QValueList<int> *indexList=_allDict[temp]; + TQValueList<int> *indexList=_allDict[temp]; if(!indexList) { - indexList = new QValueList<int>; + indexList = new TQValueList<int>; _allDict.insert(temp,indexList); } indexList->append(lastindex); - QStringList wList = wordList(temp); - for ( QStringList::Iterator it = wList.begin() + TQStringList wList = wordList(temp); + for ( TQStringList::Iterator it = wList.begin() ; it != wList.end(); ++it ) { if( (*it).length() > 1) @@ -195,7 +195,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) if(!indexList) { - indexList = new QValueList<int>; + indexList = new TQValueList<int>; _wordDict.insert(*it,indexList); } @@ -210,7 +210,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) // remove words, that are too frequent uint max=_allDict.count()/10; - QDictIterator< QValueList<int> > it(_wordDict); + TQDictIterator< TQValueList<int> > it(_wordDict); while ( it.current() ) { if(it.current()->count() > max) @@ -240,39 +240,39 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) return true; } -const int* TmxCompendiumData::exactDict(const QString& text) const +const int* TmxCompendiumData::exactDict(const TQString& text) const { return _exactDict[text]; } -const QValueList<int>* TmxCompendiumData::allDict(const QString& text) const +const TQValueList<int>* TmxCompendiumData::allDict(const TQString& text) const { return _allDict[text]; } -const QValueList<int>* TmxCompendiumData::wordDict(const QString& text) const +const TQValueList<int>* TmxCompendiumData::wordDict(const TQString& text) const { return _wordDict[text]; } -const QString TmxCompendiumData::msgid(const int index) const +const TQString TmxCompendiumData::msgid(const int index) const { return _originals[index]; } -const QString TmxCompendiumData::msgstr(const int index) const +const TQString TmxCompendiumData::msgstr(const int index) const { return _translations[index]; } -void TmxCompendiumData::registerObject(QObject *obj) +void TmxCompendiumData::registerObject(TQObject *obj) { if(!_registered.containsRef(obj)) _registered.append(obj); } -bool TmxCompendiumData::unregisterObject(QObject *obj) +bool TmxCompendiumData::unregisterObject(TQObject *obj) { _registered.removeRef(obj); @@ -284,9 +284,9 @@ bool TmxCompendiumData::hasObjects() const return _registered.count()==0; } -QString TmxCompendiumData::simplify(const QString& string) +TQString TmxCompendiumData::simplify(const TQString& string) { - QString result; + TQString result; TagExtractor te; te.setString(string); @@ -298,11 +298,11 @@ QString TmxCompendiumData::simplify(const QString& string) return result; } -QStringList TmxCompendiumData::wordList(const QString& string) +TQStringList TmxCompendiumData::wordList(const TQString& string) { - QString result=TmxCompendiumData::simplify(string); + TQString result=TmxCompendiumData::simplify(string); - return QStringList::split(' ',result); + return TQStringList::split(' ',result); } #include "tmxcompendiumdata.moc" |