| 73 | } |
| 74 | |
| 75 | void AStylePreferences::init() |
| 76 | { |
| 77 | // setup list widget to have checked items |
| 78 | for(int i = 0; i < listIdentObjects->count(); i++) { |
| 79 | QListWidgetItem *item = listIdentObjects->item(i); |
| 80 | item->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); |
| 81 | item->setCheckState(Qt::Checked); |
| 82 | } |
| 83 | |
| 84 | connect(tabWidget, &QTabWidget::currentChanged, this, &AStylePreferences::currentTabChanged); |
| 85 | |
| 86 | connect(cbIndentType, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &AStylePreferences::indentChanged); |
| 87 | connect(inpNuberSpaces, QOverload<int>::of(&QSpinBox::valueChanged), this, &AStylePreferences::indentChanged); |
| 88 | connect(chkConvertTabs, &QCheckBox::stateChanged, this, &AStylePreferences::indentChanged); |
| 89 | connect(chkFillEmptyLines, &QCheckBox::stateChanged, this, &AStylePreferences::indentChanged); |
| 90 | |
| 91 | connect(listIdentObjects, &QListWidget::itemChanged, |
| 92 | this, &AStylePreferences::indentObjectsChanged); |
| 93 | |
| 94 | connect(inpMaxStatement, QOverload<int>::of(&QSpinBox::valueChanged), this, &AStylePreferences::minMaxValuesChanged); |
| 95 | connect(inpMinConditional, QOverload<int>::of(&QSpinBox::valueChanged), this, &AStylePreferences::minMaxValuesChanged); |
| 96 | |
| 97 | connect(cbBrackets, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &AStylePreferences::bracketsChanged); |
| 98 | connect(chkBracketsCloseHeaders, &QCheckBox::stateChanged, this, &AStylePreferences::bracketsChanged); |
| 99 | connect(chkBracesAdd, &QCheckBox::stateChanged, this, &AStylePreferences::bracketsChanged); |
| 100 | |
| 101 | connect(chkBlockBreak, &QCheckBox::stateChanged, this, &AStylePreferences::blocksChanged); |
| 102 | connect(chkBlockBreakAll, &QCheckBox::stateChanged, this, &AStylePreferences::blocksChanged); |
| 103 | connect(chkBlockIfElse, &QCheckBox::stateChanged, this, &AStylePreferences::blocksChanged); |
| 104 | |
| 105 | connect(cbParenthesisPadding, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &AStylePreferences::paddingChanged); |
| 106 | connect(chkPadParenthesisHeader, &QCheckBox::stateChanged, this, &AStylePreferences::paddingChanged); |
| 107 | connect(chkPadOperators, &QCheckBox::stateChanged, this, &AStylePreferences::paddingChanged); |
| 108 | |
| 109 | connect(chkKeepStatements, &QCheckBox::stateChanged, this, &AStylePreferences::onelinersChanged); |
| 110 | connect(chkKeepBlocks, &QCheckBox::stateChanged, this, &AStylePreferences::onelinersChanged); |
| 111 | |
| 112 | connect(cbPointerAlign, QOverload<int>::of(&QComboBox::currentIndexChanged), |
| 113 | this, &AStylePreferences::pointerAlignChanged); |
| 114 | |
| 115 | connect(chkAfterParens, &QCheckBox::stateChanged, this, &AStylePreferences::afterParensChanged); |
| 116 | connect(inpContinuation, QOverload<int>::of(&QSpinBox::valueChanged), this, &AStylePreferences::afterParensChanged); |
| 117 | } |
| 118 | |
| 119 | void AStylePreferences::load(const SourceFormatterStyle &style) |
| 120 | { |
no test coverage detected