summaryrefslogtreecommitdiffstats
path: root/ksirc/ksparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ksirc/ksparser.cpp')
-rw-r--r--ksirc/ksparser.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/ksirc/ksparser.cpp b/ksirc/ksparser.cpp
index e0f2f5ee..a02bd3bd 100644
--- a/ksirc/ksparser.cpp
+++ b/ksirc/ksparser.cpp
@@ -18,33 +18,33 @@
// $Id$
-#include <qstring.h>
-#include <qcolor.h>
-#include <qregexp.h>
+#include <tqstring.h>
+#include <tqcolor.h>
+#include <tqregexp.h>
#include <kdebug.h>
#include "ksopts.h"
#include "ksparser.h"
-QString KSParser::parse( const QString &message )
+TQString KSParser::parse( const TQString &message )
{
- QString res;
+ TQString res;
m_tags.clear();
m_attributes.clear();
m_beeped = false;
for (unsigned int i = 0; i < message.length();)
{
- QChar ch = message[i++];
+ TQChar ch = message[i++];
if (ch.latin1() == 0x03 || ch == '~' && i < message.length())
{
- QChar next = message[ i++ ];
+ TQChar next = message[ i++ ];
if (next.latin1() >= 0x30 && next.latin1() <= 0x39)
{
int fg = -1, len;
int bg = -1;
- QRegExp colorRex("^[0-9]+");
+ TQRegExp colorRex("^[0-9]+");
if (colorRex.search(message.mid(--i)) >= 0)
{
len = colorRex.matchedLength();
@@ -60,15 +60,15 @@ QString KSParser::parse( const QString &message )
i += len;
}
}
- QString at;
- QColor c = ircColor(fg);
+ TQString at;
+ TQColor c = ircColor(fg);
if ( c.isValid() ) {
- at += QString( "color=\"%1\" " ).arg( c.name() );
+ at += TQString( "color=\"%1\" " ).arg( c.name() );
}
c = ircColor(bg);
if ( c.isValid() ) {
- at += QString( "bgcolor=\"%1\" " ).arg( c.name() );
+ at += TQString( "bgcolor=\"%1\" " ).arg( c.name() );
}
if(at.length() > 0){
res += pushTag( "font", at );
@@ -108,13 +108,13 @@ QString KSParser::parse( const QString &message )
res += toggleTag( "u" );
break;
case 'n':
- res += toggleTag( "font", QString( "color=\"%1\"" ).arg( ksopts->nickForeground.name() ) );
+ res += toggleTag( "font", TQString( "color=\"%1\"" ).arg( ksopts->nickForeground.name() ) );
break;
case 'o':
- res += pushTag( "font", QString( "color=\"%1\"" ).arg( ksopts->msgContainNick.name() ) );
+ res += pushTag( "font", TQString( "color=\"%1\"" ).arg( ksopts->msgContainNick.name() ) );
break;
case '#':
- res += pushTag( "font", QString( "color=\"#%1\"" ).arg( message.mid(i, 6) ));
+ res += pushTag( "font", TQString( "color=\"#%1\"" ).arg( message.mid(i, 6) ));
i+=6;
break;
case '~':
@@ -137,9 +137,9 @@ QString KSParser::parse( const QString &message )
return res;
}
-QString KSParser::pushTag(const QString &tag, const QString &attributes)
+TQString KSParser::pushTag(const TQString &tag, const TQString &attributes)
{
- QString res;
+ TQString res;
m_tags.push(tag);
if (!m_attributes.contains(tag))
m_attributes.insert(tag, attributes);
@@ -151,13 +151,13 @@ QString KSParser::pushTag(const QString &tag, const QString &attributes)
return res + ">";
}
-QString KSParser::popTag(const QString &tag)
+TQString KSParser::popTag(const TQString &tag)
{
if (!m_tags.contains(tag))
- return QString::null;
+ return TQString::null;
- QString res;
- QValueStack<QString> savedTags;
+ TQString res;
+ TQValueStack<TQString> savedTags;
while (m_tags.top() != tag)
{
savedTags.push(m_tags.pop());
@@ -170,23 +170,23 @@ QString KSParser::popTag(const QString &tag)
return res;
}
-QString KSParser::toggleTag(const QString &tag, const QString &attributes)
+TQString KSParser::toggleTag(const TQString &tag, const TQString &attributes)
{
return m_attributes.contains(tag) ? popTag(tag) : pushTag(tag, attributes);
}
-QString KSParser::popAll()
+TQString KSParser::popAll()
{
- QString res;
+ TQString res;
while (!m_tags.isEmpty())
res.append("</" + m_tags.pop() + ">");
m_attributes.clear();
return res;
}
-QColor KSParser::ircColor(int code)
+TQColor KSParser::ircColor(int code)
{
if (code >= 0 && code < 16)
return ksopts->ircColors[code];
- return QColor();
+ return TQColor();
}