9#include "globalstate.h"
15#include <KConfigGroup>
17using namespace KateVi;
19GlobalState::GlobalState()
21 m_macros =
new Macros();
22 m_mappings =
new Mappings();
23 m_registers =
new Registers();
24 m_searchHistory =
new History();
25 m_replaceHistory =
new History();
26 m_commandHistory =
new History();
28 readConfig(config().data());
31GlobalState::~GlobalState()
33 writeConfig(config().data());
34 config().data()->sync();
36 delete m_searchHistory;
37 delete m_replaceHistory;
38 delete m_commandHistory;
44void GlobalState::writeConfig(
KConfig *configFile)
const
47 KConfigGroup config(configFile, QStringLiteral(
"Kate Vi Input Mode Settings"));
48 m_macros->writeConfig(config);
49 m_mappings->writeConfig(config);
50 m_registers->writeConfig(config);
53void GlobalState::readConfig(
const KConfig *configFile)
56 const KConfigGroup config(configFile, QStringLiteral(
"Kate Vi Input Mode Settings"));
58 m_macros->readConfig(config);
59 m_mappings->readConfig(config);
60 m_registers->readConfig(config);
63KSharedConfigPtr GlobalState::config()
66 return QStandardPaths::isTestModeEnabled()
static KSharedConfig::Ptr openConfig(const QString &fileName=QString(), OpenFlags mode=FullConfig, QStandardPaths::StandardLocation type=QStandardPaths::GenericConfigLocation)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:27 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.