forked from qt-creator/qt-creator
TextEditor: Remove obsolete "customized.xml" feature
In case the qtcreator.ini has a TextEditor section without a defined ColorScheme value, Qt Creator decides to create a new "styles/customized %i.xml" and select that as scheme. I assume that this was implemented way back then, as migration code when selectable Color Schemes were introduced. These days, it makes maintenance (and implementation of QTCREATORBUG-15229) more difficult. Let's remove it. Task-number: QTCREATORBUG-15649 Change-Id: I49102d02fa8e582a92f6e39faa8c7d3b58f531b3 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -175,42 +175,12 @@ FontSettingsPagePrivate::FontSettingsPagePrivate(const FormatDescriptions &fd,
|
||||
m_schemeListModel(new SchemeListModel),
|
||||
m_refreshingSchemeList(false)
|
||||
{
|
||||
bool settingsFound = false;
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
if (settings)
|
||||
settingsFound = m_value.fromSettings(m_settingsGroup, m_descriptions, settings);
|
||||
m_value.fromSettings(m_settingsGroup, m_descriptions, settings);
|
||||
|
||||
if (!settingsFound) { // Apply defaults
|
||||
foreach (const FormatDescription &f, m_descriptions) {
|
||||
Format &format = m_value.formatFor(f.id());
|
||||
format.setForeground(f.foreground());
|
||||
format.setBackground(f.background());
|
||||
format.setBold(f.format().bold());
|
||||
format.setItalic(f.format().italic());
|
||||
format.setUnderlineColor(f.format().underlineColor());
|
||||
format.setUnderlineStyle(f.format().underlineStyle());
|
||||
}
|
||||
} else if (m_value.colorSchemeFileName().isEmpty()) {
|
||||
// No color scheme was loaded, but one might be imported from the ini file
|
||||
ColorScheme defaultScheme;
|
||||
foreach (const FormatDescription &f, m_descriptions) {
|
||||
Format &format = defaultScheme.formatFor(f.id());
|
||||
format.setForeground(f.foreground());
|
||||
format.setBackground(f.background());
|
||||
format.setBold(f.format().bold());
|
||||
format.setItalic(f.format().italic());
|
||||
format.setUnderlineColor(f.format().underlineColor());
|
||||
format.setUnderlineStyle(f.format().underlineStyle());
|
||||
}
|
||||
if (m_value.colorScheme() != defaultScheme) {
|
||||
// Save it as a color scheme file
|
||||
QString schemeFileName = createColorSchemeFileName(QLatin1String("customized%1.xml"));
|
||||
if (!schemeFileName.isEmpty()) {
|
||||
if (m_value.saveColorScheme(schemeFileName) && settings)
|
||||
m_value.toSettings(m_settingsGroup, settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m_value.colorSchemeFileName().isEmpty())
|
||||
m_value.loadColorScheme(FontSettings::defaultSchemeFileName(), m_descriptions);
|
||||
|
||||
m_lastValue = m_value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user