Changeset View
Changeset View
Standalone View
Standalone View
src/utils/kateconfig.cpp
Show First 20 Lines • Show All 301 Lines • ▼ Show 20 Line(s) | |||||
302 | const char KEY_PAGEUP_DOWN_MOVES_CURSOR[] = "PageUp/PageDown Moves Cursor"; | 302 | const char KEY_PAGEUP_DOWN_MOVES_CURSOR[] = "PageUp/PageDown Moves Cursor"; | ||
303 | const char KEY_SMART_HOME[] = "Smart Home"; | 303 | const char KEY_SMART_HOME[] = "Smart Home"; | ||
304 | const char KEY_SHOW_TABS[] = "Show Tabs"; | 304 | const char KEY_SHOW_TABS[] = "Show Tabs"; | ||
305 | const char KEY_TAB_INDENTS[] = "Indent On Tab"; | 305 | const char KEY_TAB_INDENTS[] = "Indent On Tab"; | ||
306 | const char KEY_KEEP_EXTRA_SPACES[] = "Keep Extra Spaces"; | 306 | const char KEY_KEEP_EXTRA_SPACES[] = "Keep Extra Spaces"; | ||
307 | const char KEY_INDENT_PASTED_TEXT[] = "Indent On Text Paste"; | 307 | const char KEY_INDENT_PASTED_TEXT[] = "Indent On Text Paste"; | ||
308 | const char KEY_BACKSPACE_INDENTS[] = "Indent On Backspace"; | 308 | const char KEY_BACKSPACE_INDENTS[] = "Indent On Backspace"; | ||
309 | const char KEY_SHOW_SPACES[] = "Show Spaces"; | 309 | const char KEY_SHOW_SPACES[] = "Show Spaces"; | ||
310 | const char KEY_MARKER_SIZE[] = "Trailing Marker Size"; | ||||
310 | const char KEY_REPLACE_TABS_DYN[] = "ReplaceTabsDyn"; | 311 | const char KEY_REPLACE_TABS_DYN[] = "ReplaceTabsDyn"; | ||
311 | const char KEY_REMOVE_SPACES[] = "Remove Spaces"; | 312 | const char KEY_REMOVE_SPACES[] = "Remove Spaces"; | ||
312 | const char KEY_NEWLINE_AT_EOF[] = "Newline at End of File"; | 313 | const char KEY_NEWLINE_AT_EOF[] = "Newline at End of File"; | ||
313 | const char KEY_OVR[] = "Overwrite Mode"; | 314 | const char KEY_OVR[] = "Overwrite Mode"; | ||
314 | const char KEY_ENCODING[] = "Encoding"; | 315 | const char KEY_ENCODING[] = "Encoding"; | ||
315 | const char KEY_EOL[] = "End of Line"; | 316 | const char KEY_EOL[] = "End of Line"; | ||
316 | const char KEY_ALLOW_EOL_DETECTION[] = "Allow End of Line Detection"; | 317 | const char KEY_ALLOW_EOL_DETECTION[] = "Allow End of Line Detection"; | ||
317 | const char KEY_BOM[] = "BOM"; | 318 | const char KEY_BOM[] = "BOM"; | ||
Show All 25 Lines | 330 | { | |||
343 | 344 | | |||
344 | setSmartHome(config.readEntry(KEY_SMART_HOME, true)); | 345 | setSmartHome(config.readEntry(KEY_SMART_HOME, true)); | ||
345 | setShowTabs(config.readEntry(KEY_SHOW_TABS, true)); | 346 | setShowTabs(config.readEntry(KEY_SHOW_TABS, true)); | ||
346 | setTabIndents(config.readEntry(KEY_TAB_INDENTS, true)); | 347 | setTabIndents(config.readEntry(KEY_TAB_INDENTS, true)); | ||
347 | setKeepExtraSpaces(config.readEntry(KEY_KEEP_EXTRA_SPACES, false)); | 348 | setKeepExtraSpaces(config.readEntry(KEY_KEEP_EXTRA_SPACES, false)); | ||
348 | setIndentPastedText(config.readEntry(KEY_INDENT_PASTED_TEXT, false)); | 349 | setIndentPastedText(config.readEntry(KEY_INDENT_PASTED_TEXT, false)); | ||
349 | setBackspaceIndents(config.readEntry(KEY_BACKSPACE_INDENTS, true)); | 350 | setBackspaceIndents(config.readEntry(KEY_BACKSPACE_INDENTS, true)); | ||
350 | setShowSpaces(config.readEntry(KEY_SHOW_SPACES, false)); | 351 | setShowSpaces(config.readEntry(KEY_SHOW_SPACES, false)); | ||
352 | setMarkerSize(config.readEntry(KEY_MARKER_SIZE, 1)); | ||||
351 | setReplaceTabsDyn(config.readEntry(KEY_REPLACE_TABS_DYN, true)); | 353 | setReplaceTabsDyn(config.readEntry(KEY_REPLACE_TABS_DYN, true)); | ||
352 | setRemoveSpaces(config.readEntry(KEY_REMOVE_SPACES, 0)); | 354 | setRemoveSpaces(config.readEntry(KEY_REMOVE_SPACES, 0)); | ||
353 | setNewLineAtEof(config.readEntry(KEY_NEWLINE_AT_EOF, true)); | 355 | setNewLineAtEof(config.readEntry(KEY_NEWLINE_AT_EOF, true)); | ||
354 | setOvr(config.readEntry(KEY_OVR, false)); | 356 | setOvr(config.readEntry(KEY_OVR, false)); | ||
355 | 357 | | |||
356 | setEncoding(config.readEntry(KEY_ENCODING, "")); | 358 | setEncoding(config.readEntry(KEY_ENCODING, "")); | ||
357 | 359 | | |||
358 | setEol(config.readEntry(KEY_EOL, 0)); | 360 | setEol(config.readEntry(KEY_EOL, 0)); | ||
Show All 34 Lines | 383 | { | |||
393 | 395 | | |||
394 | config.writeEntry(KEY_SMART_HOME, smartHome()); | 396 | config.writeEntry(KEY_SMART_HOME, smartHome()); | ||
395 | config.writeEntry(KEY_SHOW_TABS, showTabs()); | 397 | config.writeEntry(KEY_SHOW_TABS, showTabs()); | ||
396 | config.writeEntry(KEY_TAB_INDENTS, tabIndentsEnabled()); | 398 | config.writeEntry(KEY_TAB_INDENTS, tabIndentsEnabled()); | ||
397 | config.writeEntry(KEY_KEEP_EXTRA_SPACES, keepExtraSpaces()); | 399 | config.writeEntry(KEY_KEEP_EXTRA_SPACES, keepExtraSpaces()); | ||
398 | config.writeEntry(KEY_INDENT_PASTED_TEXT, indentPastedText()); | 400 | config.writeEntry(KEY_INDENT_PASTED_TEXT, indentPastedText()); | ||
399 | config.writeEntry(KEY_BACKSPACE_INDENTS, backspaceIndents()); | 401 | config.writeEntry(KEY_BACKSPACE_INDENTS, backspaceIndents()); | ||
400 | config.writeEntry(KEY_SHOW_SPACES, showSpaces()); | 402 | config.writeEntry(KEY_SHOW_SPACES, showSpaces()); | ||
403 | config.writeEntry(KEY_MARKER_SIZE, markerSize()); | ||||
401 | config.writeEntry(KEY_REPLACE_TABS_DYN, replaceTabsDyn()); | 404 | config.writeEntry(KEY_REPLACE_TABS_DYN, replaceTabsDyn()); | ||
402 | config.writeEntry(KEY_REMOVE_SPACES, removeSpaces()); | 405 | config.writeEntry(KEY_REMOVE_SPACES, removeSpaces()); | ||
403 | config.writeEntry(KEY_NEWLINE_AT_EOF, newLineAtEof()); | 406 | config.writeEntry(KEY_NEWLINE_AT_EOF, newLineAtEof()); | ||
404 | config.writeEntry(KEY_OVR, ovr()); | 407 | config.writeEntry(KEY_OVR, ovr()); | ||
405 | 408 | | |||
406 | config.writeEntry(KEY_ENCODING, encoding()); | 409 | config.writeEntry(KEY_ENCODING, encoding()); | ||
407 | 410 | | |||
408 | config.writeEntry(KEY_EOL, eol()); | 411 | config.writeEntry(KEY_EOL, eol()); | ||
▲ Show 20 Lines • Show All 338 Lines • ▼ Show 20 Line(s) | |||||
747 | { | 750 | { | ||
748 | if (m_showSpacesSet || isGlobal()) { | 751 | if (m_showSpacesSet || isGlobal()) { | ||
749 | return m_showSpaces; | 752 | return m_showSpaces; | ||
750 | } | 753 | } | ||
751 | 754 | | |||
752 | return s_global->showSpaces(); | 755 | return s_global->showSpaces(); | ||
753 | } | 756 | } | ||
754 | 757 | | |||
758 | void KateDocumentConfig::setMarkerSize(uint markerSize) | ||||
anthonyfieroni: function()
{
} | |||||
759 | { | ||||
760 | if (m_markerSize == markerSize) { | ||||
761 | return; | ||||
762 | } | ||||
763 | | ||||
764 | configStart(); | ||||
765 | | ||||
766 | m_markerSize = markerSize; | ||||
767 | | ||||
768 | configEnd(); | ||||
769 | } | ||||
770 | | ||||
771 | uint KateDocumentConfig::markerSize() const | ||||
772 | { | ||||
773 | if (isGlobal()) { | ||||
774 | return m_markerSize; | ||||
775 | } | ||||
776 | | ||||
777 | return s_global->markerSize(); | ||||
778 | } | ||||
779 | | ||||
755 | void KateDocumentConfig::setReplaceTabsDyn(bool on) | 780 | void KateDocumentConfig::setReplaceTabsDyn(bool on) | ||
756 | { | 781 | { | ||
757 | if (m_replaceTabsDynSet && m_replaceTabsDyn == on) { | 782 | if (m_replaceTabsDynSet && m_replaceTabsDyn == on) { | ||
758 | return; | 783 | return; | ||
759 | } | 784 | } | ||
760 | 785 | | |||
761 | configStart(); | 786 | configStart(); | ||
762 | 787 | | |||
▲ Show 20 Lines • Show All 2289 Lines • Show Last 20 Lines |
function()
{
}