summaryrefslogtreecommitdiffstats
path: root/src/kvilib/ext/kvi_cmdformatter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kvilib/ext/kvi_cmdformatter.cpp')
-rw-r--r--src/kvilib/ext/kvi_cmdformatter.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/kvilib/ext/kvi_cmdformatter.cpp b/src/kvilib/ext/kvi_cmdformatter.cpp
index e2b3e1f6..153557b2 100644
--- a/src/kvilib/ext/kvi_cmdformatter.cpp
+++ b/src/kvilib/ext/kvi_cmdformatter.cpp
@@ -50,10 +50,10 @@ namespace KviCommandFormatter
return bGotIt;
}
- bool hasLeadingChars(QStringList &list,const QChar &c)
+ bool hasLeadingChars(TQStringList &list,const TQChar &c)
{
bool bGotIt = false;
- for(QStringList::Iterator it = list.begin();it != list.end();++it)
+ for(TQStringList::Iterator it = list.begin();it != list.end();++it)
{
if((*it).length() < 1)continue;
if((*it).at(0) == c)
@@ -62,7 +62,7 @@ namespace KviCommandFormatter
bGotIt = true;
} else {
// we pretend this line to be empty
- QString tmp = *it;
+ TQString tmp = *it;
#ifdef COMPILE_USE_QT4
tmp = tmp.trimmed();
#else
@@ -84,9 +84,9 @@ namespace KviCommandFormatter
}
}
- void trimLeading(QStringList &list)
+ void trimLeading(TQStringList &list)
{
- for(QStringList::Iterator it = list.begin();it != list.end();++it)
+ for(TQStringList::Iterator it = list.begin();it != list.end();++it)
{
(*it).remove(0,1);
}
@@ -102,9 +102,9 @@ namespace KviCommandFormatter
}
}
- void addLeading(QStringList &list,const QChar & c)
+ void addLeading(TQStringList &list,const TQChar & c)
{
- for(QStringList::Iterator it = list.begin();it != list.end();++it)
+ for(TQStringList::Iterator it = list.begin();it != list.end();++it)
{
(*it).prepend(c);
}
@@ -125,21 +125,21 @@ namespace KviCommandFormatter
}
- void unindent(QString &buffer)
+ void unindent(TQString &buffer)
{
#ifdef COMPILE_USE_QT4
- QStringList list = buffer.split("\n",QString::KeepEmptyParts);
+ TQStringList list = buffer.split("\n",TQString::KeepEmptyParts);
#else
- QStringList list = QStringList::split("\n",buffer,true);
+ TQStringList list = TQStringList::split("\n",buffer,true);
#endif
- while(hasLeadingChars(list,QChar('\t')) || hasLeadingChars(list,QChar(' ')))trimLeading(list);
+ while(hasLeadingChars(list,TQChar('\t')) || hasLeadingChars(list,TQChar(' ')))trimLeading(list);
//buffer = list.join("\n"); join implementation sux :D
// we WANT the last newline
buffer = "";
- for(QStringList::Iterator it = list.begin();it != list.end();++it)
+ for(TQStringList::Iterator it = list.begin();it != list.end();++it)
{
buffer.append(*it);
- buffer.append(QChar('\n'));
+ buffer.append(TQChar('\n'));
}
}
@@ -160,7 +160,7 @@ namespace KviCommandFormatter
buffer.stripWhiteSpace();
}
- void bufferFromBlock(QString &buffer)
+ void bufferFromBlock(TQString &buffer)
{
#ifdef COMPILE_USE_QT4
buffer = buffer.trimmed();
@@ -170,11 +170,11 @@ namespace KviCommandFormatter
if(buffer.isEmpty())return;
- if((buffer.at(0) == QChar('{')) && buffer.endsWith(QChar('}')))
+ if((buffer.at(0) == TQChar('{')) && buffer.endsWith(TQChar('}')))
{
buffer.remove(0,1);
buffer.remove(buffer.length() - 1,1);
- while((buffer.length() > 0) && ((buffer.at(0) == QChar('\n')) || (buffer.at(0) == QChar('\r'))))
+ while((buffer.length() > 0) && ((buffer.at(0) == TQChar('\n')) || (buffer.at(0) == TQChar('\r'))))
buffer.remove(0,1);
}
@@ -201,21 +201,21 @@ namespace KviCommandFormatter
}
}
- void indent(QString &buffer)
+ void indent(TQString &buffer)
{
#ifdef COMPILE_USE_QT4
- QStringList list = buffer.split("\n",QString::KeepEmptyParts);
+ TQStringList list = buffer.split("\n",TQString::KeepEmptyParts);
#else
- QStringList list = QStringList::split("\n",buffer,true);
+ TQStringList list = TQStringList::split("\n",buffer,true);
#endif
- addLeading(list,QChar('\t'));
+ addLeading(list,TQChar('\t'));
//buffer = list.join("\n"); join implementation sux :D
// we WANT the last newline
buffer = "";
- for(QStringList::Iterator it = list.begin();it != list.end();++it)
+ for(TQStringList::Iterator it = list.begin();it != list.end();++it)
{
buffer.append(*it);
- buffer.append(QChar('\n'));
+ buffer.append(TQChar('\n'));
}
}
@@ -229,12 +229,12 @@ namespace KviCommandFormatter
buffer.append("}\n");
}
- void blockFromBuffer(QString &buffer)
+ void blockFromBuffer(TQString &buffer)
{
indent(buffer);
buffer.prepend("{\n");
- KviQString::stripRightWhiteSpace(buffer);
- KviQString::ensureLastCharIs(buffer,'\n');
+ KviTQString::stripRightWhiteSpace(buffer);
+ KviTQString::ensureLastCharIs(buffer,'\n');
buffer.append("}\n");
}
};