MCPcopy Create free account
hub / github.com/KDE/kdevelop / selectFormatter

Method selectFormatter

kdevplatform/shell/sourceformatterselectionedit.cpp:1022–1042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1020}
1021
1022void SourceFormatterSelectionEdit::selectFormatter(int index)
1023{
1024 Q_D(SourceFormatterSelectionEdit);
1025
1026 Q_ASSERT(index >= 0);
1027 Q_ASSERT(d->ui.cbFormatters->currentIndex() == index);
1028
1029 const bool styleWasSelected = d->currentLanguage().selectedStyle();
1030
1031 Q_ASSERT(&d->currentLanguage().selectedFormatter() != &d->formatterSelectedInUi());
1032 d->currentLanguage().setSelectedFormatter(d->formatterSelectedInUi());
1033
1034 d->updateUiForCurrentFormatter();
1035
1036 // Switching between formatters does not affect configuration if style remains
1037 // unselected => don't emit changed() then.
1038 Q_ASSERT(!d->currentLanguage().selectedStyle());
1039 if (styleWasSelected) {
1040 emit changed();
1041 }
1042}
1043
1044void SourceFormatterSelectionEdit::styleSelectionChanged()
1045{

Callers

nothing calls this directly

Calls 4

selectedStyleMethod · 0.80
setSelectedFormatterMethod · 0.80
currentIndexMethod · 0.45

Tested by

no test coverage detected