diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kopete/plugins/latex/latexplugin.cpp | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip |
TQt4 port kdenetwork
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/plugins/latex/latexplugin.cpp')
-rw-r--r-- | kopete/plugins/latex/latexplugin.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/kopete/plugins/latex/latexplugin.cpp b/kopete/plugins/latex/latexplugin.cpp index 11537aba..61fab8a6 100644 --- a/kopete/plugins/latex/latexplugin.cpp +++ b/kopete/plugins/latex/latexplugin.cpp @@ -41,8 +41,8 @@ typedef KGenericFactory<LatexPlugin> LatexPluginFactory; K_EXPORT_COMPONENT_FACTORY( kopete_latex, LatexPluginFactory( "kopete_latex" ) ) -LatexPlugin::LatexPlugin( TQObject *parent, const char *name, const TQStringList &/*args*/ ) -: Kopete::Plugin( LatexPluginFactory::instance(), parent, name ) +LatexPlugin::LatexPlugin( TQObject *tqparent, const char *name, const TQStringList &/*args*/ ) +: Kopete::Plugin( LatexPluginFactory::instance(), tqparent, name ) { // kdDebug() << k_funcinfo << endl; if( !s_pluginStatic ) @@ -101,7 +101,7 @@ void LatexPlugin::slotMessageAboutToShow( Kopete::Message& msg ) } TQString messageText = msg.plainBody(); - if( !messageText.contains("$$")) + if( !messageText.tqcontains("$$")) return; //kdDebug() << k_funcinfo << " Using converter: " << m_convScript << endl; @@ -132,7 +132,7 @@ void LatexPlugin::slotMessageAboutToShow( Kopete::Message& msg ) if(!securityCheck(formul)) continue; - TQString fileName=handleLatex(formul.replace("$$","")); + TQString fileName=handleLatex(formul.tqreplace("$$","")); // get the image and encode it with base64 #if ENCODED_IMAGE_MODE @@ -145,7 +145,7 @@ void LatexPlugin::slotMessageAboutToShow( Kopete::Message& msg ) TQBuffer buffer( ba ); buffer.open( IO_WriteOnly ); renderedImage.save( &buffer, "PNG" ); - TQString imageURL = TQString::fromLatin1("data:image/png;base64,%1").arg( KCodecs::base64Encode( ba ) ); + TQString imageURL = TQString::tqfromLatin1("data:image/png;base64,%1").tqarg( KCodecs::base64Encode( ba ) ); replaceMap[match] = imageURL; } #else @@ -167,8 +167,8 @@ void LatexPlugin::slotMessageAboutToShow( Kopete::Message& msg ) continue; imagePxWidth = theImage.width(); imagePxHeight = theImage.height(); - TQString escapedLATEX=TQStyleSheet::escape(it.key()).replace("\"","""); //we need the escape quotes because that string will be in a title="" argument, but not the \n - messageText.replace(Kopete::Message::escape(it.key()), " <img width=\"" + TQString::number(imagePxWidth) + "\" height=\"" + TQString::number(imagePxHeight) + "\" src=\"" + (*it) + "\" alt=\"" + escapedLATEX +"\" title=\"" + escapedLATEX +"\" /> "); + TQString escapedLATEX=TQStyleSheet::escape(it.key()).tqreplace("\"","""); //we need the escape quotes because that string will be in a title="" argument, but not the \n + messageText.tqreplace(Kopete::Message::escape(it.key()), " <img width=\"" + TQString::number(imagePxWidth) + "\" height=\"" + TQString::number(imagePxHeight) + "\" src=\"" + (*it) + "\" alt=\"" + escapedLATEX +"\" title=\"" + escapedLATEX +"\" /> "); } msg.setBody( messageText, Kopete::Message::RichText ); @@ -187,7 +187,7 @@ void LatexPlugin::slotMessageAboutToSend( Kopete::Message& msg) return; TQString messageText = msg.plainBody(); - if( !messageText.contains("$$")) + if( !messageText.tqcontains("$$")) return; /* if( msg.from()->protocol()->pluginId()!="MSNProtocol" ) return;*/ @@ -206,7 +206,7 @@ void LatexPlugin::slotMessageAboutToSend( Kopete::Message& msg) if(!url.isNull()) { - TQString escapedLATEX= TQStyleSheet::escape(messageText).replace("\"","""); + TQString escapedLATEX= TQStyleSheet::escape(messageText).tqreplace("\"","""); TQString messageText="<img src=\"" + url + "\" alt=\"" + escapedLATEX + "\" title=\"" + escapedLATEX +"\" />"; msg.setBody( messageText, Kopete::Message::RichText ); } @@ -230,9 +230,9 @@ TQString LatexPlugin::handleLatex(const TQString &latexFormula) int hDPI, vDPI; hDPI = LatexConfig::self()->horizontalDPI(); vDPI = LatexConfig::self()->verticalDPI(); - p << m_convScript << argumentRes.arg(TQString::number(hDPI), TQString::number(vDPI)) << argumentOut.arg(fileName) /*<< argumentFormat*/ << latexFormula ; + p << m_convScript << argumentRes.tqarg(TQString::number(hDPI), TQString::number(vDPI)) << argumentOut.tqarg(fileName) /*<< argumentFormat*/ << latexFormula ; - kdDebug() << k_funcinfo << " Rendering " << m_convScript << " " << argumentRes.arg(TQString::number(hDPI), TQString::number(vDPI)) << " " << argumentOut.arg(fileName) << endl; + kdDebug() << k_funcinfo << " Rendering " << m_convScript << " " << argumentRes.tqarg(TQString::number(hDPI), TQString::number(vDPI)) << " " << argumentOut.tqarg(fileName) << endl; // FIXME our sucky sync filter API limitations :-) p.start(KProcess::Block); @@ -241,7 +241,7 @@ TQString LatexPlugin::handleLatex(const TQString &latexFormula) bool LatexPlugin::securityCheck(const TQString &latexFormula) { - return !latexFormula.contains(TQRegExp("\\\\(def|let|futurelet|newcommand|renewcomment|else|fi|write|input|include" + return !latexFormula.tqcontains(TQRegExp("\\\\(def|let|futurelet|newcommand|renewcomment|else|fi|write|input|include" "|chardef|catcode|makeatletter|noexpand|toksdef|every|errhelp|errorstopmode|scrollmode|nonstopmode|batchmode" "|read|csname|newhelp|relax|afterground|afterassignment|expandafter|noexpand|special|command|loop|repeat|toks" "|output|line|mathcode|name|item|section|mbox|DeclareRobustCommand)[^a-zA-Z]")); |