[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdelibs/kdecore/kconfig_compiler
From: Waldo Bastian <bastian () kde ! org>
Date: 2004-10-25 20:07:09
Message-ID: 20041025200709.839A716C28 () office ! kde ! org
[Download RAW message or body]
CVS commit by waba:
* Fix global enums (patch by mETz)
* NO_ASCII_CAST fixes
M +15 -3 kconfig_compiler.cpp 1.55
--- kdelibs/kdecore/kconfig_compiler/kconfig_compiler.cpp #1.54:1.55
@@ -221,4 +221,16 @@ static QString quoteString( const QStrin
}
+static QString literalString( const QString &s )
+{
+ bool isAscii = true;
+ for(int i = s.length(); i--;)
+ if (s[i].unicode() > 127) isAscii = false;
+
+ if (isAscii)
+ return "QString::fromLatin1( " + quoteString(s) + " )";
+ else
+ return "QString::fromUtf8( " + quoteString(s) + " )";
+}
+
static QString dumpNode(const QDomNode &node)
{
@@ -247,8 +259,8 @@ static void preProcessDefault( QString &
{
if ( type == "String" && !defaultValue.isEmpty() ) {
- addQuotes( defaultValue );
+ defaultValue = literalString(defaultValue);
} else if ( type == "Path" && !defaultValue.isEmpty() ) {
- addQuotes( defaultValue );
+ defaultValue = literalString( defaultValue );
} else if ( type == "StringList" && !defaultValue.isEmpty() ) {
@@ -1022,5 +1034,5 @@ int main( int argc, char **argv )
h << "QString::fromLatin1( ";
if (globalEnums)
- h << enumName(e->name()) << "ToString[i]";
+ h << enumName(e->param()) << "ToString[i]";
else
h << enumName(e->param()) << "::enumToString[i]";
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic