Changeset View
Changeset View
Standalone View
Standalone View
src/utils/kateconfig.cpp
Show First 20 Lines • Show All 1257 Lines • ▼ Show 20 Line(s) | 1231 | KateViewConfig::KateViewConfig() | |||
---|---|---|---|---|---|
1258 | m_keywordCompletionSet(false), | 1258 | m_keywordCompletionSet(false), | ||
1259 | m_wordCompletionMinimalWordLengthSet(false), | 1259 | m_wordCompletionMinimalWordLengthSet(false), | ||
1260 | m_smartCopyCutSet(false), | 1260 | m_smartCopyCutSet(false), | ||
1261 | m_scrollPastEndSet(false), | 1261 | m_scrollPastEndSet(false), | ||
1262 | m_allowMarkMenu(true), | 1262 | m_allowMarkMenu(true), | ||
1263 | m_wordCompletionRemoveTailSet(false), | 1263 | m_wordCompletionRemoveTailSet(false), | ||
1264 | m_foldFirstLineSet (false), | 1264 | m_foldFirstLineSet (false), | ||
1265 | m_autoBracketsSet(false), | 1265 | m_autoBracketsSet(false), | ||
1266 | m_backspaceRemoveComposedSet(false), | ||||
dhaumann: Should be: m_backspaceRemoveComposed_Set_(False) | |||||
1266 | m_view(nullptr) | 1267 | m_view(nullptr) | ||
1267 | { | 1268 | { | ||
1268 | s_global = this; | 1269 | s_global = this; | ||
1269 | 1270 | | |||
1270 | // init with defaults from config or really hardcoded ones | 1271 | // init with defaults from config or really hardcoded ones | ||
1271 | KConfigGroup config(KTextEditor::EditorPrivate::config(), "View"); | 1272 | KConfigGroup config(KTextEditor::EditorPrivate::config(), "View"); | ||
1272 | readConfig(config); | 1273 | readConfig(config); | ||
1273 | } | 1274 | } | ||
Show All 28 Lines | 1276 | KateViewConfig::KateViewConfig(KTextEditor::ViewPrivate *view) | |||
1302 | m_automaticCompletionInvocationSet(false), | 1303 | m_automaticCompletionInvocationSet(false), | ||
1303 | m_wordCompletionSet(false), | 1304 | m_wordCompletionSet(false), | ||
1304 | m_keywordCompletionSet(false), | 1305 | m_keywordCompletionSet(false), | ||
1305 | m_wordCompletionMinimalWordLengthSet(false), | 1306 | m_wordCompletionMinimalWordLengthSet(false), | ||
1306 | m_smartCopyCutSet(false), | 1307 | m_smartCopyCutSet(false), | ||
1307 | m_scrollPastEndSet(false), | 1308 | m_scrollPastEndSet(false), | ||
1308 | m_allowMarkMenu(true), | 1309 | m_allowMarkMenu(true), | ||
1309 | m_wordCompletionRemoveTailSet(false), | 1310 | m_wordCompletionRemoveTailSet(false), | ||
1310 | m_foldFirstLineSet (false), | 1311 | m_foldFirstLineSet(false), | ||
1311 | m_autoBracketsSet(false), | 1312 | m_autoBracketsSet(false), | ||
1313 | m_backspaceRemoveComposedSet(false), | ||||
dhaumann: This should be: m_backspaceRemoveComposed_Set_(false) | |||||
1312 | m_view(view) | 1314 | m_view(view) | ||
1313 | { | 1315 | { | ||
1314 | } | 1316 | } | ||
1315 | 1317 | | |||
1316 | KateViewConfig::~KateViewConfig() | 1318 | KateViewConfig::~KateViewConfig() | ||
1317 | { | 1319 | { | ||
1318 | } | 1320 | } | ||
1319 | 1321 | | |||
Show All 28 Lines | |||||
1348 | const char KEY_KEYWORD_COMPLETION[] = "Keyword Completion"; | 1350 | const char KEY_KEYWORD_COMPLETION[] = "Keyword Completion"; | ||
1349 | const char KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH[] = "Word Completion Minimal Word Length"; | 1351 | const char KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH[] = "Word Completion Minimal Word Length"; | ||
1350 | const char KEY_WORD_COMPLETION_REMOVE_TAIL[] = "Word Completion Remove Tail"; | 1352 | const char KEY_WORD_COMPLETION_REMOVE_TAIL[] = "Word Completion Remove Tail"; | ||
1351 | const char KEY_SMART_COPY_CUT[] = "Smart Copy Cut"; | 1353 | const char KEY_SMART_COPY_CUT[] = "Smart Copy Cut"; | ||
1352 | const char KEY_SCROLL_PAST_END[] = "Scroll Past End"; | 1354 | const char KEY_SCROLL_PAST_END[] = "Scroll Past End"; | ||
1353 | const char KEY_FOLD_FIRST_LINE[] = "Fold First Line"; | 1355 | const char KEY_FOLD_FIRST_LINE[] = "Fold First Line"; | ||
1354 | const char KEY_SHOW_WORD_COUNT[] = "Show Word Count"; | 1356 | const char KEY_SHOW_WORD_COUNT[] = "Show Word Count"; | ||
1355 | const char KEY_AUTO_BRACKETS[] = "Auto Brackets"; | 1357 | const char KEY_AUTO_BRACKETS[] = "Auto Brackets"; | ||
1358 | const char KEY_BACKSPACE_REMOVE_COMPOSED[] = "Backspace Remove Composed Characters"; | ||||
1356 | } | 1359 | } | ||
1357 | 1360 | | |||
1358 | void KateViewConfig::readConfig(const KConfigGroup &config) | 1361 | void KateViewConfig::readConfig(const KConfigGroup &config) | ||
1359 | { | 1362 | { | ||
1360 | configStart(); | 1363 | configStart(); | ||
1361 | 1364 | | |||
1362 | // default on | 1365 | // default on | ||
1363 | setDynWordWrap(config.readEntry(KEY_DYN_WORD_WRAP, true)); | 1366 | setDynWordWrap(config.readEntry(KEY_DYN_WORD_WRAP, true)); | ||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
1410 | setWordCompletionMinimalWordLength(config.readEntry(KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH, 3)); | 1413 | setWordCompletionMinimalWordLength(config.readEntry(KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH, 3)); | ||
1411 | setWordCompletionRemoveTail(config.readEntry(KEY_WORD_COMPLETION_REMOVE_TAIL, true)); | 1414 | setWordCompletionRemoveTail(config.readEntry(KEY_WORD_COMPLETION_REMOVE_TAIL, true)); | ||
1412 | setSmartCopyCut(config.readEntry(KEY_SMART_COPY_CUT, false)); | 1415 | setSmartCopyCut(config.readEntry(KEY_SMART_COPY_CUT, false)); | ||
1413 | setScrollPastEnd(config.readEntry(KEY_SCROLL_PAST_END, false)); | 1416 | setScrollPastEnd(config.readEntry(KEY_SCROLL_PAST_END, false)); | ||
1414 | setFoldFirstLine(config.readEntry(KEY_FOLD_FIRST_LINE, false)); | 1417 | setFoldFirstLine(config.readEntry(KEY_FOLD_FIRST_LINE, false)); | ||
1415 | setShowWordCount(config.readEntry(KEY_SHOW_WORD_COUNT, false)); | 1418 | setShowWordCount(config.readEntry(KEY_SHOW_WORD_COUNT, false)); | ||
1416 | setAutoBrackets(config.readEntry(KEY_AUTO_BRACKETS, false)); | 1419 | setAutoBrackets(config.readEntry(KEY_AUTO_BRACKETS, false)); | ||
1417 | 1420 | | |||
1421 | setBackspaceRemoveComposed(config.readEntry(KEY_BACKSPACE_REMOVE_COMPOSED, false)); | ||||
1422 | | ||||
1418 | configEnd(); | 1423 | configEnd(); | ||
1419 | } | 1424 | } | ||
1420 | 1425 | | |||
1421 | void KateViewConfig::writeConfig(KConfigGroup &config) | 1426 | void KateViewConfig::writeConfig(KConfigGroup &config) | ||
1422 | { | 1427 | { | ||
1423 | config.writeEntry(KEY_DYN_WORD_WRAP, dynWordWrap()); | 1428 | config.writeEntry(KEY_DYN_WORD_WRAP, dynWordWrap()); | ||
1424 | config.writeEntry(KEY_DYN_WORD_WRAP_INDICATORS, dynWordWrapIndicators()); | 1429 | config.writeEntry(KEY_DYN_WORD_WRAP_INDICATORS, dynWordWrapIndicators()); | ||
1425 | config.writeEntry(KEY_DYN_WORD_WRAP_ALIGN_INDENT, dynWordWrapAlignIndent()); | 1430 | config.writeEntry(KEY_DYN_WORD_WRAP_ALIGN_INDENT, dynWordWrapAlignIndent()); | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
1471 | config.writeEntry(KEY_FOLD_FIRST_LINE, foldFirstLine()); | 1476 | config.writeEntry(KEY_FOLD_FIRST_LINE, foldFirstLine()); | ||
1472 | 1477 | | |||
1473 | config.writeEntry(KEY_INPUT_MODE, static_cast<int>(inputMode())); | 1478 | config.writeEntry(KEY_INPUT_MODE, static_cast<int>(inputMode())); | ||
1474 | config.writeEntry(KEY_VI_INPUT_MODE_STEAL_KEYS, viInputModeStealKeys()); | 1479 | config.writeEntry(KEY_VI_INPUT_MODE_STEAL_KEYS, viInputModeStealKeys()); | ||
1475 | config.writeEntry(KEY_VI_RELATIVE_LINE_NUMBERS, viRelativeLineNumbers()); | 1480 | config.writeEntry(KEY_VI_RELATIVE_LINE_NUMBERS, viRelativeLineNumbers()); | ||
1476 | 1481 | | |||
1477 | config.writeEntry(KEY_SHOW_WORD_COUNT, showWordCount()); | 1482 | config.writeEntry(KEY_SHOW_WORD_COUNT, showWordCount()); | ||
1478 | config.writeEntry(KEY_AUTO_BRACKETS, autoBrackets()); | 1483 | config.writeEntry(KEY_AUTO_BRACKETS, autoBrackets()); | ||
1484 | | ||||
1485 | config.writeEntry(KEY_BACKSPACE_REMOVE_COMPOSED, backspaceRemoveComposed()); | ||||
1479 | } | 1486 | } | ||
1480 | 1487 | | |||
1481 | void KateViewConfig::updateConfig() | 1488 | void KateViewConfig::updateConfig() | ||
1482 | { | 1489 | { | ||
1483 | if (m_view) { | 1490 | if (m_view) { | ||
1484 | m_view->updateConfig(); | 1491 | m_view->updateConfig(); | ||
1485 | return; | 1492 | return; | ||
1486 | } | 1493 | } | ||
▲ Show 20 Lines • Show All 742 Lines • ▼ Show 20 Line(s) | 2235 | if (m_showWordCount == on) { | |||
2229 | return; | 2236 | return; | ||
2230 | } | 2237 | } | ||
2231 | 2238 | | |||
2232 | configStart(); | 2239 | configStart(); | ||
2233 | m_showWordCount = on; | 2240 | m_showWordCount = on; | ||
2234 | configEnd(); | 2241 | configEnd(); | ||
2235 | } | 2242 | } | ||
2236 | 2243 | | |||
2244 | bool KateViewConfig::backspaceRemoveComposed() const | ||||
2245 | { | ||||
2246 | if (m_backspaceRemoveComposedSet || isGlobal()) { | ||||
dhaumann: Wrong, correct is: m_backspaceRemoveComposed_Set_ | |||||
2247 | return m_backspaceRemoveComposed; | ||||
2248 | } | ||||
2249 | | ||||
2250 | return s_global->backspaceRemoveComposed(); | ||||
2251 | } | ||||
2252 | | ||||
2253 | void KateViewConfig::setBackspaceRemoveComposed(bool on) | ||||
2254 | { | ||||
2255 | if (m_backspaceRemoveComposedSet && m_backspaceRemoveComposed == on) { | ||||
2256 | return; | ||||
2257 | } | ||||
2258 | | ||||
2259 | configStart(); | ||||
2260 | | ||||
dhaumann: missing: m_backstapceRemoveComposedSet = true; | |||||
2261 | m_backspaceRemoveComposedSet = true; | ||||
2262 | m_backspaceRemoveComposed = on; | ||||
2263 | | ||||
2264 | configEnd(); | ||||
2265 | } | ||||
2266 | | ||||
2237 | //END | 2267 | //END | ||
2238 | 2268 | | |||
2239 | //BEGIN KateRendererConfig | 2269 | //BEGIN KateRendererConfig | ||
2240 | KateRendererConfig::KateRendererConfig() | 2270 | KateRendererConfig::KateRendererConfig() | ||
2241 | : m_fontMetrics(QFont()), | 2271 | : m_fontMetrics(QFont()), | ||
2242 | m_lineMarkerColor(KTextEditor::MarkInterface::reservedMarkersCount()), | 2272 | m_lineMarkerColor(KTextEditor::MarkInterface::reservedMarkersCount()), | ||
2243 | m_wordWrapMarker(false), | 2273 | m_wordWrapMarker(false), | ||
2244 | m_showIndentationLines(false), | 2274 | m_showIndentationLines(false), | ||
▲ Show 20 Lines • Show All 832 Lines • Show Last 20 Lines |
Should be: m_backspaceRemoveComposed_Set_(False)