diff options
Diffstat (limited to 'kbabel/common/catalogitem.cpp')
-rw-r--r-- | kbabel/common/catalogitem.cpp | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/kbabel/common/catalogitem.cpp b/kbabel/common/catalogitem.cpp index ced02e8c..bd55d7b6 100644 --- a/kbabel/common/catalogitem.cpp +++ b/kbabel/common/catalogitem.cpp @@ -40,9 +40,9 @@ #include "regexpextractor.h" -#include <qtextstream.h> -#include <qtextcodec.h> -#include <qdom.h> +#include <tqtextstream.h> +#include <tqtextcodec.h> +#include <tqdom.h> using namespace KBabel; @@ -65,16 +65,16 @@ CatalogItem::~CatalogItem() delete d; } -QString CatalogItem::comment() const +TQString CatalogItem::comment() const { return d->_comment; } -QString CatalogItem::msgctxt(const bool noNewlines) const +TQString CatalogItem::msgctxt(const bool noNewlines) const { if( noNewlines ) { - QString tmp = d->_msgctxt; + TQString tmp = d->_msgctxt; tmp.replace("\n", " "); // ### TODO: " " or "" ? return tmp; } @@ -82,9 +82,9 @@ QString CatalogItem::msgctxt(const bool noNewlines) const return d->_msgctxt; } -QStringList CatalogItem::msgid(const bool noNewlines) const +TQStringList CatalogItem::msgid(const bool noNewlines) const { - QStringList result=d->_msgid; + TQStringList result=d->_msgid; if( noNewlines ) { result.gres( "\n", "" ); @@ -92,9 +92,9 @@ QStringList CatalogItem::msgid(const bool noNewlines) const return result; } -QStringList CatalogItem::msgstr(const bool noNewlines) const +TQStringList CatalogItem::msgstr(const bool noNewlines) const { - QStringList result=d->_msgstr; + TQStringList result=d->_msgstr; if( noNewlines ) { result.gres( "\n", "" ); @@ -102,12 +102,12 @@ QStringList CatalogItem::msgstr(const bool noNewlines) const return result; } -QStringList CatalogItem::msgstrAsList(int nr) const +TQStringList CatalogItem::msgstrAsList(int nr) const { - QString str; + TQString str; if(d->_gettextPluralForm && nr > 0) { - QStringList::ConstIterator it = d->_msgstr.at(nr); + TQStringList::ConstIterator it = d->_msgstr.at(nr); if(it != d->_msgstr.end()) { str = *it; @@ -123,7 +123,7 @@ QStringList CatalogItem::msgstrAsList(int nr) const str = d->_msgstr.first(); } - QStringList list=QStringList::split("\n",str); + TQStringList list=TQStringList::split("\n",str); if(str.left(1)=="\n") list.prepend(""); @@ -139,32 +139,32 @@ bool CatalogItem::isValid() const return d->_valid; } -void CatalogItem::setMsgctxt(QString msg) +void CatalogItem::setMsgctxt(TQString msg) { d->_msgctxt=msg; } -void CatalogItem::setMsgid(QString msg) +void CatalogItem::setMsgid(TQString msg) { d->_msgid=msg; } -void CatalogItem::setMsgid(QStringList msg) +void CatalogItem::setMsgid(TQStringList msg) { d->_msgid=msg; } -void CatalogItem::setMsgstr(QString msg) +void CatalogItem::setMsgstr(TQString msg) { d->_msgstr=msg; } -void CatalogItem::setMsgstr(QStringList msg) +void CatalogItem::setMsgstr(TQStringList msg) { d->_msgstr=msg; } -void CatalogItem::setComment(QString com) +void CatalogItem::setComment(TQString com) { d->_comment=com; } @@ -174,31 +174,31 @@ void CatalogItem::setGettextPluralForm( bool _gettextPlural ) d->_gettextPluralForm = _gettextPlural; } -QStringList CatalogItem::errors() const +TQStringList CatalogItem::errors() const { return d->_errors; } -QStringList CatalogItem::tagList( RegExpExtractor& te) +TQStringList CatalogItem::tagList( RegExpExtractor& te) { if(!d->_haveTagList) { // FIXME: should care about plural forms in msgid te.setString(msgid(true).first()); - d->_tagList = QStringList(te.matches()); + d->_tagList = TQStringList(te.matches()); d->_haveTagList = true; } return d->_tagList; } -QStringList CatalogItem::argList( RegExpExtractor& te) +TQStringList CatalogItem::argList( RegExpExtractor& te) { if(!d->_haveArgList) { // FIXME: should care about plural forms in msgid te.setString(msgid(true).first()); - d->_argList = QStringList(te.matches()); + d->_argList = TQStringList(te.matches()); } return d->_argList; @@ -207,29 +207,29 @@ QStringList CatalogItem::argList( RegExpExtractor& te) bool CatalogItem::isFuzzy() const { - return d->_comment.find( QRegExp(",\\s*fuzzy") ) != -1; + return d->_comment.find( TQRegExp(",\\s*fuzzy") ) != -1; } bool CatalogItem::isCformat() const { // Allow "possible-c-format" (from xgettext --debug) or "c-format" // Note the regexp (?: ) is similar to () but it does not capture (so it is faster) - return d->_comment.find( QRegExp(",\\s*(?:possible-)c-format") ) == -1; + return d->_comment.find( TQRegExp(",\\s*(?:possible-)c-format") ) == -1; } bool CatalogItem::isNoCformat() const { - return d->_comment.find( QRegExp(",\\s*no-c-format") ) == -1; + return d->_comment.find( TQRegExp(",\\s*no-c-format") ) == -1; } bool CatalogItem::isQtformat() const { - return d->_comment.find( QRegExp(",\\s*qt-format") ) == -1; + return d->_comment.find( TQRegExp(",\\s*qt-format") ) == -1; } bool CatalogItem::isNoQtformat() const { - return d->_comment.find( QRegExp(",\\s*no-qt-format") ) == -1; + return d->_comment.find( TQRegExp(",\\s*no-qt-format") ) == -1; } bool CatalogItem::isUntranslated() const @@ -260,7 +260,7 @@ int CatalogItem::totalLines() const msgctxtLines=d->_msgctxt.contains('\n')+1; } int msgidLines=0; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for(it=d->_msgid.begin(); it != d->_msgid.end(); ++it) { msgidLines += (*it).contains('\n')+1; @@ -292,17 +292,17 @@ void CatalogItem::setSyntaxError(bool on) d->_errors.remove("syntax error"); } -QPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) +TQPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) { - QPtrList<EditCommand> editList; + TQPtrList<EditCommand> editList; editList.setAutoDelete(false); - QString comment=d->_comment; + TQString comment=d->_comment; if(isFuzzy()) { EditCommand *cmd; - QRegExp fuzzyStr(",\\s*fuzzy"); + TQRegExp fuzzyStr(",\\s*fuzzy"); int offset; offset=comment.find(fuzzyStr); @@ -318,7 +318,7 @@ QPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) } // remove empty comment lines - if( comment.contains( QRegExp("^#\\s*$") )) + if( comment.contains( TQRegExp("^#\\s*$") )) { cmd = new DelTextCmd(0,comment,0); cmd->setPart(Comment); @@ -326,9 +326,9 @@ QPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) comment=""; } - if( comment.contains( QRegExp("\n#\\s*$") )) + if( comment.contains( TQRegExp("\n#\\s*$") )) { - offset=comment.find( QRegExp("\n#\\s*$") ); + offset=comment.find( TQRegExp("\n#\\s*$") ); while(offset>=0) { cmd = new DelTextCmd(offset,comment.mid(offset),0); @@ -337,12 +337,12 @@ QPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) comment.remove(offset,comment.length()-offset); - offset=comment.find( QRegExp("\n#\\s*$"), offset+1 ); + offset=comment.find( TQRegExp("\n#\\s*$"), offset+1 ); } } - if( comment.contains( QRegExp("\n#\\s*\n") )) + if( comment.contains( TQRegExp("\n#\\s*\n") )) { - offset=comment.find( QRegExp("\n#\\s*\n") )+1; + offset=comment.find( TQRegExp("\n#\\s*\n") )+1; while(offset>=0) { int endIndex=comment.find("\n",offset)+1; @@ -353,7 +353,7 @@ QPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) comment.remove(offset,endIndex-offset); - offset=comment.find( QRegExp("\n#\\s*\n"), offset+1 ); + offset=comment.find( TQRegExp("\n#\\s*\n"), offset+1 ); } } @@ -367,9 +367,9 @@ QPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) -QPtrList<EditCommand> CatalogItem::addFuzzy(bool doIt) +TQPtrList<EditCommand> CatalogItem::addFuzzy(bool doIt) { - QPtrList<EditCommand> editList; + TQPtrList<EditCommand> editList; editList.setAutoDelete(false); @@ -378,7 +378,7 @@ QPtrList<EditCommand> CatalogItem::addFuzzy(bool doIt) EditCommand *cmd; int offset=d->_comment.length(); - QString addStr; + TQString addStr; if(offset > 0 && d->_comment[offset-1] != '\n') { addStr='\n'; @@ -487,7 +487,7 @@ void CatalogItem::operator=(const CatalogItem& rhs) d->_gettextPluralForm = rhs.d->_gettextPluralForm; } -QString CatalogItem::nextError() const +TQString CatalogItem::nextError() const { return d->_errors.first(); } @@ -497,13 +497,13 @@ void CatalogItem::clearErrors() d->_errors.clear(); } -void CatalogItem::appendError(const QString& error ) +void CatalogItem::appendError(const TQString& error ) { if( !d->_errors.contains( error ) ) d->_errors.append(error); } -void CatalogItem::removeError(const QString& error ) +void CatalogItem::removeError(const TQString& error ) { d->_errors.remove(error); } |