Changeset View
Changeset View
Standalone View
Standalone View
src/utils/kateconfig.cpp
Show First 20 Lines • Show All 1232 Lines • ▼ Show 20 Line(s) | 1206 | KateViewConfig::KateViewConfig() | |||
---|---|---|---|---|---|
1233 | m_keywordCompletionSet(false), | 1233 | m_keywordCompletionSet(false), | ||
1234 | m_wordCompletionMinimalWordLengthSet(false), | 1234 | m_wordCompletionMinimalWordLengthSet(false), | ||
1235 | m_smartCopyCutSet(false), | 1235 | m_smartCopyCutSet(false), | ||
1236 | m_scrollPastEndSet(false), | 1236 | m_scrollPastEndSet(false), | ||
1237 | m_allowMarkMenu(true), | 1237 | m_allowMarkMenu(true), | ||
1238 | m_wordCompletionRemoveTailSet(false), | 1238 | m_wordCompletionRemoveTailSet(false), | ||
1239 | m_foldFirstLineSet (false), | 1239 | m_foldFirstLineSet (false), | ||
1240 | m_autoBracketsSet(false), | 1240 | m_autoBracketsSet(false), | ||
1241 | m_backspaceRemoveComposedSet(false), | ||||
dhaumann: Should be: m_backspaceRemoveComposed_Set_(False) | |||||
1241 | m_view(nullptr) | 1242 | m_view(nullptr) | ||
1242 | { | 1243 | { | ||
1243 | s_global = this; | 1244 | s_global = this; | ||
1244 | 1245 | | |||
1245 | // init with defaults from config or really hardcoded ones | 1246 | // init with defaults from config or really hardcoded ones | ||
1246 | KConfigGroup config(KTextEditor::EditorPrivate::config(), "View"); | 1247 | KConfigGroup config(KTextEditor::EditorPrivate::config(), "View"); | ||
1247 | readConfig(config); | 1248 | readConfig(config); | ||
1248 | } | 1249 | } | ||
Show All 28 Lines | 1251 | KateViewConfig::KateViewConfig(KTextEditor::ViewPrivate *view) | |||
1277 | m_automaticCompletionInvocationSet(false), | 1278 | m_automaticCompletionInvocationSet(false), | ||
1278 | m_wordCompletionSet(false), | 1279 | m_wordCompletionSet(false), | ||
1279 | m_keywordCompletionSet(false), | 1280 | m_keywordCompletionSet(false), | ||
1280 | m_wordCompletionMinimalWordLengthSet(false), | 1281 | m_wordCompletionMinimalWordLengthSet(false), | ||
1281 | m_smartCopyCutSet(false), | 1282 | m_smartCopyCutSet(false), | ||
1282 | m_scrollPastEndSet(false), | 1283 | m_scrollPastEndSet(false), | ||
1283 | m_allowMarkMenu(true), | 1284 | m_allowMarkMenu(true), | ||
1284 | m_wordCompletionRemoveTailSet(false), | 1285 | m_wordCompletionRemoveTailSet(false), | ||
1285 | m_foldFirstLineSet (false), | 1286 | m_foldFirstLineSet(false), | ||
1286 | m_autoBracketsSet(false), | 1287 | m_autoBracketsSet(false), | ||
1288 | m_backspaceRemoveComposedSet(false), | ||||
dhaumann: This should be: m_backspaceRemoveComposed_Set_(false) | |||||
1287 | m_view(view) | 1289 | m_view(view) | ||
1288 | { | 1290 | { | ||
1289 | } | 1291 | } | ||
1290 | 1292 | | |||
1291 | KateViewConfig::~KateViewConfig() | 1293 | KateViewConfig::~KateViewConfig() | ||
1292 | { | 1294 | { | ||
1293 | } | 1295 | } | ||
1294 | 1296 | | |||
Show All 28 Lines | |||||
1323 | const char KEY_KEYWORD_COMPLETION[] = "Keyword Completion"; | 1325 | const char KEY_KEYWORD_COMPLETION[] = "Keyword Completion"; | ||
1324 | const char KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH[] = "Word Completion Minimal Word Length"; | 1326 | const char KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH[] = "Word Completion Minimal Word Length"; | ||
1325 | const char KEY_WORD_COMPLETION_REMOVE_TAIL[] = "Word Completion Remove Tail"; | 1327 | const char KEY_WORD_COMPLETION_REMOVE_TAIL[] = "Word Completion Remove Tail"; | ||
1326 | const char KEY_SMART_COPY_CUT[] = "Smart Copy Cut"; | 1328 | const char KEY_SMART_COPY_CUT[] = "Smart Copy Cut"; | ||
1327 | const char KEY_SCROLL_PAST_END[] = "Scroll Past End"; | 1329 | const char KEY_SCROLL_PAST_END[] = "Scroll Past End"; | ||
1328 | const char KEY_FOLD_FIRST_LINE[] = "Fold First Line"; | 1330 | const char KEY_FOLD_FIRST_LINE[] = "Fold First Line"; | ||
1329 | const char KEY_SHOW_WORD_COUNT[] = "Show Word Count"; | 1331 | const char KEY_SHOW_WORD_COUNT[] = "Show Word Count"; | ||
1330 | const char KEY_AUTO_BRACKETS[] = "Auto Brackets"; | 1332 | const char KEY_AUTO_BRACKETS[] = "Auto Brackets"; | ||
1333 | const char KEY_BACKSPACE_REMOVE_COMPOSED[] = "Backspace Remove Composed Characters"; | ||||
1331 | } | 1334 | } | ||
1332 | 1335 | | |||
1333 | void KateViewConfig::readConfig(const KConfigGroup &config) | 1336 | void KateViewConfig::readConfig(const KConfigGroup &config) | ||
1334 | { | 1337 | { | ||
1335 | configStart(); | 1338 | configStart(); | ||
1336 | 1339 | | |||
1337 | // default on | 1340 | // default on | ||
1338 | setDynWordWrap(config.readEntry(KEY_DYN_WORD_WRAP, true)); | 1341 | setDynWordWrap(config.readEntry(KEY_DYN_WORD_WRAP, true)); | ||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
1385 | setWordCompletionMinimalWordLength(config.readEntry(KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH, 3)); | 1388 | setWordCompletionMinimalWordLength(config.readEntry(KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH, 3)); | ||
1386 | setWordCompletionRemoveTail(config.readEntry(KEY_WORD_COMPLETION_REMOVE_TAIL, true)); | 1389 | setWordCompletionRemoveTail(config.readEntry(KEY_WORD_COMPLETION_REMOVE_TAIL, true)); | ||
1387 | setSmartCopyCut(config.readEntry(KEY_SMART_COPY_CUT, false)); | 1390 | setSmartCopyCut(config.readEntry(KEY_SMART_COPY_CUT, false)); | ||
1388 | setScrollPastEnd(config.readEntry(KEY_SCROLL_PAST_END, false)); | 1391 | setScrollPastEnd(config.readEntry(KEY_SCROLL_PAST_END, false)); | ||
1389 | setFoldFirstLine(config.readEntry(KEY_FOLD_FIRST_LINE, false)); | 1392 | setFoldFirstLine(config.readEntry(KEY_FOLD_FIRST_LINE, false)); | ||
1390 | setShowWordCount(config.readEntry(KEY_SHOW_WORD_COUNT, false)); | 1393 | setShowWordCount(config.readEntry(KEY_SHOW_WORD_COUNT, false)); | ||
1391 | setAutoBrackets(config.readEntry(KEY_AUTO_BRACKETS, false)); | 1394 | setAutoBrackets(config.readEntry(KEY_AUTO_BRACKETS, false)); | ||
1392 | 1395 | | |||
1396 | setBackspaceRemoveComposed(config.readEntry(KEY_BACKSPACE_REMOVE_COMPOSED, false)); | ||||
1397 | | ||||
1393 | configEnd(); | 1398 | configEnd(); | ||
1394 | } | 1399 | } | ||
1395 | 1400 | | |||
1396 | void KateViewConfig::writeConfig(KConfigGroup &config) | 1401 | void KateViewConfig::writeConfig(KConfigGroup &config) | ||
1397 | { | 1402 | { | ||
1398 | config.writeEntry(KEY_DYN_WORD_WRAP, dynWordWrap()); | 1403 | config.writeEntry(KEY_DYN_WORD_WRAP, dynWordWrap()); | ||
1399 | config.writeEntry(KEY_DYN_WORD_WRAP_INDICATORS, dynWordWrapIndicators()); | 1404 | config.writeEntry(KEY_DYN_WORD_WRAP_INDICATORS, dynWordWrapIndicators()); | ||
1400 | config.writeEntry(KEY_DYN_WORD_WRAP_ALIGN_INDENT, dynWordWrapAlignIndent()); | 1405 | config.writeEntry(KEY_DYN_WORD_WRAP_ALIGN_INDENT, dynWordWrapAlignIndent()); | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
1446 | config.writeEntry(KEY_FOLD_FIRST_LINE, foldFirstLine()); | 1451 | config.writeEntry(KEY_FOLD_FIRST_LINE, foldFirstLine()); | ||
1447 | 1452 | | |||
1448 | config.writeEntry(KEY_INPUT_MODE, static_cast<int>(inputMode())); | 1453 | config.writeEntry(KEY_INPUT_MODE, static_cast<int>(inputMode())); | ||
1449 | config.writeEntry(KEY_VI_INPUT_MODE_STEAL_KEYS, viInputModeStealKeys()); | 1454 | config.writeEntry(KEY_VI_INPUT_MODE_STEAL_KEYS, viInputModeStealKeys()); | ||
1450 | config.writeEntry(KEY_VI_RELATIVE_LINE_NUMBERS, viRelativeLineNumbers()); | 1455 | config.writeEntry(KEY_VI_RELATIVE_LINE_NUMBERS, viRelativeLineNumbers()); | ||
1451 | 1456 | | |||
1452 | config.writeEntry(KEY_SHOW_WORD_COUNT, showWordCount()); | 1457 | config.writeEntry(KEY_SHOW_WORD_COUNT, showWordCount()); | ||
1453 | config.writeEntry(KEY_AUTO_BRACKETS, autoBrackets()); | 1458 | config.writeEntry(KEY_AUTO_BRACKETS, autoBrackets()); | ||
1459 | | ||||
1460 | config.writeEntry(KEY_BACKSPACE_REMOVE_COMPOSED, backspaceRemoveComposed()); | ||||
1454 | } | 1461 | } | ||
1455 | 1462 | | |||
1456 | void KateViewConfig::updateConfig() | 1463 | void KateViewConfig::updateConfig() | ||
1457 | { | 1464 | { | ||
1458 | if (m_view) { | 1465 | if (m_view) { | ||
1459 | m_view->updateConfig(); | 1466 | m_view->updateConfig(); | ||
1460 | return; | 1467 | return; | ||
1461 | } | 1468 | } | ||
▲ Show 20 Lines • Show All 742 Lines • ▼ Show 20 Line(s) | 2210 | if (m_showWordCount == on) { | |||
2204 | return; | 2211 | return; | ||
2205 | } | 2212 | } | ||
2206 | 2213 | | |||
2207 | configStart(); | 2214 | configStart(); | ||
2208 | m_showWordCount = on; | 2215 | m_showWordCount = on; | ||
2209 | configEnd(); | 2216 | configEnd(); | ||
2210 | } | 2217 | } | ||
2211 | 2218 | | |||
2219 | bool KateViewConfig::backspaceRemoveComposed() const | ||||
2220 | { | ||||
2221 | if (m_backspaceRemoveComposedSet || isGlobal()) { | ||||
dhaumann: Wrong, correct is: m_backspaceRemoveComposed_Set_ | |||||
2222 | return m_backspaceRemoveComposed; | ||||
2223 | } | ||||
2224 | | ||||
2225 | return s_global->backspaceRemoveComposed(); | ||||
2226 | } | ||||
2227 | | ||||
2228 | void KateViewConfig::setBackspaceRemoveComposed(bool on) | ||||
2229 | { | ||||
2230 | if (m_backspaceRemoveComposedSet && m_backspaceRemoveComposed == on) { | ||||
2231 | return; | ||||
2232 | } | ||||
2233 | | ||||
2234 | configStart(); | ||||
2235 | | ||||
dhaumann: missing: m_backstapceRemoveComposedSet = true; | |||||
2236 | m_backspaceRemoveComposedSet = true; | ||||
2237 | m_backspaceRemoveComposed = on; | ||||
2238 | | ||||
2239 | configEnd(); | ||||
2240 | } | ||||
2241 | | ||||
2212 | //END | 2242 | //END | ||
2213 | 2243 | | |||
2214 | //BEGIN KateRendererConfig | 2244 | //BEGIN KateRendererConfig | ||
2215 | KateRendererConfig::KateRendererConfig() | 2245 | KateRendererConfig::KateRendererConfig() | ||
2216 | : m_fontMetrics(QFont()), | 2246 | : m_fontMetrics(QFont()), | ||
2217 | m_lineMarkerColor(KTextEditor::MarkInterface::reservedMarkersCount()), | 2247 | m_lineMarkerColor(KTextEditor::MarkInterface::reservedMarkersCount()), | ||
2218 | m_wordWrapMarker(false), | 2248 | m_wordWrapMarker(false), | ||
2219 | m_showIndentationLines(false), | 2249 | m_showIndentationLines(false), | ||
▲ Show 20 Lines • Show All 832 Lines • Show Last 20 Lines |
Should be: m_backspaceRemoveComposed_Set_(False)