Skip to content

Commit 55145fc

Browse files
committed
LineSymbolSettings: Remove duplicate initializations
All displayed values are initialized in updateContents(). Initialization in the constructor is redundant and may lead to errors such as #1026 when add new elements.
1 parent 9e79ead commit 55145fc

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/gui/symbols/line_symbol_settings.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ LineSymbolSettings::LineSymbolSettings(LineSymbol* symbol, SymbolSettingDialog*
9494
line_cap_combo->addItem(tr("round"), QVariant(LineSymbol::RoundCap));
9595
line_cap_combo->addItem(tr("square"), QVariant(LineSymbol::SquareCap));
9696
line_cap_combo->addItem(tr("pointed"), QVariant(LineSymbol::PointedCap));
97-
line_cap_combo->setCurrentIndex(line_cap_combo->findData(symbol->cap_style));
9897

9998
pointed_cap_length_label = new QLabel(tr("Cap length:"));
10099
pointed_cap_length_edit = Util::SpinBox::create(2, 0.0, 999999.9, tr("mm"));
@@ -104,13 +103,10 @@ LineSymbolSettings::LineSymbolSettings(LineSymbol* symbol, SymbolSettingDialog*
104103
line_join_combo->addItem(tr("miter"), QVariant(LineSymbol::MiterJoin));
105104
line_join_combo->addItem(tr("round"), QVariant(LineSymbol::RoundJoin));
106105
line_join_combo->addItem(tr("bevel"), QVariant(LineSymbol::BevelJoin));
107-
line_join_combo->setCurrentIndex(line_join_combo->findData(symbol->join_style));
108106

109107
dashed_check = new QCheckBox(tr("Line is dashed"));
110-
dashed_check->setChecked(symbol->dashed);
111108

112109
border_check = new QCheckBox(tr("Enable border lines"));
113-
border_check->setChecked(symbol->have_border_lines);
114110

115111
line_settings_list = {
116112
minimum_length_label, minimum_length_edit,
@@ -152,13 +148,11 @@ LineSymbolSettings::LineSymbolSettings(LineSymbol* symbol, SymbolSettingDialog*
152148
dash_group_combo->addItem(tr("2"), QVariant(2));
153149
dash_group_combo->addItem(tr("3"), QVariant(3));
154150
dash_group_combo->addItem(tr("4"), QVariant(4));
155-
dash_group_combo->setCurrentIndex(dash_group_combo->findData(QVariant(symbol->dashes_in_group)));
156151

157152
in_group_break_length_label = new QLabel(tr("In-group break length:"));
158153
in_group_break_length_edit = Util::SpinBox::create(2, 0.0, 999999.9, tr("mm"));
159154

160155
half_outer_dashes_check = new QCheckBox(tr("Half length of first and last dash"));
161-
half_outer_dashes_check->setChecked(symbol->half_outer_dashes);
162156

163157
dashed_widget_list = {
164158
dash_length_label, dash_length_edit,
@@ -216,7 +210,6 @@ LineSymbolSettings::LineSymbolSettings(LineSymbol* symbol, SymbolSettingDialog*
216210
end_length_edit = Util::SpinBox::create(2, 0.0, 999999.9, tr("mm"));
217211

218212
show_at_least_one_symbol_check = new QCheckBox(tr("Show at least one mid symbol"));
219-
show_at_least_one_symbol_check->setChecked(symbol->show_at_least_one_symbol);
220213

221214
auto minimum_mid_symbol_count_label = new QLabel(tr("Minimum mid symbol count:"));
222215
minimum_mid_symbol_count_edit = Util::SpinBox::create(0, 99);
@@ -256,7 +249,6 @@ LineSymbolSettings::LineSymbolSettings(LineSymbol* symbol, SymbolSettingDialog*
256249
layout->addWidget(border_check, row, col, 1, -1);
257250

258251
different_borders_check = new QCheckBox(tr("Different borders on left and right sides"));
259-
different_borders_check->setChecked(symbol->areBordersDifferent());
260252
row++; col = 0;
261253
layout->addWidget(different_borders_check, row, col, 1, -1);
262254

@@ -286,12 +278,10 @@ LineSymbolSettings::LineSymbolSettings(LineSymbol* symbol, SymbolSettingDialog*
286278
layout->addWidget(Util::Headline::create(tr("Dash symbol")), row, col++, 1, -1);
287279

288280
supress_dash_symbol_check = new QCheckBox(tr("Suppress the dash symbol at line start and line end"));
289-
supress_dash_symbol_check->setChecked(symbol->getSuppressDashSymbolAtLineEnds());
290281
row++; col = 0;
291282
layout->addWidget(supress_dash_symbol_check, row, col, 1, -1);
292283

293284
scale_dash_symbol_check = new QCheckBox(tr("Scale the dash symbol at corners"));
294-
scale_dash_symbol_check->setChecked(symbol->getScaleDashSymbol());
295285
row++; col = 0;
296286
layout->addWidget(scale_dash_symbol_check, row, col, 1, -1);
297287

0 commit comments

Comments
 (0)