forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user