summaryrefslogtreecommitdiffstats
path: root/kode/printer.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /kode/printer.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kode/printer.cpp')
-rw-r--r--kode/printer.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/kode/printer.cpp b/kode/printer.cpp
index 2a5cba2fc..3adf32caf 100644
--- a/kode/printer.cpp
+++ b/kode/printer.cpp
@@ -24,8 +24,8 @@
#include <kdebug.h>
#include <ksavefile.h>
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
using namespace KODE;
@@ -44,32 +44,32 @@ void Printer::setCreationWarning( bool v )
mCreationWarning = v;
}
-void Printer::setGenerator( const QString &g )
+void Printer::setGenerator( const TQString &g )
{
mGenerator = g;
}
-void Printer::setOutputDirectory( const QString &o )
+void Printer::setOutputDirectory( const TQString &o )
{
mOutputDirectory = o;
}
-void Printer::setSourceFile( const QString &s )
+void Printer::setSourceFile( const TQString &s )
{
mSourceFile = s;
}
-QString Printer::functionSignature( const Function &f,
- const QString &className,
+TQString Printer::functionSignature( const Function &f,
+ const TQString &className,
bool includeClassQualifier )
{
- QString s;
+ TQString s;
if ( f.isStatic() && !includeClassQualifier ) {
s += "static ";
}
- QString ret = f.returnType();
+ TQString ret = f.returnType();
if ( !ret.isEmpty() ) {
s += ret;
if ( ret.right( 1 ) != "*" && ret.right( 1 ) != "&" ) {
@@ -95,10 +95,10 @@ QString Printer::functionSignature( const Function &f,
return s;
}
-QString Printer::creationWarning()
+TQString Printer::creationWarning()
{
// Create warning about generated file
- QString str = "// This file is generated by " + mGenerator;
+ TQString str = "// This file is generated by " + mGenerator;
if ( !mSourceFile.isEmpty() ) {
str += " from " + mSourceFile;
}
@@ -109,7 +109,7 @@ QString Printer::creationWarning()
return str;
}
-QString Printer::licenseHeader( const File &file )
+TQString Printer::licenseHeader( const File &file )
{
Code code;
code += "/*";
@@ -118,7 +118,7 @@ QString Printer::licenseHeader( const File &file )
code += "This file is part of " + file.project() + ".";
code.newLine();
- QStringList copyrights = file.copyrightStrings();
+ TQStringList copyrights = file.copyrightStrings();
if ( !copyrights.isEmpty() ) {
code.addBlock( copyrights.join( "\n" ) );
code.newLine();
@@ -133,7 +133,7 @@ QString Printer::licenseHeader( const File &file )
}
Code Printer::functionHeaders( const Function::List &functions,
- const QString &className,
+ const TQString &className,
int access )
{
bool needNewLine = false;
@@ -167,7 +167,7 @@ Code Printer::functionHeaders( const Function::List &functions,
return code;
}
-QString Printer::classHeader( const Class &c )
+TQString Printer::classHeader( const Class &c )
{
Code code;
@@ -179,7 +179,7 @@ QString Printer::classHeader( const Class &c )
code += "*/";
}
- QString txt = "class " + mStyle.className( c.name() );
+ TQString txt = "class " + mStyle.className( c.name() );
Class::List baseClasses = c.baseClasses();
if ( !baseClasses.isEmpty() ) {
@@ -252,7 +252,7 @@ QString Printer::classHeader( const Class &c )
for( it2 = variables.begin(); it2 != variables.end(); ++it2 ) {
MemberVariable v = *it2;
- QString decl;
+ TQString decl;
if ( v.isStatic() ) decl += "static ";
decl += v.type();
if ( v.type().right( 1 ) != "*" && v.type().right( 1 ) != "&" ) {
@@ -270,7 +270,7 @@ QString Printer::classHeader( const Class &c )
return code.text();
}
-QString Printer::classImplementation( const Class &c )
+TQString Printer::classImplementation( const Class &c )
{
Code code;
@@ -325,10 +325,10 @@ void Printer::printHeader( const File &f )
out.addBlock( licenseHeader( f ) );
// Create include guard
- QString className = f.filename();
+ TQString className = f.filename();
className.replace( "-", "_" );
- QString includeGuard;
+ TQString includeGuard;
if ( !f.nameSpace().isEmpty() ) includeGuard += f.nameSpace().upper() + "_";
includeGuard += className.upper() + "_H";
@@ -339,12 +339,12 @@ void Printer::printHeader( const File &f )
// Create includes
- QStringList processed;
+ TQStringList processed;
Class::List classes = f.classes();
Class::List::ConstIterator it;
for( it = classes.begin(); it != classes.end(); ++it ) {
- QStringList includes = (*it).headerIncludes();
- QStringList::ConstIterator it2;
+ TQStringList includes = (*it).headerIncludes();
+ TQStringList::ConstIterator it2;
for( it2 = includes.begin(); it2 != includes.end(); ++it2 ) {
if ( processed.find( *it2 ) == processed.end() ) {
out += "#include <" + *it2 + ">";
@@ -358,8 +358,8 @@ void Printer::printHeader( const File &f )
// Create forward declarations
processed.clear();
for( it = classes.begin(); it != classes.end(); ++it ) {
- QStringList decls = (*it).forwardDeclarations();
- QStringList::ConstIterator it2;
+ TQStringList decls = (*it).forwardDeclarations();
+ TQStringList::ConstIterator it2;
for( it2 = decls.begin(); it2 != decls.end(); ++it2 ) {
if ( processed.find( *it2 ) == processed.end() ) {
out += "class " + *it2 + ";";
@@ -391,19 +391,19 @@ void Printer::printHeader( const File &f )
// Print to file
- QString filename = f.filename() + ".h";
+ TQString filename = f.filename() + ".h";
if ( !mOutputDirectory.isEmpty() ) filename.prepend( mOutputDirectory + "/" );
- KSaveFile::backupFile( filename, QString::null, ".backup" );
+ KSaveFile::backupFile( filename, TQString::null, ".backup" );
- QFile header( filename );
+ TQFile header( filename );
if ( !header.open( IO_WriteOnly ) ) {
kdError() << "Can't open '" << filename << "' for writing." << endl;
return;
}
- QTextStream h( &header );
+ TQTextStream h( &header );
h << out.text();
@@ -426,20 +426,20 @@ void Printer::printImplementation( const File &f, bool createHeaderInclude )
out.newLine();
}
- QStringList includes = f.includes();
- QStringList::ConstIterator it2;
+ TQStringList includes = f.includes();
+ TQStringList::ConstIterator it2;
for( it2 = includes.begin(); it2 != includes.end(); ++it2 ) {
out += "#include <" + *it2 + ">";
}
if ( !includes.isEmpty() ) out.newLine();
// Create class includes
- QStringList processed;
+ TQStringList processed;
Class::List classes = f.classes();
Class::List::ConstIterator it;
for( it = classes.begin(); it != classes.end(); ++it ) {
- QStringList includes = (*it).includes();
- QStringList::ConstIterator it2;
+ TQStringList includes = (*it).includes();
+ TQStringList::ConstIterator it2;
for( it2 = includes.begin(); it2 != includes.end(); ++it2 ) {
if ( processed.find( *it2 ) == processed.end() ) {
out += "#include <" + *it2 + ">";
@@ -455,10 +455,10 @@ void Printer::printImplementation( const File &f, bool createHeaderInclude )
}
// 'extern "C"' declarations
- QStringList externCDeclarations = f.externCDeclarations();
+ TQStringList externCDeclarations = f.externCDeclarations();
if ( !externCDeclarations.isEmpty() ) {
out += "extern \"C\" {";
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for( it = externCDeclarations.begin(); it != externCDeclarations.end();
++it ) {
out += *it + ";";
@@ -472,7 +472,7 @@ void Printer::printImplementation( const File &f, bool createHeaderInclude )
Variable::List::ConstIterator itV;
for( itV = vars.begin(); itV != vars.end(); ++itV ) {
Variable v = *itV;
- QString str;
+ TQString str;
if ( v.isStatic() ) str += "static ";
str += v.type() + " " + v.name() + ";";
out += str;
@@ -499,24 +499,24 @@ void Printer::printImplementation( const File &f, bool createHeaderInclude )
// Classes
for( it = classes.begin(); it != classes.end(); ++it ) {
- QString str = classImplementation( *it );
+ TQString str = classImplementation( *it );
if ( !str.isEmpty() ) out += classImplementation( *it );
}
// Print to file
- QString filename = f.filename() + ".cpp";
+ TQString filename = f.filename() + ".cpp";
if ( !mOutputDirectory.isEmpty() ) filename.prepend( mOutputDirectory + "/" );
- KSaveFile::backupFile( filename, QString::null, ".backup" );
+ KSaveFile::backupFile( filename, TQString::null, ".backup" );
- QFile implementation( filename );
+ TQFile implementation( filename );
if ( !implementation.open( IO_WriteOnly ) ) {
kdError() << "Can't open '" << filename << "' for writing." << endl;
return;
}
- QTextStream h( &implementation );
+ TQTextStream h( &implementation );
h << out.text();
@@ -525,19 +525,19 @@ void Printer::printImplementation( const File &f, bool createHeaderInclude )
void Printer::printAutoMakefile( const AutoMakefile &am )
{
- QString filename = "Makefile.am";
+ TQString filename = "Makefile.am";
if ( !mOutputDirectory.isEmpty() ) filename.prepend( mOutputDirectory + "/" );
- KSaveFile::backupFile( filename, QString::null, ".backup" );
+ KSaveFile::backupFile( filename, TQString::null, ".backup" );
- QFile file( filename );
+ TQFile file( filename );
if ( !file.open( IO_WriteOnly ) ) {
kdError() << "Can't open '" << filename << "' for writing." << endl;
return;
}
- QTextStream ts( &file );
+ TQTextStream ts( &file );
ts << am.text();
}