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
This commit is contained in:
Thorbjørn Lindeijer
2009-03-20 17:01:16 +01:00
parent 71aeac5915
commit c6d326c0bf
2 changed files with 13 additions and 8 deletions

View File

@@ -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;
}