Changeset View
Changeset View
Standalone View
Standalone View
src/completion/katecompletionconfig.cpp
Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Line(s) | 178 | { | |||
---|---|---|---|---|---|
185 | ui->sortingInheritanceDepth->setChecked(config.readEntry("Sort by Inheritance Depth", true)); | 185 | ui->sortingInheritanceDepth->setChecked(config.readEntry("Sort by Inheritance Depth", true)); | ||
186 | 186 | | |||
187 | // Filtering | 187 | // Filtering | ||
188 | ui->filtering->setChecked(config.readEntry("Filtering Enabled", false)); | 188 | ui->filtering->setChecked(config.readEntry("Filtering Enabled", false)); | ||
189 | ui->filteringContextMatchOnly->setChecked(config.readEntry("Filter by Context Match Only", false)); | 189 | ui->filteringContextMatchOnly->setChecked(config.readEntry("Filter by Context Match Only", false)); | ||
190 | ui->filteringHideAttributes->setChecked(config.readEntry("Hide Completions by Attribute", false)); | 190 | ui->filteringHideAttributes->setChecked(config.readEntry("Hide Completions by Attribute", false)); | ||
191 | 191 | | |||
192 | int attributes = config.readEntry("Filter Attribute Mask", 0); | 192 | int attributes = config.readEntry("Filter Attribute Mask", 0); | ||
193 | | ||||
193 | for (int i = 0; i < ui->filteringAttributesList->count(); ++i) { | 194 | for (int i = 0; i < ui->filteringAttributesList->count(); ++i) { | ||
194 | QListWidgetItem *item = ui->filteringAttributesList->item(i); | 195 | QListWidgetItem *item = ui->filteringAttributesList->item(i); | ||
196 | if (i == 0) { | ||||
197 | // Avoid a negative shift. 0xFFFFFFFF80000000 is 1 << -1. | ||||
198 | item->setCheckState((0xFFFFFFFF80000000 & attributes) ? Qt::Checked : Qt::Unchecked); | ||||
199 | } else { | ||||
195 | item->setCheckState(((1 << (i - 1)) & attributes) ? Qt::Checked : Qt::Unchecked); | 200 | item->setCheckState(((1 << (i -1)) & attributes) ? Qt::Checked : Qt::Unchecked); | ||
196 | } | 201 | } | ||
202 | } | ||||
197 | 203 | | |||
198 | ui->filteringMaximumInheritanceDepth->setValue(config.readEntry("Filter by Maximum Inheritance Depth", 0)); | 204 | ui->filteringMaximumInheritanceDepth->setValue(config.readEntry("Filter by Maximum Inheritance Depth", 0)); | ||
199 | 205 | | |||
200 | // Grouping | 206 | // Grouping | ||
201 | ui->grouping->setChecked(config.readEntry("Grouping Enabled", true)); | 207 | ui->grouping->setChecked(config.readEntry("Grouping Enabled", true)); | ||
202 | 208 | | |||
203 | m_groupingScopeType->setCheckState(0, config.readEntry("Group by Scope Type", true) ? Qt::Checked : Qt::Unchecked); | 209 | m_groupingScopeType->setCheckState(0, config.readEntry("Group by Scope Type", true) ? Qt::Checked : Qt::Unchecked); | ||
204 | m_groupingScope->setCheckState(0, config.readEntry("Group by Scope", false) ? Qt::Checked : Qt::Unchecked); | 210 | m_groupingScope->setCheckState(0, config.readEntry("Group by Scope", false) ? Qt::Checked : Qt::Unchecked); | ||
Show All 31 Lines | 234 | { | |||
236 | config.writeEntry("Filtering Enabled", ui->filtering->isChecked()); | 242 | config.writeEntry("Filtering Enabled", ui->filtering->isChecked()); | ||
237 | config.writeEntry("Filter by Context Match Only", ui->filteringContextMatchOnly->isChecked()); | 243 | config.writeEntry("Filter by Context Match Only", ui->filteringContextMatchOnly->isChecked()); | ||
238 | config.writeEntry("Hide Completions by Attribute", ui->filteringHideAttributes->isChecked()); | 244 | config.writeEntry("Hide Completions by Attribute", ui->filteringHideAttributes->isChecked()); | ||
239 | 245 | | |||
240 | int attributes = 0; | 246 | int attributes = 0; | ||
241 | for (int i = 0; i < ui->filteringAttributesList->count(); ++i) { | 247 | for (int i = 0; i < ui->filteringAttributesList->count(); ++i) { | ||
242 | QListWidgetItem *item = ui->filteringAttributesList->item(i); | 248 | QListWidgetItem *item = ui->filteringAttributesList->item(i); | ||
243 | if (item->checkState() == Qt::Checked) { | 249 | if (item->checkState() == Qt::Checked) { | ||
250 | if (i == 0) { | ||||
251 | // Avoid a negative shift. 0xFFFFFFFF80000000 is 1 << -1. | ||||
252 | attributes |= 0xFFFFFFFF80000000; | ||||
253 | } | ||||
254 | else { | ||||
244 | attributes |= 1 << (i - 1); | 255 | attributes |= 1 << (i - 1); | ||
245 | } | 256 | } | ||
246 | } | 257 | } | ||
258 | } | ||||
247 | config.writeEntry("Filter Attribute Mask", attributes); | 259 | config.writeEntry("Filter Attribute Mask", attributes); | ||
248 | 260 | | |||
249 | config.writeEntry("Filter by Maximum Inheritance Depth", ui->filteringMaximumInheritanceDepth->value()); | 261 | config.writeEntry("Filter by Maximum Inheritance Depth", ui->filteringMaximumInheritanceDepth->value()); | ||
250 | 262 | | |||
251 | // Grouping | 263 | // Grouping | ||
252 | config.writeEntry("Grouping Enabled", ui->grouping->isChecked()); | 264 | config.writeEntry("Grouping Enabled", ui->grouping->isChecked()); | ||
253 | 265 | | |||
254 | config.writeEntry("Group by Scope Type", m_groupingScopeType->checkState(0) == Qt::Checked ? true : false); | 266 | config.writeEntry("Group by Scope Type", m_groupingScopeType->checkState(0) == Qt::Checked ? true : false); | ||
▲ Show 20 Lines • Show All 182 Lines • Show Last 20 Lines |