Fixes: Introduce a cpp settingspage containing file naming conventions (lower case and suffixes). Reorder VCS settings pages.

Task: 241959, 248085

RevBy: Optics/Naming checked by con
Details: Give IOptionPage an id() to differentiate from trName(). Make showOptionsDialog return a bool (applied) and give it an optional parent. Change Cpp and form class wizards, give them a Configure... button to change those settings.
This commit is contained in:
Friedemann Kleint
2009-03-18 16:43:01 +01:00
parent 3b0305727b
commit bccf4a1fc3
66 changed files with 814 additions and 150 deletions

View File

@@ -43,13 +43,15 @@ struct ClassNameValidatingLineEditPrivate {
const QRegExp m_nameRegexp;
const QString m_namespaceDelimiter;
bool m_namespacesEnabled;
bool m_lowerCaseFileName;
};
// Match something like "Namespace1::Namespace2::ClassName".
ClassNameValidatingLineEditPrivate:: ClassNameValidatingLineEditPrivate() :
m_nameRegexp(QLatin1String("[a-zA-Z_][a-zA-Z0-9_]*(::[a-zA-Z_][a-zA-Z0-9_]*)*")),
m_namespaceDelimiter(QLatin1String("::")),
m_namespacesEnabled(false)
m_namespacesEnabled(false),
m_lowerCaseFileName(false)
{
QTC_ASSERT(m_nameRegexp.isValid(), return);
}
@@ -96,7 +98,7 @@ void ClassNameValidatingLineEdit::slotChanged(const QString &t)
Core::Utils::BaseValidatingLineEdit::slotChanged(t);
if (isValid()) {
// Suggest file names, strip namespaces
QString fileName = t.toLower();
QString fileName = m_d->m_lowerCaseFileName ? t.toLower() : t;
if (m_d->m_namespacesEnabled) {
const int namespaceIndex = fileName.lastIndexOf(m_d->m_namespaceDelimiter);
if (namespaceIndex != -1)
@@ -132,5 +134,15 @@ QString ClassNameValidatingLineEdit::createClassName(const QString &name)
return className;
}
bool ClassNameValidatingLineEdit::lowerCaseFileName() const
{
return m_d->m_lowerCaseFileName;
}
void ClassNameValidatingLineEdit::setLowerCaseFileName(bool v)
{
m_d->m_lowerCaseFileName = v;
}
} // namespace Utils
} // namespace Core