Fix build with Qt4.

master
Torsten Paul 2014-12-30 13:03:51 +01:00
parent bc30dca513
commit 8d4d83f168
3 changed files with 17 additions and 11 deletions

View File

@ -474,13 +474,13 @@ void Preferences::on_launcherBox_toggled(bool state)
void Preferences::on_spinBoxIndentationWidth_valueChanged(int val)
{
Settings::Settings::inst()->set(Settings::Settings::indentationWidth, Value(val));
fireEditorConfigChanged();
writeSettings();
}
void Preferences::on_spinBoxTabWidth_valueChanged(int val)
{
Settings::Settings::inst()->set(Settings::Settings::tabWidth, Value(val));
fireEditorConfigChanged();
writeSettings();
}
void Preferences::on_comboBoxLineWrap_activated(int val)
@ -496,7 +496,7 @@ void Preferences::on_comboBoxLineWrapIndentationStyle_activated(int val)
void Preferences::on_spinBoxLineWrapIndentationIndent_valueChanged(int val)
{
Settings::Settings::inst()->set(Settings::Settings::lineWrapIndentation, Value(val));
fireEditorConfigChanged();
writeSettings();
}
void Preferences::on_comboBoxLineWrapVisualizationStart_activated(int val)
@ -517,13 +517,13 @@ void Preferences::on_comboBoxShowWhitespace_activated(int val)
void Preferences::on_spinBoxShowWhitespaceSize_valueChanged(int val)
{
Settings::Settings::inst()->set(Settings::Settings::showWhitespaceSize, Value(val));
fireEditorConfigChanged();
writeSettings();
}
void Preferences::on_checkBoxAutoIndent_toggled(bool val)
{
Settings::Settings::inst()->set(Settings::Settings::autoIndent, Value(val));
fireEditorConfigChanged();
writeSettings();
}
void Preferences::on_comboBoxIndentUsing_activated(int val)
@ -539,19 +539,24 @@ void Preferences::on_comboBoxTabKeyFunction_activated(int val)
void Preferences::on_checkBoxHighlightCurrentLine_toggled(bool val)
{
Settings::Settings::inst()->set(Settings::Settings::highlightCurrentLine, Value(val));
fireEditorConfigChanged();
writeSettings();
}
void Preferences::on_checkBoxEnableBraceMatching_toggled(bool val)
{
Settings::Settings::inst()->set(Settings::Settings::enableBraceMatching, Value(val));
writeSettings();
}
void Preferences::writeSettings()
{
SettingsWriter settingsWriter;
Settings::Settings::inst()->visit(settingsWriter);
fireEditorConfigChanged();
}
void Preferences::fireEditorConfigChanged() const
{
SettingsWriter settingsWriter;
Settings::Settings::inst()->visit(settingsWriter);
emit editorConfigChanged();
}
@ -709,7 +714,7 @@ void Preferences::applyComboBox(QComboBox *comboBox, int val, Settings::Settings
{
QString s = comboBox->itemData(val).toString();
Settings::Settings::inst()->set(entry, Value(s.toStdString()));
fireEditorConfigChanged();
writeSettings();
}
void Preferences::apply() const

View File

@ -20,6 +20,7 @@ public:
QVariant getValue(const QString &key) const;
void init();
void apply() const;
void fireEditorConfigChanged() const;
public slots:
void actionTriggered(class QAction *);
@ -87,7 +88,7 @@ private:
void updateGUI();
void removeDefaultSettings();
void setupFeaturesPage();
void fireEditorConfigChanged() const;
void writeSettings();
void addPrefPage(QActionGroup *group, QAction *action, QWidget *widget);
/** Initialize combobox list values from the settings range values */

View File

@ -204,7 +204,7 @@ MainWindow::MainWindow(const QString &filename)
#ifdef USE_SCINTILLA_EDITOR
if (useScintilla) {
connect(Preferences::inst(), SIGNAL(editorConfigChanged()), editor, SLOT(applySettings()));
Preferences::inst()->editorConfigChanged();
Preferences::inst()->fireEditorConfigChanged();
}
#endif