Commit 70cf2c76 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Fixes: Use common default for lower casing file names

parent bccf4a1f
......@@ -51,7 +51,7 @@ 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_lowerCaseFileName(false)
m_lowerCaseFileName(true)
{
QTC_ASSERT(m_nameRegexp.isValid(), return);
}
......
......@@ -94,10 +94,11 @@ ClassNamePage::ClassNamePage(QWidget *parent) :
// Retrieve settings of CppTools plugin.
static inline bool lowerCaseFiles(const Core::ICore *core)
{
QString camelCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP);
camelCaseSettingsKey += QLatin1Char('/');
camelCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY);
return core->settings()->value(camelCaseSettingsKey, QVariant(false)).toBool();
QString lowerCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP);
lowerCaseSettingsKey += QLatin1Char('/');
lowerCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY);
const bool lowerCaseDefault = CppTools::Constants::lowerCaseFilesDefault;
return core->settings()->value(lowerCaseSettingsKey, QVariant(lowerCaseDefault)).toBool();
}
// Set up new class widget from settings
......
......@@ -64,7 +64,8 @@ void CppFileSettings::fromSettings(QSettings *s)
s->beginGroup(QLatin1String(Constants::CPPTOOLS_SETTINGSGROUP));
headerSuffix= s->value(QLatin1String(headerSuffixKeyC), QLatin1String("h")).toString();
sourceSuffix = s->value(QLatin1String(sourceSuffixKeyC), QLatin1String("cpp")).toString();
lowerCaseFiles = s->value(QLatin1String(Constants::LOWERCASE_CPPFILES_KEY), QVariant(true)).toBool();
const bool lowerCaseDefault = Constants::lowerCaseFilesDefault;
lowerCaseFiles = s->value(QLatin1String(Constants::LOWERCASE_CPPFILES_KEY), QVariant(lowerCaseDefault)).toBool();
s->endGroup();
}
......
......@@ -46,6 +46,7 @@ const char * const CPP_HEADER_MIMETYPE = "text/x-c++hdr";
// QSettings keys for use by the "New Class" wizards.
const char * const CPPTOOLS_SETTINGSGROUP = "CppTools";
const char * const LOWERCASE_CPPFILES_KEY = "LowerCaseFiles";
enum { lowerCaseFilesDefault = 1 };
const char * const CPP_SETTINGS_ID = QT_TRANSLATE_NOOP("CppTools", "File naming conventions");
const char * const CPP_SETTINGS_CATEGORY = QT_TRANSLATE_NOOP("CppTools", "C++");
......
......@@ -67,10 +67,11 @@ QString FormClassWizard::formSuffix() const
// Retrieve settings of CppTools plugin.
static inline bool lowerCaseFiles()
{
QString camelCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP);
camelCaseSettingsKey += QLatin1Char('/');
camelCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY);
return Core::ICore::instance()->settings()->value(camelCaseSettingsKey, QVariant(false)).toBool();
QString lowerCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP);
lowerCaseSettingsKey += QLatin1Char('/');
lowerCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY);
const bool lowerCaseDefault = CppTools::Constants::lowerCaseFilesDefault;
return Core::ICore::instance()->settings()->value(lowerCaseSettingsKey, QVariant(lowerCaseDefault)).toBool();
}
QWizard *FormClassWizard::createWizardDialog(QWidget *parent,
......
......@@ -84,6 +84,7 @@ static inline bool lowerCaseFiles(const Core::ICore *core)
QString camelCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP);
camelCaseSettingsKey += QLatin1Char('/');
camelCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY);
return core->settings()->value(camelCaseSettingsKey, QVariant(false)).toBool();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment