| 1020 | } |
| 1021 | |
| 1022 | void 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 | |
| 1044 | void SourceFormatterSelectionEdit::styleSelectionChanged() |
| 1045 | { |
nothing calls this directly
no test coverage detected