From 4ae0c208b66e0f7954e194384464fe2d0a2c56dd Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:51:49 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kbabel/filters/xliff/xliffexport.cpp | 64 ++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'kbabel/filters/xliff/xliffexport.cpp') diff --git a/kbabel/filters/xliff/xliffexport.cpp b/kbabel/filters/xliff/xliffexport.cpp index 53527f2c..9400b9c6 100644 --- a/kbabel/filters/xliff/xliffexport.cpp +++ b/kbabel/filters/xliff/xliffexport.cpp @@ -36,11 +36,11 @@ **************************************************************************** */ -#include -#include "qregexp.h" -#include -#include -#include +#include +#include "tqregexp.h" +#include +#include +#include #include @@ -53,25 +53,25 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_xliffexport, KGenericFactoryimportPluginID( ) != "XLIFF 1.1" ) return UNSUPPORTED_TYPE; - QFile file( filename ); + TQFile file( filename ); if ( !file.open( IO_WriteOnly ) ) return OS_ERROR; SaveSettings settings = catalog->saveSettings( ); // New DOM document. - QDomDocument doc( "" ); + TQDomDocument doc( "" ); extraData = catalog->catalogExtraData(); kdDebug () << "Setting the document data: " << extraData.first () << endl; @@ -79,20 +79,20 @@ ConversionStatus XLIFFExportPlugin::save( const QString& filename, const QString // Regular messages. for ( uint i = 0; i < catalog->numberOfEntries( ); i++ ) { - QDomElement element = extractComment( doc, *(extraData.at( i+1 )) ); + TQDomElement element = extractComment( doc, *(extraData.at( i+1 )) ); createMessage( doc, element, catalog->msgid( i ).join( "" ), catalog->msgstr( i ).join( "" ) ); } - QTextStream stream( &file ); + TQTextStream stream( &file ); doc.save( stream, 2 ); file.close( ); return OK; } -QDomElement XLIFFExportPlugin::extractComment( QDomDocument& doc, const QString& s ) +TQDomElement XLIFFExportPlugin::extractComment( TQDomDocument& doc, const TQString& s ) { - QString comment( s ); + TQString comment( s ); if ( comment.isEmpty () ) { @@ -100,27 +100,27 @@ QDomElement XLIFFExportPlugin::extractComment( QDomDocument& doc, const QString& } // Extract the context and the actual comment. - comment.remove( QRegExp( "^Context:[\\s]*" ) ); - QString newContext; - QStringList commentlines = QStringList::split ( '\n', comment); + comment.remove( TQRegExp( "^Context:[\\s]*" ) ); + TQString newContext; + TQStringList commentlines = TQStringList::split ( '\n', comment); - QString file = *(commentlines.at(0)); - QString id = *(commentlines.at(1)); + TQString file = *(commentlines.at(0)); + TQString id = *(commentlines.at(1)); kdDebug () << "Looking for file " << file << endl; return getContext( doc, file, id ); } -void XLIFFExportPlugin::createMessage( QDomDocument& doc, QDomElement& translationElement, const QString& msgid, - const QString& msgstr ) +void XLIFFExportPlugin::createMessage( TQDomDocument& doc, TQDomElement& translationElement, const TQString& msgid, + const TQString& msgstr ) { // for empty messages, don't store anything if (msgstr.isEmpty ()) return; // find the trans element - QDomNode node = translationElement.firstChild( ); + TQDomNode node = translationElement.firstChild( ); while ( !node.isNull( ) ) { kdDebug () << node.nodeName () << endl; if ( node.isElement() && node.toElement().tagName( ) == "target") { @@ -139,16 +139,16 @@ void XLIFFExportPlugin::createMessage( QDomDocument& doc, QDomElement& translati node = doc.createElement ("target"); translationElement.appendChild (node); - QDomText data = doc.createTextNode(msgstr ); + TQDomText data = doc.createTextNode(msgstr ); node.appendChild( data ); } } -QDomElement XLIFFExportPlugin::getContext( QDomDocument& doc, const QString& file, const QString& id ) +TQDomElement XLIFFExportPlugin::getContext( TQDomDocument& doc, const TQString& file, const TQString& id ) { - // Find out whether there is already such a context in the QDomDocument. - QDomNode parentelem = doc.documentElement(); - QDomNode elem = doc.documentElement( ).firstChild( ); + // Find out whether there is already such a context in the TQDomDocument. + TQDomNode parentelem = doc.documentElement(); + TQDomNode elem = doc.documentElement( ).firstChild( ); while ( !elem.isNull( ) ) { if ( elem.isElement( ) && elem.toElement().tagName( ) == "file" && elem.toElement().attribute ("original") == file ) { kdDebug () << "We have found the file" << endl; @@ -160,7 +160,7 @@ QDomElement XLIFFExportPlugin::getContext( QDomDocument& doc, const QString& fil if (elem.isNull ()) { kdError () << "File not found at all, creating" << endl; - QDomElement newelem = doc.createElement ("file"); + TQDomElement newelem = doc.createElement ("file"); newelem.setAttribute ("original", file); parentelem.appendChild (newelem); elem = newelem; @@ -180,7 +180,7 @@ QDomElement XLIFFExportPlugin::getContext( QDomDocument& doc, const QString& fil if (elem.isNull ()) { kdError () << "File body not found at all, creating" << endl; - QDomElement newelem = doc.createElement ("body"); + TQDomElement newelem = doc.createElement ("body"); parentelem.appendChild (newelem); elem = newelem; } @@ -190,7 +190,7 @@ QDomElement XLIFFExportPlugin::getContext( QDomDocument& doc, const QString& fil if (elem.isNull ()) { kdError () << "Trans-unit not found at all, creating" << endl; - QDomElement newelem = doc.createElement ("trans-unit"); + TQDomElement newelem = doc.createElement ("trans-unit"); newelem.setAttribute ("id", id); parentelem.appendChild (newelem); elem = newelem; @@ -199,16 +199,16 @@ QDomElement XLIFFExportPlugin::getContext( QDomDocument& doc, const QString& fil return elem.toElement (); } -QDomElement XLIFFExportPlugin::findTransUnit( QDomNode& group, const QString& id ) +TQDomElement XLIFFExportPlugin::findTransUnit( TQDomNode& group, const TQString& id ) { - QDomNode elem = group.firstChild( ); + TQDomNode elem = group.firstChild( ); // lookup correct trans-unit tag while ( !elem.isNull( ) ) { if ( elem.isElement( ) && elem.toElement().tagName() == "group" ) { // search recursively - QDomElement res = findTransUnit( elem, id ); + TQDomElement res = findTransUnit( elem, id ); if (! res.isNull () ) return res.toElement(); } -- cgit v1.2.1