Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.cpp
Show First 20 Lines • Show All 5047 Lines • ▼ Show 20 Line(s) | 5047 | { | |||
---|---|---|---|---|---|
5048 | static const QStringList keys = { | 5048 | static const QStringList keys = { | ||
5049 | QStringLiteral("backup-on-save-local"), | 5049 | QStringLiteral("backup-on-save-local"), | ||
5050 | QStringLiteral("backup-on-save-suffix"), | 5050 | QStringLiteral("backup-on-save-suffix"), | ||
5051 | QStringLiteral("backup-on-save-prefix"), | 5051 | QStringLiteral("backup-on-save-prefix"), | ||
5052 | QStringLiteral("replace-tabs"), | 5052 | QStringLiteral("replace-tabs"), | ||
5053 | QStringLiteral("indent-pasted-text"), | 5053 | QStringLiteral("indent-pasted-text"), | ||
5054 | QStringLiteral("tab-width"), | 5054 | QStringLiteral("tab-width"), | ||
5055 | QStringLiteral("indent-width"), | 5055 | QStringLiteral("indent-width"), | ||
5056 | QStringLiteral("on-the-fly-spellcheck"), | ||||
5056 | }; | 5057 | }; | ||
5057 | return keys; | 5058 | return keys; | ||
5058 | } | 5059 | } | ||
5059 | 5060 | | |||
5060 | QVariant KTextEditor::DocumentPrivate::configValue(const QString &key) | 5061 | QVariant KTextEditor::DocumentPrivate::configValue(const QString &key) | ||
5061 | { | 5062 | { | ||
5062 | if (key == QLatin1String("backup-on-save-local")) { | 5063 | if (key == QLatin1String("backup-on-save-local")) { | ||
5063 | return m_config->backupFlags() & KateDocumentConfig::LocalFiles; | 5064 | return m_config->backupFlags() & KateDocumentConfig::LocalFiles; | ||
5064 | } else if (key == QLatin1String("backup-on-save-remote")) { | 5065 | } else if (key == QLatin1String("backup-on-save-remote")) { | ||
5065 | return m_config->backupFlags() & KateDocumentConfig::RemoteFiles; | 5066 | return m_config->backupFlags() & KateDocumentConfig::RemoteFiles; | ||
5066 | } else if (key == QLatin1String("backup-on-save-suffix")) { | 5067 | } else if (key == QLatin1String("backup-on-save-suffix")) { | ||
5067 | return m_config->backupSuffix(); | 5068 | return m_config->backupSuffix(); | ||
5068 | } else if (key == QLatin1String("backup-on-save-prefix")) { | 5069 | } else if (key == QLatin1String("backup-on-save-prefix")) { | ||
5069 | return m_config->backupPrefix(); | 5070 | return m_config->backupPrefix(); | ||
5070 | } else if (key == QLatin1String("replace-tabs")) { | 5071 | } else if (key == QLatin1String("replace-tabs")) { | ||
5071 | return m_config->replaceTabsDyn(); | 5072 | return m_config->replaceTabsDyn(); | ||
5072 | } else if (key == QLatin1String("indent-pasted-text")) { | 5073 | } else if (key == QLatin1String("indent-pasted-text")) { | ||
5073 | return m_config->indentPastedText(); | 5074 | return m_config->indentPastedText(); | ||
5074 | } else if (key == QLatin1String("tab-width")) { | 5075 | } else if (key == QLatin1String("tab-width")) { | ||
5075 | return m_config->tabWidth(); | 5076 | return m_config->tabWidth(); | ||
5076 | } else if (key == QLatin1String("indent-width")) { | 5077 | } else if (key == QLatin1String("indent-width")) { | ||
5077 | return m_config->indentationWidth(); | 5078 | return m_config->indentationWidth(); | ||
5079 | } else if (key == QLatin1String("on-the-fly-spellcheck")) { | ||||
5080 | return isOnTheFlySpellCheckingEnabled(); | ||||
5078 | } | 5081 | } | ||
5079 | 5082 | | |||
5080 | // return invalid variant | 5083 | // return invalid variant | ||
5081 | return QVariant(); | 5084 | return QVariant(); | ||
5082 | } | 5085 | } | ||
5083 | 5086 | | |||
5084 | void KTextEditor::DocumentPrivate::setConfigValue(const QString &key, const QVariant &value) | 5087 | void KTextEditor::DocumentPrivate::setConfigValue(const QString &key, const QVariant &value) | ||
5085 | { | 5088 | { | ||
Show All 22 Lines | 5110 | } else { | |||
5108 | f ^= KateDocumentConfig::RemoteFiles; | 5111 | f ^= KateDocumentConfig::RemoteFiles; | ||
5109 | } | 5112 | } | ||
5110 | 5113 | | |||
5111 | m_config->setBackupFlags(f); | 5114 | m_config->setBackupFlags(f); | ||
5112 | } else if (key == QLatin1String("replace-tabs")) { | 5115 | } else if (key == QLatin1String("replace-tabs")) { | ||
5113 | m_config->setReplaceTabsDyn(bValue); | 5116 | m_config->setReplaceTabsDyn(bValue); | ||
5114 | } else if (key == QLatin1String("indent-pasted-text")) { | 5117 | } else if (key == QLatin1String("indent-pasted-text")) { | ||
5115 | m_config->setIndentPastedText(bValue); | 5118 | m_config->setIndentPastedText(bValue); | ||
5119 | } else if (key == QLatin1String("on-the-fly-spellcheck")) { | ||||
5120 | onTheFlySpellCheckingEnabled(bValue); | ||||
5116 | } | 5121 | } | ||
5117 | } else if (value.canConvert(QVariant::Int)) { | 5122 | } else if (value.canConvert(QVariant::Int)) { | ||
5118 | if (key == QLatin1String("tab-width")) { | 5123 | if (key == QLatin1String("tab-width")) { | ||
5119 | config()->setTabWidth(value.toInt()); | 5124 | config()->setTabWidth(value.toInt()); | ||
5120 | } else if (key == QLatin1String("indent-width")) { | 5125 | } else if (key == QLatin1String("indent-width")) { | ||
5121 | config()->setIndentationWidth(value.toInt()); | 5126 | config()->setIndentationWidth(value.toInt()); | ||
5122 | } | 5127 | } | ||
5123 | } | 5128 | } | ||
▲ Show 20 Lines • Show All 864 Lines • Show Last 20 Lines |