Skip to content

Commit 7518ce2

Browse files
committed
Fix problem with the loading of the word wrapping setting
All settings are reloaded in `reloadSettings` and not only the ones set in Preferences. This is important for the Scintilla word wrapping, otherwise the value is changed in the base class (for Execute SQL). Now it is correctly overwritten after calling `sciEdit->reloadSettings();`. See issue #3753 and #3061.
1 parent 1edd9fb commit 7518ce2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/EditDialog.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,6 @@ EditDialog::EditDialog(QWidget* parent)
9595
});
9696
connect(ui->actionOpenInExternal, &QAction::triggered, this, &EditDialog::openDataWithExternal);
9797

98-
mustIndentAndCompact = Settings::getValue("databrowser", "indent_compact").toBool();
99-
ui->actionIndent->setChecked(mustIndentAndCompact);
100-
101-
ui->buttonAutoSwitchMode->setChecked(Settings::getValue("databrowser", "auto_switch_mode").toBool());
102-
ui->actionWordWrap->setChecked(Settings::getValue("databrowser", "editor_word_wrap").toBool());
103-
setWordWrapping(ui->actionWordWrap->isChecked());
104-
10598
reloadSettings();
10699
}
107100

@@ -1136,6 +1129,11 @@ void EditDialog::updateCellInfoAndMode(const QByteArray& bArrdata)
11361129

11371130
void EditDialog::reloadSettings()
11381131
{
1132+
mustIndentAndCompact = Settings::getValue("databrowser", "indent_compact").toBool();
1133+
ui->actionIndent->setChecked(mustIndentAndCompact);
1134+
1135+
ui->buttonAutoSwitchMode->setChecked(Settings::getValue("databrowser", "auto_switch_mode").toBool());
1136+
11391137
// Set the (SQL) editor font for hex editor, since it needs a
11401138
// Monospace font and the databrowser font would be usually of
11411139
// variable width.
@@ -1152,6 +1150,9 @@ void EditDialog::reloadSettings()
11521150
(Settings::getValue("General", "toolbarStyleEditCell").toInt()));
11531151

11541152
sciEdit->reloadSettings();
1153+
1154+
ui->actionWordWrap->setChecked(Settings::getValue("databrowser", "editor_word_wrap").toBool());
1155+
setWordWrapping(ui->actionWordWrap->isChecked());
11551156
}
11561157

11571158
void EditDialog::setStackCurrentIndex(int editMode)

0 commit comments

Comments
 (0)