Changeset View
Changeset View
Standalone View
Standalone View
src/utils/kateconfig.cpp
Show First 20 Lines • Show All 1254 Lines • ▼ Show 20 Line(s) | 1228 | KateViewConfig::KateViewConfig() | |||
---|---|---|---|---|---|
1255 | m_keywordCompletionSet(false), | 1255 | m_keywordCompletionSet(false), | ||
1256 | m_wordCompletionMinimalWordLengthSet(false), | 1256 | m_wordCompletionMinimalWordLengthSet(false), | ||
1257 | m_smartCopyCutSet(false), | 1257 | m_smartCopyCutSet(false), | ||
1258 | m_scrollPastEndSet(false), | 1258 | m_scrollPastEndSet(false), | ||
1259 | m_allowMarkMenu(true), | 1259 | m_allowMarkMenu(true), | ||
1260 | m_wordCompletionRemoveTailSet(false), | 1260 | m_wordCompletionRemoveTailSet(false), | ||
1261 | m_foldFirstLineSet(false), | 1261 | m_foldFirstLineSet(false), | ||
1262 | m_showWordCountSet(false), | 1262 | m_showWordCountSet(false), | ||
1263 | m_showLinesCountSet(false), | 1263 | m_showLineCountSet(false), | ||
1264 | m_autoBracketsSet(false), | 1264 | m_autoBracketsSet(false), | ||
1265 | m_backspaceRemoveComposedSet(false) | 1265 | m_backspaceRemoveComposedSet(false) | ||
1266 | 1266 | | |||
1267 | { | 1267 | { | ||
1268 | s_global = this; | 1268 | s_global = this; | ||
1269 | 1269 | | |||
1270 | // init with defaults from config or really hardcoded ones | 1270 | // init with defaults from config or really hardcoded ones | ||
1271 | KConfigGroup config(KTextEditor::EditorPrivate::config(), "KTextEditor View"); | 1271 | KConfigGroup config(KTextEditor::EditorPrivate::config(), "KTextEditor View"); | ||
Show All 32 Lines | 1275 | KateViewConfig::KateViewConfig(KTextEditor::ViewPrivate *view) | |||
1304 | m_keywordCompletionSet(false), | 1304 | m_keywordCompletionSet(false), | ||
1305 | m_wordCompletionMinimalWordLengthSet(false), | 1305 | m_wordCompletionMinimalWordLengthSet(false), | ||
1306 | m_smartCopyCutSet(false), | 1306 | m_smartCopyCutSet(false), | ||
1307 | m_scrollPastEndSet(false), | 1307 | m_scrollPastEndSet(false), | ||
1308 | m_allowMarkMenu(true), | 1308 | m_allowMarkMenu(true), | ||
1309 | m_wordCompletionRemoveTailSet(false), | 1309 | m_wordCompletionRemoveTailSet(false), | ||
1310 | m_foldFirstLineSet(false), | 1310 | m_foldFirstLineSet(false), | ||
1311 | m_showWordCountSet(false), | 1311 | m_showWordCountSet(false), | ||
1312 | m_showLinesCountSet(false), | 1312 | m_showLineCountSet(false), | ||
1313 | m_autoBracketsSet(false), | 1313 | m_autoBracketsSet(false), | ||
1314 | m_backspaceRemoveComposedSet(false), | 1314 | m_backspaceRemoveComposedSet(false), | ||
1315 | m_view(view) | 1315 | m_view(view) | ||
1316 | { | 1316 | { | ||
1317 | } | 1317 | } | ||
1318 | 1318 | | |||
1319 | KateViewConfig::~KateViewConfig() | 1319 | KateViewConfig::~KateViewConfig() | ||
1320 | { | 1320 | { | ||
Show All 28 Lines | |||||
1349 | const char KEY_AUTOMATIC_COMPLETION_INVOCATION[] = "Auto Completion"; | 1349 | const char KEY_AUTOMATIC_COMPLETION_INVOCATION[] = "Auto Completion"; | ||
1350 | const char KEY_WORD_COMPLETION[] = "Word Completion"; | 1350 | const char KEY_WORD_COMPLETION[] = "Word Completion"; | ||
1351 | const char KEY_KEYWORD_COMPLETION[] = "Keyword Completion"; | 1351 | const char KEY_KEYWORD_COMPLETION[] = "Keyword Completion"; | ||
1352 | const char KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH[] = "Word Completion Minimal Word Length"; | 1352 | const char KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH[] = "Word Completion Minimal Word Length"; | ||
1353 | const char KEY_WORD_COMPLETION_REMOVE_TAIL[] = "Word Completion Remove Tail"; | 1353 | const char KEY_WORD_COMPLETION_REMOVE_TAIL[] = "Word Completion Remove Tail"; | ||
1354 | const char KEY_SMART_COPY_CUT[] = "Smart Copy Cut"; | 1354 | const char KEY_SMART_COPY_CUT[] = "Smart Copy Cut"; | ||
1355 | const char KEY_SCROLL_PAST_END[] = "Scroll Past End"; | 1355 | const char KEY_SCROLL_PAST_END[] = "Scroll Past End"; | ||
1356 | const char KEY_FOLD_FIRST_LINE[] = "Fold First Line"; | 1356 | const char KEY_FOLD_FIRST_LINE[] = "Fold First Line"; | ||
1357 | const char KEY_SHOW_LINES_COUNT[] = "Show Lines Count"; | 1357 | const char KEY_SHOW_LINE_COUNT[] = "Show Line Count"; | ||
1358 | const char KEY_SHOW_WORD_COUNT[] = "Show Word Count"; | 1358 | const char KEY_SHOW_WORD_COUNT[] = "Show Word Count"; | ||
1359 | const char KEY_AUTO_BRACKETS[] = "Auto Brackets"; | 1359 | const char KEY_AUTO_BRACKETS[] = "Auto Brackets"; | ||
1360 | const char KEY_BACKSPACE_REMOVE_COMPOSED[] = "Backspace Remove Composed Characters"; | 1360 | const char KEY_BACKSPACE_REMOVE_COMPOSED[] = "Backspace Remove Composed Characters"; | ||
1361 | } | 1361 | } | ||
1362 | 1362 | | |||
1363 | void KateViewConfig::readConfig(const KConfigGroup &config) | 1363 | void KateViewConfig::readConfig(const KConfigGroup &config) | ||
1364 | { | 1364 | { | ||
1365 | configStart(); | 1365 | configStart(); | ||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
1412 | setAutomaticCompletionInvocation(config.readEntry(KEY_AUTOMATIC_COMPLETION_INVOCATION, true)); | 1412 | setAutomaticCompletionInvocation(config.readEntry(KEY_AUTOMATIC_COMPLETION_INVOCATION, true)); | ||
1413 | setWordCompletion(config.readEntry(KEY_WORD_COMPLETION, true)); | 1413 | setWordCompletion(config.readEntry(KEY_WORD_COMPLETION, true)); | ||
1414 | setKeywordCompletion(config.readEntry(KEY_KEYWORD_COMPLETION, true)); | 1414 | setKeywordCompletion(config.readEntry(KEY_KEYWORD_COMPLETION, true)); | ||
1415 | setWordCompletionMinimalWordLength(config.readEntry(KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH, 3)); | 1415 | setWordCompletionMinimalWordLength(config.readEntry(KEY_WORD_COMPLETION_MINIMAL_WORD_LENGTH, 3)); | ||
1416 | setWordCompletionRemoveTail(config.readEntry(KEY_WORD_COMPLETION_REMOVE_TAIL, true)); | 1416 | setWordCompletionRemoveTail(config.readEntry(KEY_WORD_COMPLETION_REMOVE_TAIL, true)); | ||
1417 | setSmartCopyCut(config.readEntry(KEY_SMART_COPY_CUT, false)); | 1417 | setSmartCopyCut(config.readEntry(KEY_SMART_COPY_CUT, false)); | ||
1418 | setScrollPastEnd(config.readEntry(KEY_SCROLL_PAST_END, false)); | 1418 | setScrollPastEnd(config.readEntry(KEY_SCROLL_PAST_END, false)); | ||
1419 | setFoldFirstLine(config.readEntry(KEY_FOLD_FIRST_LINE, false)); | 1419 | setFoldFirstLine(config.readEntry(KEY_FOLD_FIRST_LINE, false)); | ||
1420 | setShowLinesCount(config.readEntry(KEY_SHOW_LINES_COUNT, false)); | 1420 | setShowLineCount(config.readEntry(KEY_SHOW_LINE_COUNT, false)); | ||
1421 | setShowWordCount(config.readEntry(KEY_SHOW_WORD_COUNT, false)); | 1421 | setShowWordCount(config.readEntry(KEY_SHOW_WORD_COUNT, false)); | ||
1422 | setAutoBrackets(config.readEntry(KEY_AUTO_BRACKETS, false)); | 1422 | setAutoBrackets(config.readEntry(KEY_AUTO_BRACKETS, false)); | ||
1423 | 1423 | | |||
1424 | setBackspaceRemoveComposed(config.readEntry(KEY_BACKSPACE_REMOVE_COMPOSED, false)); | 1424 | setBackspaceRemoveComposed(config.readEntry(KEY_BACKSPACE_REMOVE_COMPOSED, false)); | ||
1425 | 1425 | | |||
1426 | configEnd(); | 1426 | configEnd(); | ||
1427 | } | 1427 | } | ||
1428 | 1428 | | |||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 1430 | { | |||
1477 | config.writeEntry(KEY_SMART_COPY_CUT, smartCopyCut()); | 1477 | config.writeEntry(KEY_SMART_COPY_CUT, smartCopyCut()); | ||
1478 | config.writeEntry(KEY_SCROLL_PAST_END, scrollPastEnd()); | 1478 | config.writeEntry(KEY_SCROLL_PAST_END, scrollPastEnd()); | ||
1479 | config.writeEntry(KEY_FOLD_FIRST_LINE, foldFirstLine()); | 1479 | config.writeEntry(KEY_FOLD_FIRST_LINE, foldFirstLine()); | ||
1480 | 1480 | | |||
1481 | config.writeEntry(KEY_INPUT_MODE, static_cast<int>(inputMode())); | 1481 | config.writeEntry(KEY_INPUT_MODE, static_cast<int>(inputMode())); | ||
1482 | config.writeEntry(KEY_VI_INPUT_MODE_STEAL_KEYS, viInputModeStealKeys()); | 1482 | config.writeEntry(KEY_VI_INPUT_MODE_STEAL_KEYS, viInputModeStealKeys()); | ||
1483 | config.writeEntry(KEY_VI_RELATIVE_LINE_NUMBERS, viRelativeLineNumbers()); | 1483 | config.writeEntry(KEY_VI_RELATIVE_LINE_NUMBERS, viRelativeLineNumbers()); | ||
1484 | 1484 | | |||
1485 | config.writeEntry(KEY_SHOW_LINES_COUNT, showLinesCount()); | 1485 | config.writeEntry(KEY_SHOW_LINE_COUNT, showLineCount()); | ||
1486 | config.writeEntry(KEY_SHOW_WORD_COUNT, showWordCount()); | 1486 | config.writeEntry(KEY_SHOW_WORD_COUNT, showWordCount()); | ||
1487 | config.writeEntry(KEY_AUTO_BRACKETS, autoBrackets()); | 1487 | config.writeEntry(KEY_AUTO_BRACKETS, autoBrackets()); | ||
1488 | 1488 | | |||
1489 | config.writeEntry(KEY_BACKSPACE_REMOVE_COMPOSED, backspaceRemoveComposed()); | 1489 | config.writeEntry(KEY_BACKSPACE_REMOVE_COMPOSED, backspaceRemoveComposed()); | ||
1490 | } | 1490 | } | ||
1491 | 1491 | | |||
1492 | void KateViewConfig::updateConfig() | 1492 | void KateViewConfig::updateConfig() | ||
1493 | { | 1493 | { | ||
▲ Show 20 Lines • Show All 751 Lines • ▼ Show 20 Line(s) | 2242 | { | |||
2245 | } | 2245 | } | ||
2246 | 2246 | | |||
2247 | configStart(); | 2247 | configStart(); | ||
2248 | m_showWordCountSet = true; | 2248 | m_showWordCountSet = true; | ||
2249 | m_showWordCount = on; | 2249 | m_showWordCount = on; | ||
2250 | configEnd(); | 2250 | configEnd(); | ||
2251 | } | 2251 | } | ||
2252 | 2252 | | |||
2253 | bool KateViewConfig::showLinesCount() const | 2253 | bool KateViewConfig::showLineCount() const | ||
2254 | { | 2254 | { | ||
2255 | if (m_showLinesCountSet || isGlobal()) { | 2255 | if (m_showLineCountSet || isGlobal()) { | ||
2256 | return m_showLinesCount; | 2256 | return m_showLineCount; | ||
2257 | } | 2257 | } | ||
2258 | 2258 | | |||
2259 | return s_global->showLinesCount(); | 2259 | return s_global->showLineCount(); | ||
2260 | } | 2260 | } | ||
2261 | 2261 | | |||
2262 | void KateViewConfig::setShowLinesCount(bool on) | 2262 | void KateViewConfig::setShowLineCount(bool on) | ||
2263 | { | 2263 | { | ||
2264 | if (m_showLinesCountSet && m_showLinesCount == on) { | 2264 | if (m_showLineCountSet && m_showLineCount == on) { | ||
2265 | return; | 2265 | return; | ||
2266 | } | 2266 | } | ||
2267 | 2267 | | |||
2268 | configStart(); | 2268 | configStart(); | ||
2269 | m_showLinesCountSet = true; | 2269 | m_showLineCountSet = true; | ||
2270 | m_showLinesCount = on; | 2270 | m_showLineCount = on; | ||
2271 | configEnd(); | 2271 | configEnd(); | ||
2272 | } | 2272 | } | ||
2273 | 2273 | | |||
2274 | bool KateViewConfig::backspaceRemoveComposed() const | 2274 | bool KateViewConfig::backspaceRemoveComposed() const | ||
2275 | { | 2275 | { | ||
2276 | if (m_backspaceRemoveComposedSet || isGlobal()) { | 2276 | if (m_backspaceRemoveComposedSet || isGlobal()) { | ||
2277 | return m_backspaceRemoveComposed; | 2277 | return m_backspaceRemoveComposed; | ||
2278 | } | 2278 | } | ||
▲ Show 20 Lines • Show All 858 Lines • Show Last 20 Lines |