diff options
Diffstat (limited to 'klinkstatus/src/utils/xsl.cpp')
-rw-r--r-- | klinkstatus/src/utils/xsl.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/klinkstatus/src/utils/xsl.cpp b/klinkstatus/src/utils/xsl.cpp index 27f61cb8..320f14cd 100644 --- a/klinkstatus/src/utils/xsl.cpp +++ b/klinkstatus/src/utils/xsl.cpp @@ -51,7 +51,7 @@ * The thread class that actually performs the XSL processing. * Using a thread allows async operation. */ -class KopeteXSLThread : public TQObject, public QThread +class KopeteXSLThread : public TQObject, public TQThread { public: /** @@ -106,7 +106,7 @@ void KopeteXSLThread::run() m_resultString = xsltTransform( m_xml, m_xsl ); dataMutex.unlock(); // get back to the main thread - qApp->postEvent( this, new TQEvent( TQEvent::User ) ); + tqApp->postEvent( this, new TQEvent( TQEvent::User ) ); } bool KopeteXSLThread::event( TQEvent *event ) @@ -141,7 +141,7 @@ TQString KopeteXSLThread::xsltTransform( const TQString &xmlString, xsltStyleshe { if ( styleSheet ) { - static TQCString appPath( TQString::fromLatin1("\"%1\"").arg( KApplication::kApplication()->dirs()->findDirs("appdata", TQString::fromLatin1("styles/data") ).front() ).utf8() ); + static TQCString appPath( TQString::tqfromLatin1("\"%1\"").tqarg( KApplication::kApplication()->dirs()->findDirs("appdata", TQString::tqfromLatin1("styles/data") ).front() ).utf8() ); static const char* params[3] = { "appdata", @@ -152,7 +152,7 @@ TQString KopeteXSLThread::xsltTransform( const TQString &xmlString, xsltStyleshe xmlDocPtr resultDoc = xsltApplyStylesheet( styleSheet, xmlDoc, params ); if ( resultDoc ) { - // Save the result into the QString + // Save the result into the TQString xmlChar *mem; int size; xmlDocDumpMemory( resultDoc, &mem, &size ); @@ -179,7 +179,7 @@ TQString KopeteXSLThread::xsltTransform( const TQString &xmlString, xsltStyleshe if ( resultString.isEmpty() ) { - resultString = i18n( "<div><b>KLinkStatus encountered the following error while parsing a message:</b><br />%1</div>" ).arg( errorMsg ); + resultString = i18n( "<div><b>KLinktqStatus encountered the following error while parsing a message:</b><br />%1</div>" ).tqarg( errorMsg ); } #ifdef RAWXSL @@ -196,8 +196,8 @@ public: unsigned int flags; }; -XSLT::XSLT( const TQString &document, TQObject *parent ) - : TQObject( parent ), d(new XSLTPrivate) +XSLT::XSLT( const TQString &document, TQObject *tqparent ) + : TQObject( tqparent ), d(new XSLTPrivate) { d->flags = 0; d->xslDoc = 0; @@ -228,14 +228,14 @@ void XSLT::setXSLT( const TQString &_document ) // depend on the strings in the current styles. If these strings change // they may break the parsing here. // - // The reason I'm doing it like this is because of issues with QDOM and - // namespaces in earlier Qt versions. When we drop Qt 3.1.x support we + // The reason I'm doing it like this is because of issues with TQDOM and + // namespaces in earlier TQt versions. When we drop TQt 3.1.x support we // should probably convert this to more accurate DOM code. - Martijn // // Actually, since we need to parse into a libxml2 document anyway, this whole // nonsense could be replaced with some simple XPath expressions - JK // - TQRegExp elementMatch( TQString::fromLatin1( "<kopete-i18n>(.*)</kopete-i18n>" ) ); + TQRegExp elementMatch( TQString::tqfromLatin1( "<kopete-i18n>(.*)</kopete-i18n>" ) ); elementMatch.setMinimal( true ); TQString document = _document; int pos; @@ -261,21 +261,21 @@ void XSLT::setXSLT( const TQString &_document ) { prependPercent = false; - if ( *it == TQString::fromLatin1( "TIME" ) ) + if ( *it == TQString::tqfromLatin1( "TIME" ) ) { - trans += TQString::fromLatin1( "<xsl:value-of select=\"@time\"/>" ); + trans += TQString::tqfromLatin1( "<xsl:value-of select=\"@time\"/>" ); } - else if ( *it == TQString::fromLatin1( "TIMESTAMP" ) ) + else if ( *it == TQString::tqfromLatin1( "TIMESTAMP" ) ) { - trans += TQString::fromLatin1( "<xsl:value-of select=\"@timestamp\"/>" ); + trans += TQString::tqfromLatin1( "<xsl:value-of select=\"@timestamp\"/>" ); } - else if ( *it == TQString::fromLatin1( "FORMATTEDTIMESTAMP" ) ) + else if ( *it == TQString::tqfromLatin1( "FORMATTEDTIMESTAMP" ) ) { - trans += TQString::fromLatin1( "<xsl:value-of select=\"@formattedTimestamp\"/>" ); + trans += TQString::tqfromLatin1( "<xsl:value-of select=\"@formattedTimestamp\"/>" ); } - else if ( *it == TQString::fromLatin1( "FROM_CONTACT_DISPLAYNAME" ) ) + else if ( *it == TQString::tqfromLatin1( "FROM_CONTACT_DISPLAYNAME" ) ) { - trans += TQString::fromLatin1( "<span><xsl:attribute name=\"title\">" + trans += TQString::tqfromLatin1( "<span><xsl:attribute name=\"title\">" "<xsl:choose>" "<xsl:when test='from/contact/@contactId=from/contact/contactDisplayName/@text'>" "<xsl:value-of disable-output-escaping=\"yes\" select=\"from/contact/metaContactDisplayName/@text\"/>" @@ -290,9 +290,9 @@ void XSLT::setXSLT( const TQString &_document ) "</xsl:attribute>" "<xsl:value-of disable-output-escaping=\"yes\" select=\"from/contact/contactDisplayName/@text\"/></span>" ); } - else if ( *it == TQString::fromLatin1( "TO_CONTACT_DISPLAYNAME" ) ) + else if ( *it == TQString::tqfromLatin1( "TO_CONTACT_DISPLAYNAME" ) ) { - trans += TQString::fromLatin1( "<span><xsl:attribute name=\"title\">" + trans += TQString::tqfromLatin1( "<span><xsl:attribute name=\"title\">" "<xsl:choose>" "<xsl:when test='to/contact/@contactId=from/contact/contactDisplayName/@text'>" "<xsl:value-of disable-output-escaping=\"yes\" select=\"to/contact/metaContactDisplayName/@text\"/>" @@ -307,37 +307,37 @@ void XSLT::setXSLT( const TQString &_document ) "</xsl:attribute>" "<xsl:value-of disable-output-escaping=\"yes\" select=\"to/contact/contactDisplayName/@text\"/></span>" ); } - else if ( *it == TQString::fromLatin1( "FROM_METACONTACT_DISPLAYNAME" ) ) + else if ( *it == TQString::tqfromLatin1( "FROM_METACONTACT_DISPLAYNAME" ) ) { - trans += TQString::fromLatin1( "<span>" + trans += TQString::tqfromLatin1( "<span>" "<xsl:attribute name=\"dir\">" "<xsl:value-of select=\"from/contact/metaContactDisplayName/@dir\"/>" "</xsl:attribute>" "<xsl:value-of disable-output-escaping=\"yes\" select=\"from/contact/metaContactDisplayName/@text\"/></span>" ); } - else if ( *it == TQString::fromLatin1( "TO_METACONTACT_DISPLAYNAME" ) ) + else if ( *it == TQString::tqfromLatin1( "TO_METACONTACT_DISPLAYNAME" ) ) { - trans += TQString::fromLatin1( "<span>" + trans += TQString::tqfromLatin1( "<span>" "<xsl:attribute name=\"dir\">" "<xsl:value-of select=\"to/contact/metaContactDisplayName/@dir\"/>" "</xsl:attribute>" "<xsl:value-of disable-output-escaping=\"yes\" select=\"to/contact/metaContactDisplayName/@text\"/></span>" ); } - else if ( *it == TQString::fromLatin1( "FROM_CONTACT_ID" ) ) + else if ( *it == TQString::tqfromLatin1( "FROM_CONTACT_ID" ) ) { - trans += TQString::fromLatin1( "<span><xsl:attribute name=\"title\">" + trans += TQString::tqfromLatin1( "<span><xsl:attribute name=\"title\">" "<xsl:value-of disable-output-escaping=\"yes\" select=\"from/contact/contactDisplayName/@text\"/></xsl:attribute>" "<xsl:value-of disable-output-escaping=\"yes\" select=\"from/contact/@contactId\"/></span>" ); } - else if ( *it == TQString::fromLatin1( "TO_CONTACT_ID" ) ) + else if ( *it == TQString::tqfromLatin1( "TO_CONTACT_ID" ) ) { - trans += TQString::fromLatin1( "<span><xsl:attribute name=\"title\">" + trans += TQString::tqfromLatin1( "<span><xsl:attribute name=\"title\">" "<xsl:value-of disable-output-escaping=\"yes\" select=\"to/contact/contactDisplayName/@text\"/></xsl:attribute>" "<xsl:value-of disable-output-escaping=\"yes\" select=\"to/contact/@contactId\"/></span>" ); } - else if ( *it == TQString::fromLatin1( "BODY" ) ) + else if ( *it == TQString::tqfromLatin1( "BODY" ) ) { - trans += TQString::fromLatin1( "<xsl:value-of disable-output-escaping=\"yes\" select=\"body\"/>" ); + trans += TQString::tqfromLatin1( "<xsl:value-of disable-output-escaping=\"yes\" select=\"body\"/>" ); } else { @@ -349,7 +349,7 @@ void XSLT::setXSLT( const TQString &_document ) } //kdDebug( 14010 ) << k_funcinfo << "Translated text: " << trans << endl; // Add "<kopete-i18n>" and "</kopete-i18n>" to length, hence the '+ 27' - document.replace( uint( pos ), orig.length() + 27, trans ); + document.tqreplace( uint( pos ), orig.length() + 27, trans ); } #ifdef RAWXSL @@ -379,7 +379,7 @@ void XSLT::setXSLT( const TQString &_document ) //We have a flag. Enable it; TQCString flagData( (const char*)child->content ); - if( flagData.contains( "Flag:" ) ) + if( flagData.tqcontains( "Flag:" ) ) { flags += flagData.mid(5); } @@ -387,7 +387,7 @@ void XSLT::setXSLT( const TQString &_document ) } if( !flags.isEmpty() ) - setProperty("flags", flags.join( TQString::fromLatin1("|") ) ); + setProperty("flags", flags.join( TQString::tqfromLatin1("|") ) ); } else { |