Changeset View
Changeset View
Standalone View
Standalone View
src/view/kateview.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 1453 | if (m_viewInternal->m_columnScroll->isVisible()) { | |||
---|---|---|---|---|---|
1454 | m_viewInternal->m_columnScroll->update(); | 1454 | m_viewInternal->m_columnScroll->update(); | ||
1455 | } | 1455 | } | ||
1456 | 1456 | | |||
1457 | emit focusOut(this); | 1457 | emit focusOut(this); | ||
1458 | } | 1458 | } | ||
1459 | 1459 | | |||
1460 | void KTextEditor::ViewPrivate::setDynWrapIndicators(int mode) | 1460 | void KTextEditor::ViewPrivate::setDynWrapIndicators(int mode) | ||
1461 | { | 1461 | { | ||
1462 | config()->setDynWordWrapIndicators(mode); | 1462 | config()->setValue(KateViewConfig::DynWordWrapIndicators, mode); | ||
1463 | } | 1463 | } | ||
1464 | 1464 | | |||
1465 | bool KTextEditor::ViewPrivate::isOverwriteMode() const | 1465 | bool KTextEditor::ViewPrivate::isOverwriteMode() const | ||
1466 | { | 1466 | { | ||
1467 | return doc()->config()->ovr(); | 1467 | return doc()->config()->ovr(); | ||
1468 | } | 1468 | } | ||
1469 | 1469 | | |||
1470 | void KTextEditor::ViewPrivate::reloadFile() | 1470 | void KTextEditor::ViewPrivate::reloadFile() | ||
▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Line(s) | |||||
1605 | 1605 | | |||
1606 | void KTextEditor::ViewPrivate::readSessionConfig(const KConfigGroup &config, const QSet<QString> &flags) | 1606 | void KTextEditor::ViewPrivate::readSessionConfig(const KConfigGroup &config, const QSet<QString> &flags) | ||
1607 | { | 1607 | { | ||
1608 | Q_UNUSED(flags) | 1608 | Q_UNUSED(flags) | ||
1609 | 1609 | | |||
1610 | // cursor position | 1610 | // cursor position | ||
1611 | setCursorPositionInternal(KTextEditor::Cursor(config.readEntry("CursorLine", 0), config.readEntry("CursorColumn", 0))); | 1611 | setCursorPositionInternal(KTextEditor::Cursor(config.readEntry("CursorLine", 0), config.readEntry("CursorColumn", 0))); | ||
1612 | 1612 | | |||
1613 | // restore dyn word wrap if set for this view | 1613 | m_config->setDynWordWrap(config.readEntry("Dynamic Word Wrap", false)); | ||
1614 | if (config.hasKey("Dynamic Word Wrap")) { | | |||
1615 | m_config->setDynWordWrap(config.readEntry("Dynamic Word Wrap", false)); | | |||
1616 | } | | |||
1617 | 1614 | | |||
1618 | // restore text folding | 1615 | // restore text folding | ||
1619 | m_savedFoldingState = QJsonDocument::fromJson(config.readEntry("TextFolding", QByteArray())); | 1616 | m_savedFoldingState = QJsonDocument::fromJson(config.readEntry("TextFolding", QByteArray())); | ||
1620 | applyFoldingState(); | 1617 | applyFoldingState(); | ||
1621 | 1618 | | |||
1622 | Q_FOREACH(KateAbstractInputMode *mode, m_viewInternal->m_inputModes) { | 1619 | Q_FOREACH(KateAbstractInputMode *mode, m_viewInternal->m_inputModes) { | ||
1623 | mode->readSessionConfig(config); | 1620 | mode->readSessionConfig(config); | ||
1624 | } | 1621 | } | ||
1625 | } | 1622 | } | ||
1626 | 1623 | | |||
1627 | void KTextEditor::ViewPrivate::writeSessionConfig(KConfigGroup &config, const QSet<QString> &flags) | 1624 | void KTextEditor::ViewPrivate::writeSessionConfig(KConfigGroup &config, const QSet<QString> &flags) | ||
1628 | { | 1625 | { | ||
1629 | Q_UNUSED(flags) | 1626 | Q_UNUSED(flags) | ||
1630 | 1627 | | |||
1631 | // cursor position | 1628 | // cursor position | ||
1632 | config.writeEntry("CursorLine", cursorPosition().line()); | 1629 | config.writeEntry("CursorLine", cursorPosition().line()); | ||
1633 | config.writeEntry("CursorColumn", cursorPosition().column()); | 1630 | config.writeEntry("CursorColumn", cursorPosition().column()); | ||
1634 | 1631 | | |||
1635 | // save dyn word wrap if set for this view | 1632 | config.writeEntry("Dynamic Word Wrap", m_config->dynWordWrap()); | ||
1636 | if (m_config->dynWordWrapSet()) { | | |||
1637 | config.writeEntry("Dynamic Word Wrap", m_config->dynWordWrap()); | | |||
1638 | } | | |||
1639 | 1633 | | |||
1640 | // save text folding state | 1634 | // save text folding state | ||
1641 | saveFoldingState(); | 1635 | saveFoldingState(); | ||
1642 | config.writeEntry("TextFolding", m_savedFoldingState.toJson(QJsonDocument::Compact)); | 1636 | config.writeEntry("TextFolding", m_savedFoldingState.toJson(QJsonDocument::Compact)); | ||
1643 | m_savedFoldingState = QJsonDocument(); | 1637 | m_savedFoldingState = QJsonDocument(); | ||
1644 | 1638 | | |||
1645 | Q_FOREACH(KateAbstractInputMode *mode, m_viewInternal->m_inputModes) { | 1639 | Q_FOREACH(KateAbstractInputMode *mode, m_viewInternal->m_inputModes) { | ||
1646 | mode->writeSessionConfig(config); | 1640 | mode->writeSessionConfig(config); | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
1689 | 1683 | | |||
1690 | void KTextEditor::ViewPrivate::toggleIconBorder() | 1684 | void KTextEditor::ViewPrivate::toggleIconBorder() | ||
1691 | { | 1685 | { | ||
1692 | config()->setIconBar(!config()->iconBar()); | 1686 | config()->setIconBar(!config()->iconBar()); | ||
1693 | } | 1687 | } | ||
1694 | 1688 | | |||
1695 | void KTextEditor::ViewPrivate::setLineNumbersOn(bool enable) | 1689 | void KTextEditor::ViewPrivate::setLineNumbersOn(bool enable) | ||
1696 | { | 1690 | { | ||
1697 | config()->setLineNumbers(enable); | 1691 | config()->setValue(KateViewConfig::ShowLineNumbers, enable); | ||
1698 | } | 1692 | } | ||
1699 | 1693 | | |||
1700 | void KTextEditor::ViewPrivate::toggleLineNumbersOn() | 1694 | void KTextEditor::ViewPrivate::toggleLineNumbersOn() | ||
1701 | { | 1695 | { | ||
1702 | config()->setLineNumbers(!config()->lineNumbers()); | 1696 | config()->setValue(KateViewConfig::ShowLineNumbers, !config()->lineNumbers()); | ||
1703 | } | 1697 | } | ||
1704 | 1698 | | |||
1705 | void KTextEditor::ViewPrivate::setScrollBarMarks(bool enable) | 1699 | void KTextEditor::ViewPrivate::setScrollBarMarks(bool enable) | ||
1706 | { | 1700 | { | ||
1707 | config()->setScrollBarMarks(enable); | 1701 | config()->setValue(KateViewConfig::ShowScrollBarMarks, enable); | ||
1708 | } | 1702 | } | ||
1709 | 1703 | | |||
1710 | void KTextEditor::ViewPrivate::toggleScrollBarMarks() | 1704 | void KTextEditor::ViewPrivate::toggleScrollBarMarks() | ||
1711 | { | 1705 | { | ||
1712 | config()->setScrollBarMarks(!config()->scrollBarMarks()); | 1706 | config()->setValue(KateViewConfig::ShowScrollBarMarks, !config()->scrollBarMarks()); | ||
1713 | } | 1707 | } | ||
1714 | 1708 | | |||
1715 | void KTextEditor::ViewPrivate::setScrollBarMiniMap(bool enable) | 1709 | void KTextEditor::ViewPrivate::setScrollBarMiniMap(bool enable) | ||
1716 | { | 1710 | { | ||
1717 | config()->setScrollBarMiniMap(enable); | 1711 | config()->setScrollBarMiniMap(enable); | ||
1718 | } | 1712 | } | ||
1719 | 1713 | | |||
1720 | void KTextEditor::ViewPrivate::toggleScrollBarMiniMap() | 1714 | void KTextEditor::ViewPrivate::toggleScrollBarMiniMap() | ||
▲ Show 20 Lines • Show All 182 Lines • ▼ Show 20 Line(s) | 3303 | if (value.canConvert(QVariant::Color)) { | |||
3326 | } | 3320 | } | ||
3327 | 3321 | | |||
3328 | } else if (value.type() == QVariant::Bool) { | 3322 | } else if (value.type() == QVariant::Bool) { | ||
3329 | // Note explicit type check above. If we used canConvert, then | 3323 | // Note explicit type check above. If we used canConvert, then | ||
3330 | // values of type UInt will be trapped here. | 3324 | // values of type UInt will be trapped here. | ||
3331 | if (key == QLatin1String("icon-bar")) { | 3325 | if (key == QLatin1String("icon-bar")) { | ||
3332 | config()->setIconBar(value.toBool()); | 3326 | config()->setIconBar(value.toBool()); | ||
3333 | } else if (key == QLatin1String("line-numbers")) { | 3327 | } else if (key == QLatin1String("line-numbers")) { | ||
3334 | config()->setLineNumbers(value.toBool()); | 3328 | config()->setValue(KateViewConfig::ShowLineNumbers, value.toBool()); | ||
3335 | } else if (key == QLatin1String("dynamic-word-wrap")) { | 3329 | } else if (key == QLatin1String("dynamic-word-wrap")) { | ||
3336 | config()->setDynWordWrap(value.toBool()); | 3330 | config()->setDynWordWrap(value.toBool()); | ||
3337 | } else if (key == QLatin1String("allow-mark-menu")) { | 3331 | } else if (key == QLatin1String("allow-mark-menu")) { | ||
3338 | config()->setAllowMarkMenu(value.toBool()); | 3332 | config()->setAllowMarkMenu(value.toBool()); | ||
3339 | } else if (key == QLatin1String("folding-bar")) { | 3333 | } else if (key == QLatin1String("folding-bar")) { | ||
3340 | config()->setFoldingBar(value.toBool()); | 3334 | config()->setFoldingBar(value.toBool()); | ||
3341 | } else if (key == QLatin1String("folding-preview")) { | 3335 | } else if (key == QLatin1String("folding-preview")) { | ||
3342 | config()->setFoldingPreview(value.toBool()); | 3336 | config()->setFoldingPreview(value.toBool()); | ||
3343 | } else if (key == QLatin1String("modification-markers")) { | 3337 | } else if (key == QLatin1String("modification-markers")) { | ||
3344 | config()->setLineModification(value.toBool()); | 3338 | config()->setLineModification(value.toBool()); | ||
3345 | } else if (key == QLatin1String("keyword-completion")) { | 3339 | } else if (key == QLatin1String("keyword-completion")) { | ||
3346 | config()->setKeywordCompletion(value.toBool()); | 3340 | config()->setKeywordCompletion(value.toBool()); | ||
3347 | } else if (key == QLatin1String("word-count")) { | 3341 | } else if (key == QLatin1String("word-count")) { | ||
3348 | config()->setShowWordCount(value.toBool()); | 3342 | config()->setShowWordCount(value.toBool()); | ||
3349 | } else if (key == QLatin1String("scrollbar-minimap")) { | 3343 | } else if (key == QLatin1String("scrollbar-minimap")) { | ||
3350 | config()->setScrollBarMiniMap(value.toBool()); | 3344 | config()->setScrollBarMiniMap(value.toBool()); | ||
3351 | } else if (key == QLatin1String("scrollbar-preview")) { | 3345 | } else if (key == QLatin1String("scrollbar-preview")) { | ||
3352 | config()->setScrollBarPreview(value.toBool()); | 3346 | config()->setValue(KateViewConfig::ShowScrollBarPreview, value.toBool()); | ||
3353 | } | 3347 | } | ||
3354 | 3348 | | |||
3355 | } else if (value.canConvert(QVariant::UInt)) { | 3349 | } else if (value.canConvert(QVariant::UInt)) { | ||
3356 | if (key == QLatin1String("default-mark-type")) { | 3350 | if (key == QLatin1String("default-mark-type")) { | ||
3357 | config()->setDefaultMarkType(value.toUInt()); | 3351 | config()->setDefaultMarkType(value.toUInt()); | ||
3358 | } | 3352 | } | ||
3359 | 3353 | | |||
3360 | } else if (value.canConvert(QVariant::Font)) { | 3354 | } else if (value.canConvert(QVariant::Font)) { | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |