Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | |||||
4858 | 4858 | | |||
4859 | void KTextEditor::DocumentPrivate::setViewVariable(QString var, QString val) | 4859 | void KTextEditor::DocumentPrivate::setViewVariable(QString var, QString val) | ||
4860 | { | 4860 | { | ||
4861 | KTextEditor::ViewPrivate *v; | 4861 | KTextEditor::ViewPrivate *v; | ||
4862 | bool state; | 4862 | bool state; | ||
4863 | int n; | 4863 | int n; | ||
4864 | QColor c; | 4864 | QColor c; | ||
4865 | foreach (v, m_views) { | 4865 | foreach (v, m_views) { | ||
4866 | if (var == QLatin1String("auto-brackets") && checkBoolValue(val, &state)) { | 4866 | // First, try the new config interface | ||
4867 | v->config()->setAutoBrackets(state); | 4867 | QVariant help(val); // Special treatment to catch "on"/"off" | ||
4868 | if (checkBoolValue(val, &state)) { | ||||
4869 | help = state; | ||||
4870 | } | ||||
4871 | if (v->config()->setValue(var, help)) { | ||||
4872 | } else if (v->renderer()->config()->setValue(var, help)) { | ||||
4873 | | ||||
4874 | // No success? Go the old way | ||||
4868 | } else if (var == QLatin1String("dynamic-word-wrap") && checkBoolValue(val, &state)) { | 4875 | } else if (var == QLatin1String("dynamic-word-wrap") && checkBoolValue(val, &state)) { | ||
4869 | v->config()->setDynWordWrap(state); | 4876 | v->config()->setDynWordWrap(state); | ||
4870 | } else if (var == QLatin1String("persistent-selection") && checkBoolValue(val, &state)) { | | |||
4871 | v->config()->setPersistentSelection(state); | | |||
4872 | } else if (var == QLatin1String("block-selection") && checkBoolValue(val, &state)) { | 4877 | } else if (var == QLatin1String("block-selection") && checkBoolValue(val, &state)) { | ||
4873 | v->setBlockSelection(state); | 4878 | v->setBlockSelection(state); | ||
4874 | } | 4879 | | ||
4875 | //else if ( var = "dynamic-word-wrap-indicators" ) | 4880 | //else if ( var = "dynamic-word-wrap-indicators" ) | ||
4876 | else if (var == QLatin1String("line-numbers") && checkBoolValue(val, &state)) { | | |||
4877 | v->config()->setLineNumbers(state); | | |||
4878 | } else if (var == QLatin1String("icon-border") && checkBoolValue(val, &state)) { | | |||
4879 | v->config()->setIconBar(state); | | |||
4880 | } else if (var == QLatin1String("folding-markers") && checkBoolValue(val, &state)) { | | |||
4881 | v->config()->setFoldingBar(state); | | |||
4882 | } else if (var == QLatin1String("folding-preview") && checkBoolValue(val, &state)) { | | |||
4883 | v->config()->setFoldingPreview(state); | | |||
4884 | } else if (var == QLatin1String("auto-center-lines") && checkIntValue(val, &n)) { | | |||
4885 | v->config()->setAutoCenterLines(n); | | |||
4886 | } else if (var == QLatin1String("icon-bar-color") && checkColorValue(val, c)) { | 4881 | } else if (var == QLatin1String("icon-bar-color") && checkColorValue(val, c)) { | ||
4887 | v->renderer()->config()->setIconBarColor(c); | 4882 | v->renderer()->config()->setIconBarColor(c); | ||
4888 | } else if (var == QLatin1String("scrollbar-minimap") && checkBoolValue(val, &state)) { | | |||
4889 | v->config()->setScrollBarMiniMap(state); | | |||
4890 | } else if (var == QLatin1String("scrollbar-preview") && checkBoolValue(val, &state)) { | | |||
4891 | v->config()->setScrollBarPreview(state); | | |||
4892 | } | 4883 | } | ||
4893 | // RENDERER | 4884 | // RENDERER | ||
4894 | else if (var == QLatin1String("background-color") && checkColorValue(val, c)) { | 4885 | else if (var == QLatin1String("background-color") && checkColorValue(val, c)) { | ||
4895 | v->renderer()->config()->setBackgroundColor(c); | 4886 | v->renderer()->config()->setBackgroundColor(c); | ||
4896 | } else if (var == QLatin1String("selection-color") && checkColorValue(val, c)) { | 4887 | } else if (var == QLatin1String("selection-color") && checkColorValue(val, c)) { | ||
4897 | v->renderer()->config()->setSelectionColor(c); | 4888 | v->renderer()->config()->setSelectionColor(c); | ||
4898 | } else if (var == QLatin1String("current-line-color") && checkColorValue(val, c)) { | 4889 | } else if (var == QLatin1String("current-line-color") && checkColorValue(val, c)) { | ||
4899 | v->renderer()->config()->setHighlightedLineColor(c); | 4890 | v->renderer()->config()->setHighlightedLineColor(c); | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |