summaryrefslogtreecommitdiffstats
path: root/khelpcenter/formatter.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:33:34 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:33:34 +0000
commitc663b6440964f6ac48027143ac9e63298991f9d0 (patch)
tree6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /khelpcenter/formatter.cpp
parenta061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff)
downloadtdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz
tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'khelpcenter/formatter.cpp')
-rw-r--r--khelpcenter/formatter.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/khelpcenter/formatter.cpp b/khelpcenter/formatter.cpp
index e31c9d433..b9f394289 100644
--- a/khelpcenter/formatter.cpp
+++ b/khelpcenter/formatter.cpp
@@ -26,8 +26,8 @@
#include <kconfig.h>
#include <kstandarddirs.h>
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
using namespace KHC;
@@ -44,7 +44,7 @@ bool Formatter::readTemplates()
{
KConfig *cfg = KGlobal::config();
cfg->setGroup( "Templates" );
- QString mainTemplate = cfg->readEntry( "MainTemplate" );
+ TQString mainTemplate = cfg->readEntry( "MainTemplate" );
if ( mainTemplate.isEmpty() ) {
mainTemplate = locate( "appdata", "maintemplate" );
@@ -55,20 +55,20 @@ bool Formatter::readTemplates()
return false;
}
- QFile f( mainTemplate );
+ TQFile f( mainTemplate );
if ( !f.open( IO_ReadOnly ) ) {
kdWarning() << "Unable to open main template file '" << mainTemplate
<< "'." << endl;
return false;
}
- QTextStream ts( &f );
- QString line;
+ TQTextStream ts( &f );
+ TQString line;
enum State { IDLE, SINGLELINE, MULTILINE };
State state = IDLE;
- QString symbol;
- QString endMarker;
- QString value;
+ TQString symbol;
+ TQString endMarker;
+ TQString value;
while( !( line = ts.readLine() ).isNull() ) {
switch ( state ) {
case IDLE:
@@ -107,18 +107,18 @@ bool Formatter::readTemplates()
f.close();
#if 0
- QMap<QString,QString>::ConstIterator it;
+ TQMap<TQString,TQString>::ConstIterator it;
for( it = mSymbols.begin(); it != mSymbols.end(); ++it ) {
kdDebug() << "KEY: " << it.key() << endl;
kdDebug() << "VALUE: " << it.data() << endl;
}
#endif
- QStringList requiredSymbols;
+ TQStringList requiredSymbols;
requiredSymbols << "HEADER" << "FOOTER";
bool success = true;
- QStringList::ConstIterator it2;
+ TQStringList::ConstIterator it2;
for( it2 = requiredSymbols.begin(); it2 != requiredSymbols.end(); ++it2 ) {
if ( !mSymbols.contains( *it2 ) ) {
success = false;
@@ -132,9 +132,9 @@ bool Formatter::readTemplates()
return success;
}
-QString Formatter::header( const QString &title )
+TQString Formatter::header( const TQString &title )
{
- QString s;
+ TQString s;
if ( mHasTemplate ) {
s = mSymbols[ "HEADER" ];
s.replace( "--TITLE:--", title );
@@ -144,7 +144,7 @@ QString Formatter::header( const QString &title )
return s;
}
-QString Formatter::footer()
+TQString Formatter::footer()
{
if ( mHasTemplate ) {
return mSymbols[ "FOOTER" ];
@@ -153,33 +153,33 @@ QString Formatter::footer()
}
}
-QString Formatter::separator()
+TQString Formatter::separator()
{
// return "<table width=100%><tr><td bgcolor=\"#7B8962\">&nbsp;"
// "</td></tr></table>";
return "<hr>";
}
-QString Formatter::docTitle( const QString &title )
+TQString Formatter::docTitle( const TQString &title )
{
return "<h3><font color=\"red\">" + title + "</font></h3>";
}
-QString Formatter::sectionHeader( const QString &section )
+TQString Formatter::sectionHeader( const TQString &section )
{
return "<h2><font color=\"blue\">" + section + "</font></h2>";
}
-QString Formatter::processResult( const QString &data )
+TQString Formatter::processResult( const TQString &data )
{
- QString result;
+ TQString result;
enum { Header, BodyTag, Body, Footer };
int state = Header;
for( uint i = 0; i < data.length(); ++i ) {
- QChar c = data[i];
+ TQChar c = data[i];
switch ( state ) {
case Header:
if ( c == '<' && data.mid( i, 5 ).lower() == "<body" ) {
@@ -209,12 +209,12 @@ QString Formatter::processResult( const QString &data )
else return result;
}
-QString Formatter::paragraph( const QString &str )
+TQString Formatter::paragraph( const TQString &str )
{
return "<p>" + str + "</p>";
}
-QString Formatter::title( const QString &title )
+TQString Formatter::title( const TQString &title )
{
return "<h2>" + title + "</h2>";
}