summaryrefslogtreecommitdiff
path: root/src/libs/utils/codegeneration.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-03-20 17:01:16 +0100
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-03-20 17:04:23 +0100
commitc6d326c0bf2e2b1a7987fbf28f4ac0421ff1766f (patch)
treec9c5279ea353e693333e57d033d00de78014266a /src/libs/utils/codegeneration.cpp
parent71aeac5915880091f024b93869568fbeb2b016a0 (diff)
downloadqt-creator-c6d326c0bf2e2b1a7987fbf28f4ac0421ff1766f.tar.gz
Some fixes to the new class wizard code generation
* Convert dots in filenames to underscores in header guards * Don't indent closing namespaces in source file * Consistent empty line placement
Diffstat (limited to 'src/libs/utils/codegeneration.cpp')
-rw-r--r--src/libs/utils/codegeneration.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libs/utils/codegeneration.cpp b/src/libs/utils/codegeneration.cpp
index 14448ea4b7..7e019b67c2 100644
--- a/src/libs/utils/codegeneration.cpp
+++ b/src/libs/utils/codegeneration.cpp
@@ -41,11 +41,14 @@ static QString toAlphaNum(const QString &s)
QString rc;
const int len = s.size();
const QChar underscore = QLatin1Char('_');
+ const QChar dot = QLatin1Char('.');
for (int i = 0; i < len; i++) {
const QChar c = s.at(i);
if (c == underscore || c.isLetterOrNumber())
rc += c;
+ else if (c == dot)
+ rc += underscore;
}
return rc;
}
@@ -80,7 +83,6 @@ QString writeOpeningNameSpaces(const QStringList &l, const QString &indent,
str << rc << "namespace " << l.at(i) << " {\n";
rc += indent;
}
- str << '\n';
}
return rc;
}