From f7e71d47719ab6094cf4a9fafffa5ea351973522 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 13 Jan 2011 08:32:36 +0000 Subject: Initial conversion for TQt for Qt4 3.4.0 TP2 This will also compile with TQt for Qt3, and should not cause any problems with dependent modules such as kdebase. If it does then it needs to be fixed! git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1214149 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdecore/kconfig_compiler/kconfig_compiler.cpp | 66 +++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'kdecore/kconfig_compiler/kconfig_compiler.cpp') diff --git a/kdecore/kconfig_compiler/kconfig_compiler.cpp b/kdecore/kconfig_compiler/kconfig_compiler.cpp index f11394495..1b1d82860 100644 --- a/kdecore/kconfig_compiler/kconfig_compiler.cpp +++ b/kdecore/kconfig_compiler/kconfig_compiler.cpp @@ -220,7 +220,7 @@ static TQString enumName(const TQString &n) return result; } -static TQString setFunction(const TQString &n, const TQString &className = TQString::null) +static TQString setFunction(const TQString &n, const TQString &className = TQString()) { TQString result = "set"+n; result[3] = result[3].upper(); @@ -231,7 +231,7 @@ static TQString setFunction(const TQString &n, const TQString &className = TQStr } -static TQString getFunction(const TQString &n, const TQString &className = TQString::null) +static TQString getFunction(const TQString &n, const TQString &className = TQString()) { TQString result = n; result[0] = result[0].lower(); @@ -262,10 +262,10 @@ static TQString literalString( const TQString &s ) { bool isAscii = true; for(int i = s.length(); i--;) - if (s[i].unicode() > 127) isAscii = false; + if (s[i].tqunicode() > 127) isAscii = false; if (isAscii) - return "TQString::fromLatin1( " + quoteString(s) + " )"; + return "TQString::tqfromLatin1( " + quoteString(s) + " )"; else return "TQString::fromUtf8( " + quoteString(s) + " )"; } @@ -284,7 +284,7 @@ static TQString dumpNode(const TQDomNode &node) static TQString filenameOnly(TQString path) { - int i = path.findRev('/'); + int i = path.tqfindRev('/'); if (i >= 0) return path.mid(i+1); return path; @@ -480,13 +480,13 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element ) if ( nameIsEmpty ) { name = key; - name.replace( " ", TQString::null ); - } else if ( name.contains( ' ' ) ) { + name.tqreplace( " ", TQString() ); + } else if ( name.tqcontains( ' ' ) ) { kdWarning()<<"Entry '"< elements can't contain speces!"< &"; else if ( type == "Enum" ) return "int"; else if ( type == "Path" ) return "const TQString &"; @@ -649,8 +649,8 @@ TQString cppType( const TQString &type ) else if ( type == "Bool" ) return "bool"; else if ( type == "Double" ) return "double"; else if ( type == "DateTime" ) return "TQDateTime"; - else if ( type == "Int64" ) return "Q_INT64"; - else if ( type == "UInt64" ) return "Q_UINT64"; + else if ( type == "Int64" ) return "TQ_INT64"; + else if ( type == "UInt64" ) return "TQ_UINT64"; else if ( type == "IntList" ) return "TQValueList"; else if ( type == "Enum" ) return "int"; else if ( type == "Path" ) return "TQString"; @@ -702,13 +702,13 @@ TQString itemType( const TQString &type ) static TQString itemDeclaration(const CfgEntry *e) { if (itemAccessors) - return TQString::null; + return TQString(); TQString fCap = e->name(); fCap[0] = fCap[0].upper(); return " KConfigSkeleton::Item"+itemType( e->type() ) + " *item" + fCap + - ( (!e->param().isEmpty())?(TQString("[%1]").arg(e->paramMax()+1)) : TQString::null) + + ( (!e->param().isEmpty())?(TQString("[%1]").arg(e->paramMax()+1)) : TQString()) + ";\n"; } @@ -752,7 +752,7 @@ static TQString itemPath(const CfgEntry *e) } TQString newItem( const TQString &type, const TQString &name, const TQString &key, - const TQString &defaultValue, const TQString ¶m = TQString::null) + const TQString &defaultValue, const TQString ¶m = TQString()) { TQString t = "new KConfigSkeleton::Item" + itemType( type ) + "( currentGroup(), " + key + ", " + varPath( name ) + param; @@ -771,7 +771,7 @@ TQString paramString(const TQString &s, const CfgEntry *e, int i) { TQString result = s; TQString needle = "$("+e->param()+")"; - if (result.contains(needle)) + if (result.tqcontains(needle)) { TQString tmp; if (e->paramType() == "Enum") @@ -796,7 +796,7 @@ TQString paramString(const TQString &group, const TQValueList ¶meters for (TQValueList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it) { - if (paramString.contains("$("+(*it).name+")")) + if (paramString.tqcontains("$("+(*it).name+")")) { TQString tmp; tmp.sprintf("%%%d", i++); @@ -805,13 +805,13 @@ TQString paramString(const TQString &group, const TQValueList ¶meters } } if (arguments.isEmpty()) - return "TQString::fromLatin1( \""+group+"\" )"; + return "TQString::tqfromLatin1( \""+group+"\" )"; - return "TQString::fromLatin1( \""+paramString+"\" )"+arguments; + return "TQString::tqfromLatin1( \""+paramString+"\" )"+arguments; } /* int i is the value of the parameter */ -TQString userTextsFunctions( CfgEntry *e, TQString itemVarStr=TQString::null, TQString i=TQString::null ) +TQString userTextsFunctions( CfgEntry *e, TQString itemVarStr=TQString(), TQString i=TQString() ) { TQString txt; if (itemVarStr.isNull()) itemVarStr=itemPath(e); @@ -883,12 +883,12 @@ TQString memberMutatorBody( CfgEntry *e ) out << "}" << endl << endl; } - out << "if (!" << This << "isImmutable( TQString::fromLatin1( \""; + out << "if (!" << This << "isImmutable( TQString::tqfromLatin1( \""; if (!e->param().isEmpty()) { out << e->paramName().replace("$("+e->param()+")", "%1") << "\" ).arg( "; if ( e->paramType() == "Enum" ) { - out << "TQString::fromLatin1( "; + out << "TQString::tqfromLatin1( "; if (globalEnums) out << enumName(e->param()) << "ToString[i]"; @@ -1249,7 +1249,7 @@ int main( int argc, char **argv ) TQString t = e->type(); // Manipulator - if (allMutators || mutators.contains(n)) + if (allMutators || mutators.tqcontains(n)) { h << " /**" << endl; h << " Set " << e->label() << endl; @@ -1518,7 +1518,7 @@ int main( int argc, char **argv ) cpp << " )" << endl; cpp << " : " << inherits << "("; - if ( !cfgFileName.isEmpty() ) cpp << " TQString::fromLatin1( \"" << cfgFileName << "\" "; + if ( !cfgFileName.isEmpty() ) cpp << " TQString::tqfromLatin1( \"" << cfgFileName << "\" "; if ( cfgFileNameArg ) cpp << " config "; if ( !cfgFileName.isEmpty() ) cpp << ") "; cpp << ")" << endl; @@ -1539,7 +1539,7 @@ int main( int argc, char **argv ) if ( singleton ) cpp << " mSelf = this;" << endl; - group = TQString::null; + group = TQString(); for( e = entries.first(); e; e = entries.next() ) { if ( e->group() != group ) { if ( !group.isEmpty() ) cpp << endl; @@ -1560,7 +1560,7 @@ int main( int argc, char **argv ) for( it = choices.begin(); it != choices.end(); ++it ) { cpp << " {" << endl; cpp << " KConfigSkeleton::ItemEnum::Choice choice;" << endl; - cpp << " choice.name = TQString::fromLatin1( \"" << (*it).name << "\" );" << endl; + cpp << " choice.name = TQString::tqfromLatin1( \"" << (*it).name << "\" );" << endl; if ( setUserTexts ) { if ( !(*it).label.isEmpty() ) cpp << " choice.label = i18n(" << quoteString((*it).label) << ");" << endl; @@ -1592,7 +1592,7 @@ int main( int argc, char **argv ) cpp << " addItem( " << itemPath(e); TQString quotedName = e->name(); addQuotes( quotedName ); - if ( quotedName != key ) cpp << ", TQString::fromLatin1( \"" << e->name() << "\" )"; + if ( quotedName != key ) cpp << ", TQString::tqfromLatin1( \"" << e->name() << "\" )"; cpp << " );" << endl; } else @@ -1621,7 +1621,7 @@ int main( int argc, char **argv ) // param name. The check for isImmutable in the set* functions doesn't have the param // name available, just the corresponding enum value (int), so we need to store the // param names in a separate static list!. - cpp << " addItem( " << itemVarStr << ", TQString::fromLatin1( \""; + cpp << " addItem( " << itemVarStr << ", TQString::tqfromLatin1( \""; if ( e->paramType()=="Enum" ) cpp << e->paramName().replace( "$("+e->param()+")", "%1").arg(e->paramValues()[i] ); else @@ -1642,7 +1642,7 @@ int main( int argc, char **argv ) TQString t = e->type(); // Manipulator - if (allMutators || mutators.contains(n)) + if (allMutators || mutators.tqcontains(n)) { cpp << "void " << setFunction(n, className) << "( "; if (!e->param().isEmpty()) -- cgit v1.2.3