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 /poxml/po2xml.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 'poxml/po2xml.cpp')
-rw-r--r-- | poxml/po2xml.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/poxml/po2xml.cpp b/poxml/po2xml.cpp index 9e8bc1a5..c30a340f 100644 --- a/poxml/po2xml.cpp +++ b/poxml/po2xml.cpp @@ -4,7 +4,7 @@ #include <stdlib.h> #include <iostream> #include <assert.h> -#include <qregexp.h> +#include <tqregexp.h> #include <fstream> #include "GettextLexer.hpp" @@ -14,9 +14,9 @@ using namespace std; -QString translate(QString xml, QString orig, QString translation) +TQString translate(TQString xml, TQString orig, TQString translation) { - QString prefix; + TQString prefix; while (xml.at(0) == '<' && orig.at(0) != '<') { // a XML tag as prefix int index = xml.find('>'); @@ -59,12 +59,12 @@ int main( int argc, char **argv ) return 1; } - QMap<QString, QString> translations; + TQMap<TQString, TQString> translations; for (MsgList::ConstIterator it = translated.begin(); it != translated.end(); ++it) { - QString msgstr; - QString msgid = escapePO((*it).msgid); + TQString msgstr; + TQString msgid = escapePO((*it).msgid); if ((*it).comment.find("fuzzy") < 0) msgstr = escapePO((*it).msgstr); @@ -74,17 +74,17 @@ int main( int argc, char **argv ) translations.insert(msgid, msgstr); } - QFile xml(argv[1]); + TQFile xml(argv[1]); xml.open(IO_ReadOnly); - QTextStream ds(&xml); - ds.setEncoding(QTextStream::UnicodeUTF8); - QString xml_text = ds.read(); + TQTextStream ds(&xml); + ds.setEncoding(TQTextStream::UnicodeUTF8); + TQString xml_text = ds.read(); xml.close(); - QString output; - QTextStream ts(&output, IO_WriteOnly); + TQString output; + TQTextStream ts(&output, IO_WriteOnly); StructureParser::cleanupTags(xml_text); - QValueList<int> line_offsets; + TQValueList<int> line_offsets; line_offsets.append(0); int index = 0; while (true) { @@ -95,7 +95,7 @@ int main( int argc, char **argv ) } int old_start_line = -1, old_start_col = -1; - QString old_text; + TQString old_text; MsgList::Iterator old_it = english.end(); for (MsgList::Iterator it = english.begin(); @@ -134,7 +134,7 @@ int main( int argc, char **argv ) continue; int end_pos = line_offsets[bi.end_line - 1] + bi.end_col - 1; - QString xml = xml_text.mid(start_pos, end_pos - start_pos); + TQString xml = xml_text.mid(start_pos, end_pos - start_pos); int index = 0; while (true) { index = xml.find("<!--"); @@ -152,7 +152,7 @@ int main( int argc, char **argv ) } StructureParser::descape(xml); - QString descaped = StructureParser::descapeLiterals((*it).msgid); + TQString descaped = StructureParser::descapeLiterals((*it).msgid); if (translations.contains(descaped)) descaped = translations[descaped]; @@ -170,7 +170,7 @@ int main( int argc, char **argv ) index++; while ((*it).msgid.at(index) == ' ') index++; - QString omsgid = (*it).msgid; + TQString omsgid = (*it).msgid; (*it).msgid = (*it).msgid.mid(index); index = (*it).msgid.length() - 1; @@ -236,14 +236,14 @@ int main( int argc, char **argv ) ts << xml_text.mid(old_pos); - output.replace(QRegExp("<trans_comment\\s*>"), ""); - output.replace(QRegExp("</trans_comment\\s*>"), ""); + output.replace(TQRegExp("<trans_comment\\s*>"), ""); + output.replace(TQRegExp("</trans_comment\\s*>"), ""); StructureParser::removeEmptyTags(output); index = 0; while (true) { - index = output.find(QRegExp(">[^\n]"), index ); + index = output.find(TQRegExp(">[^\n]"), index ); if ( index == -1 ) break; if ( output.at( index - 1 ) == '/' || output.at( index - 1 ) == '-' || |