From 9ba04742771370f59740e32e11c5f3a1e6a1b70a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 5 Dec 2011 15:55:57 -0600 Subject: Initial TQt conversion --- korundum/rubylib/rbkconfig_compiler/README.dox | 6 +- korundum/rubylib/rbkconfig_compiler/autoexample.rb | 8 +- korundum/rubylib/rbkconfig_compiler/example.kcfg | 2 +- korundum/rubylib/rbkconfig_compiler/example.rb | 4 +- .../rubylib/rbkconfig_compiler/general_base.ui | 8 +- korundum/rubylib/rbkconfig_compiler/kcfg.xsd | 6 +- .../rubylib/rbkconfig_compiler/myoptions_base.ui | 6 +- .../rbkconfig_compiler/rbkconfig_compiler.cpp | 472 ++++++++++----------- .../rubylib/rbkconfig_compiler/tests/test1.kcfg | 2 +- .../rubylib/rbkconfig_compiler/tests/test1main.rb | 4 +- .../rubylib/rbkconfig_compiler/tests/test2main.rb | 6 +- .../rubylib/rbkconfig_compiler/tests/test3main.rb | 4 +- .../rubylib/rbkconfig_compiler/tests/test4.kcfg | 2 +- .../rubylib/rbkconfig_compiler/tests/test4main.rb | 4 +- .../rubylib/rbkconfig_compiler/tests/test5.kcfg | 2 +- .../rubylib/rbkconfig_compiler/tests/test5main.rb | 4 +- 16 files changed, 270 insertions(+), 270 deletions(-) (limited to 'korundum/rubylib/rbkconfig_compiler') diff --git a/korundum/rubylib/rbkconfig_compiler/README.dox b/korundum/rubylib/rbkconfig_compiler/README.dox index 97da4dc9..75f6d826 100644 --- a/korundum/rubylib/rbkconfig_compiler/README.dox +++ b/korundum/rubylib/rbkconfig_compiler/README.dox @@ -25,7 +25,7 @@ all spaces from \. An entry must also have a type. The list of allowable types is specified in the DTD and loosely follows the list of types supported -by the Qt::Variant with exception of the clearly binary types +by the TQt::Variant with exception of the clearly binary types (e.g. Pixmap, Image...) which are not supported. Besides those basic type the following special types are supported: @@ -40,7 +40,7 @@ type the following special types are supported: compatibility. - IntList This indicates a list of integers. This information is provided - to the application as an Array of Integers. Useful for storing Qt::Splitter + to the application as an Array of Integers. Useful for storing TQt::Splitter geometries. An entry can optionally have a default value which is used as default when @@ -86,7 +86,7 @@ The following options are read from the kcfgc file: ClassName string - - Name of generated class (required) + Name of generated class (retquired) Inherits diff --git a/korundum/rubylib/rbkconfig_compiler/autoexample.rb b/korundum/rubylib/rbkconfig_compiler/autoexample.rb index 8526c93d..c6c942cb 100644 --- a/korundum/rubylib/rbkconfig_compiler/autoexample.rb +++ b/korundum/rubylib/rbkconfig_compiler/autoexample.rb @@ -19,10 +19,10 @@ Boston, MA 02110-1301, USA. =end -require 'Korundum' -require 'exampleprefs_base.rb' -require 'general_base.rb' -require 'myoptions_base.rb' +retquire 'Korundum' +retquire 'exampleprefs_base.rb' +retquire 'general_base.rb' +retquire 'myoptions_base.rb' aboutData = KDE::AboutData.new( "example", I18N_NOOP("autoconfig example"), "0.1" ) aboutData.addAuthor( "Cornelius Schumacher", nil, "schumacher@kde.org" ) diff --git a/korundum/rubylib/rbkconfig_compiler/example.kcfg b/korundum/rubylib/rbkconfig_compiler/example.kcfg index 89d1e646..055958b4 100644 --- a/korundum/rubylib/rbkconfig_compiler/example.kcfg +++ b/korundum/rubylib/rbkconfig_compiler/example.kcfg @@ -35,7 +35,7 @@ - Qt::Dir.homeDirPath()+".hidden_file" + TQt::Dir.homeDirPath()+".hidden_file" diff --git a/korundum/rubylib/rbkconfig_compiler/example.rb b/korundum/rubylib/rbkconfig_compiler/example.rb index d7ef38b1..61e3eb41 100644 --- a/korundum/rubylib/rbkconfig_compiler/example.rb +++ b/korundum/rubylib/rbkconfig_compiler/example.rb @@ -19,8 +19,8 @@ Boston, MA 02110-1301, USA. =end -require 'Korundum' -require 'exampleprefs_base.rb' +retquire 'Korundum' +retquire 'exampleprefs_base.rb' aboutData = KDE::AboutData.new( "example", I18N_NOOP("cfgc example"), "0.1" ) aboutData.addAuthor( "Cornelius Schumacher", nil, "schumacher@kde.org" ) diff --git a/korundum/rubylib/rbkconfig_compiler/general_base.ui b/korundum/rubylib/rbkconfig_compiler/general_base.ui index 9b41370c..4a76cc34 100644 --- a/korundum/rubylib/rbkconfig_compiler/general_base.ui +++ b/korundum/rubylib/rbkconfig_compiler/general_base.ui @@ -1,6 +1,6 @@ GeneralBase - + GeneralBase @@ -19,7 +19,7 @@ unnamed - + kcfg_OneOption @@ -27,12 +27,12 @@ OneOption - + kcfg_AnotherOption2 - + textLabel1 diff --git a/korundum/rubylib/rbkconfig_compiler/kcfg.xsd b/korundum/rubylib/rbkconfig_compiler/kcfg.xsd index 61450d25..943282b9 100644 --- a/korundum/rubylib/rbkconfig_compiler/kcfg.xsd +++ b/korundum/rubylib/rbkconfig_compiler/kcfg.xsd @@ -88,7 +88,7 @@ - + @@ -136,7 +136,7 @@ - + @@ -176,7 +176,7 @@ - + diff --git a/korundum/rubylib/rbkconfig_compiler/myoptions_base.ui b/korundum/rubylib/rbkconfig_compiler/myoptions_base.ui index 3c0c2e6c..aa3148a4 100644 --- a/korundum/rubylib/rbkconfig_compiler/myoptions_base.ui +++ b/korundum/rubylib/rbkconfig_compiler/myoptions_base.ui @@ -1,6 +1,6 @@ MyOptionsBase - + MyOptionsBase @@ -16,7 +16,7 @@ unnamed - + textLabel1 @@ -24,7 +24,7 @@ MyString: - + kcfg_MyString diff --git a/korundum/rubylib/rbkconfig_compiler/rbkconfig_compiler.cpp b/korundum/rubylib/rbkconfig_compiler/rbkconfig_compiler.cpp index ee11862e..a3ff32d7 100644 --- a/korundum/rubylib/rbkconfig_compiler/rbkconfig_compiler.cpp +++ b/korundum/rubylib/rbkconfig_compiler/rbkconfig_compiler.cpp @@ -51,23 +51,23 @@ static const KCmdLineOptions options[] = bool globalEnums; bool itemAccessors; -TQStringList allNames; -TQRegExp *validNameRegexp; +TTQStringList allNames; +TTQRegExp *validNameRegexp; class CfgEntry { public: struct Choice { - TQString name; - TQString label; - TQString whatsThis; + TTQString name; + TTQString label; + TTQString whatsThis; }; - CfgEntry( const TQString &group, const TQString &type, const TQString &key, - const TQString &name, const TQString &label, - const TQString &whatsThis, const TQString &code, - const TQString &defaultValue, const TQValueList &choices, + CfgEntry( const TTQString &group, const TTQString &type, const TTQString &key, + const TTQString &name, const TTQString &label, + const TTQString &whatsThis, const TTQString &code, + const TTQString &defaultValue, const TTQValueList &choices, bool hidden ) : mGroup( group ), mType( type ), mKey( key ), mName( name ), mLabel( label ), mWhatsThis( whatsThis ), mCode( code ), @@ -76,53 +76,53 @@ class CfgEntry { } - void setGroup( const TQString &group ) { mGroup = group; } - TQString group() const { return mGroup; } + void setGroup( const TTQString &group ) { mGroup = group; } + TTQString group() const { return mGroup; } - void setType( const TQString &type ) { mType = type; } - TQString type() const { return mType; } + void setType( const TTQString &type ) { mType = type; } + TTQString type() const { return mType; } - void setKey( const TQString &key ) { mKey = key; } - TQString key() const { return mKey; } + void setKey( const TTQString &key ) { mKey = key; } + TTQString key() const { return mKey; } - void setName( const TQString &name ) { mName = name; } - TQString name() const { return mName; } + void setName( const TTQString &name ) { mName = name; } + TTQString name() const { return mName; } - void setLabel( const TQString &label ) { mLabel = label; } - TQString label() const { return mLabel; } + void setLabel( const TTQString &label ) { mLabel = label; } + TTQString label() const { return mLabel; } - void setWhatsThis( const TQString &whatsThis ) { mWhatsThis = whatsThis; } - TQString whatsThis() const { return mWhatsThis; } + void setWhatsThis( const TTQString &whatsThis ) { mWhatsThis = whatsThis; } + TTQString whatsThis() const { return mWhatsThis; } - void setDefaultValue( const TQString &d ) { mDefaultValue = d; } - TQString defaultValue() const { return mDefaultValue; } + void setDefaultValue( const TTQString &d ) { mDefaultValue = d; } + TTQString defaultValue() const { return mDefaultValue; } - void setCode( const TQString &d ) { mCode = d; } - TQString code() const { return mCode; } + void setCode( const TTQString &d ) { mCode = d; } + TTQString code() const { return mCode; } - void setMinValue( const TQString &d ) { mMin = d; } - TQString minValue() const { return mMin; } + void setMinValue( const TTQString &d ) { mMin = d; } + TTQString minValue() const { return mMin; } - void setMaxValue( const TQString &d ) { mMax = d; } - TQString maxValue() const { return mMax; } + void setMaxValue( const TTQString &d ) { mMax = d; } + TTQString maxValue() const { return mMax; } - void setParam( const TQString &d ) { mParam = d; } - TQString param() const { return mParam; } + void setParam( const TTQString &d ) { mParam = d; } + TTQString param() const { return mParam; } - void setParamName( const TQString &d ) { mParamName = d; } - TQString paramName() const { return mParamName; } + void setParamName( const TTQString &d ) { mParamName = d; } + TTQString paramName() const { return mParamName; } - void setParamType( const TQString &d ) { mParamType = d; } - TQString paramType() const { return mParamType; } + void setParamType( const TTQString &d ) { mParamType = d; } + TTQString paramType() const { return mParamType; } - void setChoices( const TQValueList &d ) { mChoices = d; } - TQValueList choices() const { return mChoices; } + void setChoices( const TTQValueList &d ) { mChoices = d; } + TTQValueList choices() const { return mChoices; } - void setParamValues( const TQStringList &d ) { mParamValues = d; } - TQStringList paramValues() const { return mParamValues; } + void setParamValues( const TTQStringList &d ) { mParamValues = d; } + TTQStringList paramValues() const { return mParamValues; } - void setParamDefaultValues( const TQStringList &d ) { mParamDefaultValues = d; } - TQString paramDefaultValue(int i) const { return mParamDefaultValues[i]; } + void setParamDefaultValues( const TTQStringList &d ) { mParamDefaultValues = d; } + TTQString paramDefaultValue(int i) const { return mParamDefaultValues[i]; } void setParamMax( int d ) { mParamMax = d; } int paramMax() const { return mParamMax; } @@ -155,73 +155,73 @@ class CfgEntry } private: - TQString mGroup; - TQString mType; - TQString mKey; - TQString mName; - TQString mLabel; - TQString mWhatsThis; - TQString mCode; - TQString mDefaultValue; - TQString mParam; - TQString mParamName; - TQString mParamType; - TQValueList mChoices; - TQStringList mParamValues; - TQStringList mParamDefaultValues; + TTQString mGroup; + TTQString mType; + TTQString mKey; + TTQString mName; + TTQString mLabel; + TTQString mWhatsThis; + TTQString mCode; + TTQString mDefaultValue; + TTQString mParam; + TTQString mParamName; + TTQString mParamType; + TTQValueList mChoices; + TTQStringList mParamValues; + TTQStringList mParamDefaultValues; int mParamMax; bool mHidden; - TQString mMin; - TQString mMax; + TTQString mMin; + TTQString mMax; }; -static TQString varName(const TQString &n) +static TTQString varName(const TTQString &n) { - TQString result = "@"+n; + TTQString result = "@"+n; result[1] = result[1].lower(); return result; } -static TQString enumName(const TQString &n) +static TTQString enumName(const TTQString &n) { - TQString result = "Enum"+n; + TTQString result = "Enum"+n; result[4] = result[4].upper(); return result; } -static TQString enumValue(const TQString &n) +static TTQString enumValue(const TTQString &n) { - TQString result = n; + TTQString result = n; result[0] = result[0].upper(); return result; } -static TQString setFunction(const TQString &n) +static TTQString setFunction(const TTQString &n) { - TQString result = "set"+n; + TTQString result = "set"+n; result[3] = result[3].upper(); return result; } -static TQString getFunction(const TQString &n) +static TTQString getFunction(const TTQString &n) { - TQString result = n; + TTQString result = n; result[0] = result[0].lower(); return result; } -static void addQuotes( TQString &s ) +static void addQuotes( TTQString &s ) { if ( s.left( 1 ) != "\"" ) s.prepend( "\"" ); if ( s.right( 1 ) != "\"" ) s.append( "\"" ); } -static TQString quoteString( const TQString &s ) +static TTQString quoteString( const TTQString &s ) { - TQString r = s; + TTQString r = s; r.replace( "\\", "\\\\" ); r.replace( "\"", "\\\"" ); r.replace( "\r", "" ); @@ -229,7 +229,7 @@ static TQString quoteString( const TQString &s ) return "\"" + r + "\""; } -static TQString literalString( const TQString &s ) +static TTQString literalString( const TTQString &s ) { bool isAscii = true; for(int i = s.length(); i--;) @@ -238,15 +238,15 @@ static TQString literalString( const TQString &s ) return quoteString(s); // if (isAscii) -// return "TQString::fromLatin1( " + quoteString(s) + " )"; +// return "TTQString::fromLatin1( " + quoteString(s) + " )"; // else -// return "TQString::fromUtf8( " + quoteString(s) + " )"; +// return "TTQString::fromUtf8( " + quoteString(s) + " )"; } -static TQString dumpNode(const TQDomNode &node) +static TTQString dumpNode(const TTQDomNode &node) { - TQString msg; - TQTextStream s(&msg, IO_WriteOnly ); + TTQString msg; + TTQTextStream s(&msg, IO_WriteOnly ); node.save(s, 0); msg = msg.simplifyWhiteSpace(); @@ -255,7 +255,7 @@ static TQString dumpNode(const TQDomNode &node) return msg; } -static TQString filenameOnly(TQString path) +static TTQString filenameOnly(TTQString path) { int i = path.findRev('/'); if (i >= 0) @@ -263,10 +263,10 @@ static TQString filenameOnly(TQString path) return path; } -static void preProcessDefault( TQString &defaultValue, const TQString &name, - const TQString &type, - const TQValueList &choices, - TQString &code ) +static void preProcessDefault( TTQString &defaultValue, const TTQString &name, + const TTQString &type, + const TTQValueList &choices, + TTQString &code ) { if ( type == "String" && !defaultValue.isEmpty() ) { defaultValue = literalString(defaultValue); @@ -275,14 +275,14 @@ static void preProcessDefault( TQString &defaultValue, const TQString &name, defaultValue = literalString( defaultValue ); } else if ( type == "StringList" && !defaultValue.isEmpty() ) { - TQTextStream rb( &code, IO_WriteOnly | IO_Append ); + TTQTextStream rb( &code, IO_WriteOnly | IO_Append ); if (!code.isEmpty()) rb << endl; -// rb << " TQStringList default" << name << ";" << endl; +// rb << " TTQStringList default" << name << ";" << endl; rb << " default" << name << " = []" << endl; - TQStringList defaults = TQStringList::split( ",", defaultValue ); - TQStringList::ConstIterator it; + TTQStringList defaults = TTQStringList::split( ",", defaultValue ); + TTQStringList::ConstIterator it; for( it = defaults.begin(); it != defaults.end(); ++it ) { rb << " default" << name << " << \"" << *it << "\"" << endl; @@ -290,19 +290,19 @@ static void preProcessDefault( TQString &defaultValue, const TQString &name, defaultValue = "default" + name; } else if ( type == "Color" && !defaultValue.isEmpty() ) { - TQRegExp colorRe("\\d+,\\s*\\d+,\\s*\\d+"); + TTQRegExp colorRe("\\d+,\\s*\\d+,\\s*\\d+"); if (colorRe.exactMatch(defaultValue)) { - defaultValue = "Qt::Color.new( " + defaultValue + " )"; + defaultValue = "TQt::Color.new( " + defaultValue + " )"; } else { - defaultValue = "Qt::Color.new( \"" + defaultValue + "\" )"; + defaultValue = "TQt::Color.new( \"" + defaultValue + "\" )"; } } else if ( type == "Enum" ) { if ( !globalEnums ) { - TQValueList::ConstIterator it; + TTQValueList::ConstIterator it; for( it = choices.begin(); it != choices.end(); ++it ) { if ( (*it).name == defaultValue ) { defaultValue.prepend( enumName(name) + "_"); @@ -312,13 +312,13 @@ static void preProcessDefault( TQString &defaultValue, const TQString &name, } } else if ( type == "IntList" ) { - TQTextStream rb( &code, IO_WriteOnly | IO_Append ); + TTQTextStream rb( &code, IO_WriteOnly | IO_Append ); if (!code.isEmpty()) rb << endl; rb << " default" << name << " = []" << endl; - TQStringList defaults = TQStringList::split( ",", defaultValue ); - TQStringList::ConstIterator it; + TTQStringList defaults = TTQStringList::split( ",", defaultValue ); + TTQStringList::ConstIterator it; for( it = defaults.begin(); it != defaults.end(); ++it ) { rb << " default" << name << " << " << *it << "" << endl; @@ -328,31 +328,31 @@ static void preProcessDefault( TQString &defaultValue, const TQString &name, } -CfgEntry *parseEntry( const TQString &group, const TQDomElement &element ) +CfgEntry *parseEntry( const TTQString &group, const TTQDomElement &element ) { bool defaultCode = false; - TQString type = element.attribute( "type" ); - TQString name = element.attribute( "name" ); - TQString key = element.attribute( "key" ); - TQString hidden = element.attribute( "hidden" ); - TQString label; - TQString whatsThis; - TQString defaultValue; - TQString code; - TQString param; - TQString paramName; - TQString paramType; - TQValueList choices; - TQStringList paramValues; - TQStringList paramDefaultValues; - TQString minValue; - TQString maxValue; + TTQString type = element.attribute( "type" ); + TTQString name = element.attribute( "name" ); + TTQString key = element.attribute( "key" ); + TTQString hidden = element.attribute( "hidden" ); + TTQString label; + TTQString whatsThis; + TTQString defaultValue; + TTQString code; + TTQString param; + TTQString paramName; + TTQString paramType; + TTQValueList choices; + TTQStringList paramValues; + TTQStringList paramDefaultValues; + TTQString minValue; + TTQString maxValue; int paramMax = 0; - TQDomNode n; + TTQDomNode n; for ( n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { - TQDomElement e = n.toElement(); - TQString tag = e.tagName(); + TTQDomElement e = n.toElement(); + TTQString tag = e.tagName(); if ( tag == "label" ) label = e.text(); else if ( tag == "whatsthis" ) whatsThis = e.text(); else if ( tag == "min" ) minValue = e.text(); @@ -382,14 +382,14 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element ) } else if (paramType == "Enum") { - TQDomNode n2; + TTQDomNode n2; for ( n2 = e.firstChild(); !n2.isNull(); n2 = n2.nextSibling() ) { - TQDomElement e2 = n2.toElement(); + TTQDomElement e2 = n2.toElement(); if (e2.tagName() == "values") { - TQDomNode n3; + TTQDomNode n3; for ( n3 = e2.firstChild(); !n3.isNull(); n3 = n3.nextSibling() ) { - TQDomElement e3 = n3.toElement(); + TTQDomElement e3 = n3.toElement(); if (e3.tagName() == "value") { paramValues.append( e3.text() ); @@ -421,18 +421,18 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element ) } } else if ( tag == "choices" ) { - TQDomNode n2; + TTQDomNode n2; for( n2 = e.firstChild(); !n2.isNull(); n2 = n2.nextSibling() ) { - TQDomElement e2 = n2.toElement(); + TTQDomElement e2 = n2.toElement(); if ( e2.tagName() == "choice" ) { - TQDomNode n3; + TTQDomNode n3; CfgEntry::Choice choice; choice.name = e2.attribute( "name" ); if ( choice.name.isEmpty() ) { - kdError() << "Tag requires attribute 'name'." << endl; + kdError() << "Tag retquires attribute 'name'." << endl; } for( n3 = e2.firstChild(); !n3.isNull(); n3 = n3.nextSibling() ) { - TQDomElement e3 = n3.toElement(); + TTQDomElement e3 = n3.toElement(); if ( e3.tagName() == "label" ) choice.label = e3.text(); if ( e3.tagName() == "whatsthis" ) choice.whatsThis = e3.text(); } @@ -454,7 +454,7 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element ) if ( nameIsEmpty ) { name = key; - name.replace( " ", TQString::null ); + name.replace( " ", TTQString::null ); } else if ( name.contains( ' ' ) ) { kdWarning()<<"Entry '"< elements can't contain speces!"< &"; + else if ( type == "IntList" ) return "const TTQValueList &"; else if ( type == "Enum" ) return "int"; - else if ( type == "Path" ) return "const TQString &"; - else if ( type == "Password" ) return "const TQString &"; + else if ( type == "Path" ) return "const TTQString &"; + else if ( type == "Password" ) return "const TTQString &"; else { kdError() <<"rbkconfig_compiler does not support type \""<< type <<"\""<name() ) + "Item"; @@ -678,10 +678,10 @@ static TQString itemVar(const CfgEntry *e) } -TQString newItem( const TQString &type, const TQString &name, const TQString &key, - const TQString &defaultValue, const TQString ¶m = TQString::null) +TTQString newItem( const TTQString &type, const TTQString &name, const TTQString &key, + const TTQString &defaultValue, const TTQString ¶m = TTQString::null) { - TQString t = "Item" + itemType( type ) + + TTQString t = "Item" + itemType( type ) + ".new( currentGroup(), " + key + ", " + varName( name ) + param; if ( type == "Enum" ) { t += ".toInt"; @@ -703,11 +703,11 @@ TQString newItem( const TQString &type, const TQString &name, const TQString &ke return t; } -TQString addItem( const TQString &type, const TQString &name, const TQString &key, - const TQString &defaultValue, const TQString ¶m = TQString::null, - const TQString ¶mName = TQString::null ) +TTQString addItem( const TTQString &type, const TTQString &name, const TTQString &key, + const TTQString &defaultValue, const TTQString ¶m = TTQString::null, + const TTQString ¶mName = TTQString::null ) { - TQString t = "addItem" + itemType( type ) + + TTQString t = "addItem" + itemType( type ) + "( " + key + ", " + varName( name ) + param; if ( type == "Enum" ) t += ", values" + name; if ( !defaultValue.isEmpty() ) { @@ -726,20 +726,20 @@ TQString addItem( const TQString &type, const TQString &name, const TQString &ke return t; } -TQString paramString(const TQString &s, const CfgEntry *e, int i) +TTQString paramString(const TTQString &s, const CfgEntry *e, int i) { - TQString result = s; - TQString needle = "$("+e->param()+")"; + TTQString result = s; + TTQString needle = "$("+e->param()+")"; if (result.contains(needle)) { - TQString tmp; + TTQString tmp; if (e->paramType() == "Enum") { tmp = e->paramValues()[i]; } else { - tmp = TQString::number(i); + tmp = TTQString::number(i); } result.replace(needle, tmp); @@ -747,12 +747,12 @@ TQString paramString(const TQString &s, const CfgEntry *e, int i) return result; } -TQString paramString(const TQString &group, const TQStringList ¶meters) +TTQString paramString(const TTQString &group, const TTQStringList ¶meters) { - TQString paramString = group; - TQString arguments; + TTQString paramString = group; + TTQString arguments; int i = 0; - for( TQStringList::ConstIterator it = parameters.begin(); + for( TTQStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it) { if (paramString.contains("$("+*it+")")) @@ -776,9 +776,9 @@ TQString paramString(const TQString &group, const TQStringList ¶meters) } /* int i is the value of the parameter */ -TQString userTextsFunctions( CfgEntry *e, TQString itemVarStr=TQString::null, TQString i=TQString::null ) +TTQString userTextsFunctions( CfgEntry *e, TTQString itemVarStr=TTQString::null, TTQString i=TTQString::null ) { - TQString txt; + TTQString txt; if (itemVarStr.isNull()) itemVarStr=itemVar(e); if ( !e->label().isEmpty() ) { txt += " " + itemVarStr + ".setLabel( i18n("; @@ -827,35 +827,35 @@ int main( int argc, char **argv ) return 1; } - validNameRegexp = new TQRegExp("[a-zA-Z_][a-zA-Z0-9_]*"); + validNameRegexp = new TTQRegExp("[a-zA-Z_][a-zA-Z0-9_]*"); - TQString baseDir = TQFile::decodeName(args->getOption("directory")); + TTQString baseDir = TTQFile::decodeName(args->getOption("directory")); if (!baseDir.endsWith("/")) baseDir.append("/"); - TQString inputFilename = args->url( 0 ).path(); - TQString codegenFilename = args->url( 1 ).path(); + TTQString inputFilename = args->url( 0 ).path(); + TTQString codegenFilename = args->url( 1 ).path(); if (!codegenFilename.endsWith(".kcfgc")) { kdError() << "Codegen options file must have extension .kcfgc" << endl; return 1; } - TQString baseName = args->url( 1 ).fileName(); + TTQString baseName = args->url( 1 ).fileName(); baseName = baseName.left(baseName.length() - 6); KSimpleConfig codegenConfig( codegenFilename, true ); - TQString nameSpace = codegenConfig.readEntry("NameSpace"); - TQString className = codegenConfig.readEntry("ClassName"); - TQString inherits = codegenConfig.readEntry("Inherits"); - TQString visibility = codegenConfig.readEntry("Visibility"); + TTQString nameSpace = codegenConfig.readEntry("NameSpace"); + TTQString className = codegenConfig.readEntry("ClassName"); + TTQString inherits = codegenConfig.readEntry("Inherits"); + TTQString visibility = codegenConfig.readEntry("Visibility"); if (!visibility.isEmpty()) visibility+=" "; bool singleton = codegenConfig.readBoolEntry("Singleton", false); bool customAddons = codegenConfig.readBoolEntry("CustomAdditions"); - TQString memberVariables = codegenConfig.readEntry("MemberVariables"); - TQStringList headerIncludes = codegenConfig.readListEntry("IncludeFiles"); - TQStringList mutators = codegenConfig.readListEntry("Mutators"); + TTQString memberVariables = codegenConfig.readEntry("MemberVariables"); + TTQStringList headerIncludes = codegenConfig.readListEntry("IncludeFiles"); + TTQStringList mutators = codegenConfig.readListEntry("Mutators"); bool allMutators = false; if ((mutators.count() == 1) && (mutators[0].lower() == "true")) allMutators = true; @@ -864,10 +864,10 @@ int main( int argc, char **argv ) globalEnums = codegenConfig.readBoolEntry( "GlobalEnums", false ); - TQFile input( inputFilename ); + TTQFile input( inputFilename ); - TQDomDocument doc; - TQString errorMsg; + TTQDomDocument doc; + TTQString errorMsg; int errorRow; int errorCol; if ( !doc.setContent( &input, &errorMsg, &errorRow, &errorCol ) ) { @@ -876,52 +876,52 @@ int main( int argc, char **argv ) return 1; } - TQDomElement cfgElement = doc.documentElement(); + TTQDomElement cfgElement = doc.documentElement(); if ( cfgElement.isNull() ) { kdError() << "No document in kcfg file" << endl; return 1; } - TQString cfgFileName; + TTQString cfgFileName; bool cfgFileNameArg = false; - TQStringList parameters; - TQStringList includes; + TTQStringList parameters; + TTQStringList includes; - TQPtrList entries; + TTQPtrList entries; entries.setAutoDelete( true ); - TQDomNode n; + TTQDomNode n; for ( n = cfgElement.firstChild(); !n.isNull(); n = n.nextSibling() ) { - TQDomElement e = n.toElement(); + TTQDomElement e = n.toElement(); - TQString tag = e.tagName(); + TTQString tag = e.tagName(); if ( tag == "include" ) { - TQString includeFile = e.text(); + TTQString includeFile = e.text(); if (!includeFile.isEmpty()) includes.append(includeFile); } else if ( tag == "kcfgfile" ) { cfgFileName = e.attribute( "name" ); cfgFileNameArg = e.attribute( "arg" ).lower() == "true"; - TQDomNode n2; + TTQDomNode n2; for( n2 = e.firstChild(); !n2.isNull(); n2 = n2.nextSibling() ) { - TQDomElement e2 = n2.toElement(); + TTQDomElement e2 = n2.toElement(); if ( e2.tagName() == "parameter" ) { parameters.append( e2.attribute( "name" ) ); } } } else if ( tag == "group" ) { - TQString group = e.attribute( "name" ); + TTQString group = e.attribute( "name" ); if ( group.isEmpty() ) { kdError() << "Group without name" << endl; return 1; } - TQDomNode n2; + TTQDomNode n2; for( n2 = e.firstChild(); !n2.isNull(); n2 = n2.nextSibling() ) { - TQDomElement e2 = n2.toElement(); + TTQDomElement e2 = n2.toElement(); if ( e2.tagName() != "entry" ) continue; CfgEntry *entry = parseEntry( group, e2 ); if ( entry ) entries.append( entry ); @@ -968,22 +968,22 @@ int main( int argc, char **argv ) } #endif - TQString implementationFileName = baseName + ".rb"; + TTQString implementationFileName = baseName + ".rb"; - TQFile implementation( baseDir + implementationFileName ); + TTQFile implementation( baseDir + implementationFileName ); if ( !implementation.open( IO_WriteOnly ) ) { kdError() << "Can't open '" << implementationFileName << "for writing." << endl; return 1; } - TQTextStream rb( &implementation ); + TTQTextStream rb( &implementation ); rb << "# This file is generated by rbkconfig_compiler from " << args->url(0).fileName() << "." << endl; rb << "# All changes you do to this file will be lost." << endl; - rb << endl << "require 'Korundum'" << endl; + rb << endl << "retquire 'Korundum'" << endl; if (singleton) { - rb << "require 'singleton'" << endl; + rb << "retquire 'singleton'" << endl; } rb << endl; @@ -994,7 +994,7 @@ int main( int argc, char **argv ) // << className.upper() << "_H" << endl << endl; // Includes -// TQStringList::ConstIterator it; +// TTQStringList::ConstIterator it; // for( it = headerIncludes.begin(); it != headerIncludes.end(); ++it ) { // rb << "#include <" << *it << ">" << endl; // } @@ -1016,10 +1016,10 @@ int main( int argc, char **argv ) // enums CfgEntry *e; for( e = entries.first(); e; e = entries.next() ) { - TQValueList choices = e->choices(); + TTQValueList choices = e->choices(); if ( !choices.isEmpty() ) { - TQStringList values; - TQValueList::ConstIterator itChoice; + TTQStringList values; + TTQValueList::ConstIterator itChoice; for( itChoice = choices.begin(); itChoice != choices.end(); ++itChoice ) { if (globalEnums) { values.append( enumValue((*itChoice).name) ); @@ -1031,16 +1031,16 @@ int main( int argc, char **argv ) values.append( enumName(e->name()) + "_COUNT" ); } int count = 0; - for ( TQStringList::Iterator it = values.begin(); it != values.end(); ++it, count++ ) { + for ( TTQStringList::Iterator it = values.begin(); it != values.end(); ++it, count++ ) { rb << " " << *it << " = " << count << endl; } rb << endl; } - TQStringList values = e->paramValues(); + TTQStringList values = e->paramValues(); if ( !values.isEmpty() ) { int count = 0; - for ( TQStringList::Iterator it = values.begin(); it != values.end(); ++it, count++ ) { + for ( TTQStringList::Iterator it = values.begin(); it != values.end(); ++it, count++ ) { if (globalEnums) { rb << " " << enumValue(*it) << " = " << count << endl; } else { @@ -1055,7 +1055,7 @@ int main( int argc, char **argv ) rb << " def " << enumName(e->param()) << "ToString(i)" << endl; rb << " ["; count = 0; - for ( TQStringList::Iterator it = values.begin(); it != values.end(); ++it, count++ ) { + for ( TTQStringList::Iterator it = values.begin(); it != values.end(); ++it, count++ ) { if (count > 0) { rb << ", "; } @@ -1071,8 +1071,8 @@ int main( int argc, char **argv ) rb << endl; for( e = entries.first(); e; e = entries.next() ) { - TQString n = e->name(); - TQString t = e->type(); + TTQString n = e->name(); + TTQString t = e->type(); // Manipulator if (allMutators || mutators.contains(n)) @@ -1104,7 +1104,7 @@ int main( int argc, char **argv ) rb << " item.property = " << varName(n); if (!e->param().isEmpty()) rb << "[i]"; - rb << " = Qt::Variant.new( v )" << endl; + rb << " = TQt::Variant.new( v )" << endl; rb << " end" << endl; rb << " end" << endl << endl; } @@ -1180,7 +1180,7 @@ int main( int argc, char **argv ) rb << " def initialize( "; if (cfgFileNameArg) rb << " config" << (parameters.isEmpty() ? " " : ", "); - for (TQStringList::ConstIterator it = parameters.begin(); + for (TTQStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it) { if (it != parameters.begin()) @@ -1196,13 +1196,13 @@ int main( int argc, char **argv ) rb << ")" << endl; // Store parameters - for (TQStringList::ConstIterator it = parameters.begin(); + for (TTQStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it) { - rb << " @param" << *it << " = Qt::Variant.new( " << *it << " )" << endl; + rb << " @param" << *it << " = TQt::Variant.new( " << *it << " )" << endl; } - TQString group; + TTQString group; for( e = entries.first(); e; e = entries.next() ) { if ( e->group() != group ) { group = e->group(); @@ -1210,14 +1210,14 @@ int main( int argc, char **argv ) rb << " # " << group << endl; } if (e->param().isEmpty()) { - rb << " " << varName(e->name()) << " = Qt::Variant.new( " << rbType(e->type()) << " )"; + rb << " " << varName(e->name()) << " = TQt::Variant.new( " << rbType(e->type()) << " )"; } else { rb << " " << varName(e->name()) << " = [ "; for (int i = 0; i < e->paramMax()+1; i++) { if (i > 0) { rb << ", "; } - rb << "Qt::Variant.new( " << rbType(e->type()) << " )"; + rb << "TQt::Variant.new( " << rbType(e->type()) << " )"; } rb << " ]"; } @@ -1227,7 +1227,7 @@ int main( int argc, char **argv ) rb << endl; - group = TQString::null; + group = TTQString::null; for( e = entries.first(); e; e = entries.next() ) { if ( e->group() != group ) { if ( !group.isEmpty() ) rb << endl; @@ -1235,7 +1235,7 @@ int main( int argc, char **argv ) rb << " setCurrentGroup( " << paramString(group, parameters) << " )" << endl << endl; } - TQString key = paramString(e->key(), parameters); + TTQString key = paramString(e->key(), parameters); if ( !e->code().isEmpty()) { rb << e->code() << endl; @@ -1243,8 +1243,8 @@ int main( int argc, char **argv ) if ( e->type() == "Enum" ) { rb << " values" << e->name() << " = []" << endl; - TQValueList choices = e->choices(); - TQValueList::ConstIterator it; + TTQValueList choices = e->choices(); + TTQValueList::ConstIterator it; for( it = choices.begin(); it != choices.end(); ++it ) { rb << " choice = ItemEnum::Choice.new" << endl; rb << " choice.name = \"" << enumValue((*it).name) << "\" " << endl; @@ -1275,7 +1275,7 @@ int main( int argc, char **argv ) rb << userTextsFunctions( e ); rb << " addItem( " << itemVar(e); - TQString quotedName = e->name(); + TTQString quotedName = e->name(); addQuotes( quotedName ); if ( quotedName != key ) rb << ", \"" << e->name() << "\""; rb << " )" << endl; @@ -1286,8 +1286,8 @@ int main( int argc, char **argv ) rb << " " << itemVar(e) << " = Array.new(" << e->paramMax()+1 << ")" << endl; for(int i = 0; i <= e->paramMax(); i++) { - TQString defaultStr; - TQString itemVarStr(itemVar(e)+TQString("[%1]").arg(i)); + TTQString defaultStr; + TTQString itemVarStr(itemVar(e)+TTQString("[%1]").arg(i)); if ( !e->paramDefaultValue(i).isEmpty() ) defaultStr = e->paramDefaultValue(i); @@ -1297,10 +1297,10 @@ int main( int argc, char **argv ) defaultStr = defaultValue( e->type() ); rb << " " << itemVarStr << " = " - << newItem( e->type(), e->name(), paramString(key, e, i), defaultStr, TQString("[%1]").arg(i) ) + << newItem( e->type(), e->name(), paramString(key, e, i), defaultStr, TTQString("[%1]").arg(i) ) << endl; - rb << " " << itemVarStr << ".property = " << varName(e->name())+TQString("[%1]").arg(i) << endl; + rb << " " << itemVarStr << ".property = " << varName(e->name())+TTQString("[%1]").arg(i) << endl; if ( setUserTexts ) rb << userTextsFunctions( e, itemVarStr, e->paramName() ); diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test1.kcfg b/korundum/rubylib/rbkconfig_compiler/tests/test1.kcfg index 0c0c8216..b8c23c15 100644 --- a/korundum/rubylib/rbkconfig_compiler/tests/test1.kcfg +++ b/korundum/rubylib/rbkconfig_compiler/tests/test1.kcfg @@ -35,7 +35,7 @@ - Qt::Dir.homeDirPath()+".hidden_file" + TQt::Dir.homeDirPath()+".hidden_file" diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test1main.rb b/korundum/rubylib/rbkconfig_compiler/tests/test1main.rb index 88a151a6..131287bd 100644 --- a/korundum/rubylib/rbkconfig_compiler/tests/test1main.rb +++ b/korundum/rubylib/rbkconfig_compiler/tests/test1main.rb @@ -1,4 +1,4 @@ -require 'Korundum' -require 'test1.rb' +retquire 'Korundum' +retquire 'test1.rb' t = Test1.new(nil, nil) diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test2main.rb b/korundum/rubylib/rbkconfig_compiler/tests/test2main.rb index 85d18f07..bf56014f 100644 --- a/korundum/rubylib/rbkconfig_compiler/tests/test2main.rb +++ b/korundum/rubylib/rbkconfig_compiler/tests/test2main.rb @@ -1,5 +1,5 @@ -require 'Korundum' -require 'myprefs.rb' -require 'test2.rb' +retquire 'Korundum' +retquire 'myprefs.rb' +retquire 'test2.rb' t = Test2.new() diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test3main.rb b/korundum/rubylib/rbkconfig_compiler/tests/test3main.rb index 8c19b442..f6ab27fc 100644 --- a/korundum/rubylib/rbkconfig_compiler/tests/test3main.rb +++ b/korundum/rubylib/rbkconfig_compiler/tests/test3main.rb @@ -1,4 +1,4 @@ -require 'Korundum' -require 'test3.rb' +retquire 'Korundum' +retquire 'test3.rb' t = TestNameSpace::Test3.new() diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test4.kcfg b/korundum/rubylib/rbkconfig_compiler/tests/test4.kcfg index 1428bc0d..c834aa9f 100644 --- a/korundum/rubylib/rbkconfig_compiler/tests/test4.kcfg +++ b/korundum/rubylib/rbkconfig_compiler/tests/test4.kcfg @@ -9,7 +9,7 @@ - defaultColor = [ Qt::red, Qt::blue, Qt::green, Qt::black ] + defaultColor = [ TQt::red, TQt::blue, TQt::green, TQt::black ] defaultColor[$(Number)] diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test4main.rb b/korundum/rubylib/rbkconfig_compiler/tests/test4main.rb index c75f0995..87bd2657 100644 --- a/korundum/rubylib/rbkconfig_compiler/tests/test4main.rb +++ b/korundum/rubylib/rbkconfig_compiler/tests/test4main.rb @@ -1,4 +1,4 @@ -require 'Korundum' -require 'test4.rb' +retquire 'Korundum' +retquire 'test4.rb' t = Test4.instance() diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test5.kcfg b/korundum/rubylib/rbkconfig_compiler/tests/test5.kcfg index 1428bc0d..c834aa9f 100644 --- a/korundum/rubylib/rbkconfig_compiler/tests/test5.kcfg +++ b/korundum/rubylib/rbkconfig_compiler/tests/test5.kcfg @@ -9,7 +9,7 @@ - defaultColor = [ Qt::red, Qt::blue, Qt::green, Qt::black ] + defaultColor = [ TQt::red, TQt::blue, TQt::green, TQt::black ] defaultColor[$(Number)] diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test5main.rb b/korundum/rubylib/rbkconfig_compiler/tests/test5main.rb index cd0fbeb7..94966a1a 100644 --- a/korundum/rubylib/rbkconfig_compiler/tests/test5main.rb +++ b/korundum/rubylib/rbkconfig_compiler/tests/test5main.rb @@ -1,4 +1,4 @@ -require 'Korundum' -require 'test5.rb' +retquire 'Korundum' +retquire 'test5.rb' t = Test5.instance() -- cgit v1.2.1