KTextEditor
9#include "globalstate.h"
11#include "kateglobal.h"
16#include <KConfigGroup>
18using namespace KateVi;
20GlobalState::GlobalState()
22 m_macros =
new Macros();
23 m_mappings =
new Mappings();
24 m_registers =
new Registers();
25 m_searchHistory =
new History();
26 m_replaceHistory =
new History();
27 m_commandHistory =
new History();
29 readConfig(config().data());
32GlobalState::~GlobalState()
34 writeConfig(config().data());
35 config().data()->sync();
37 delete m_searchHistory;
38 delete m_replaceHistory;
39 delete m_commandHistory;
45void GlobalState::writeConfig(
KConfig *configFile)
const
48 KConfigGroup config(configFile, QStringLiteral(
"Kate Vi Input Mode Settings"));
49 m_macros->writeConfig(config);
50 m_mappings->writeConfig(config);
51 m_registers->writeConfig(config);
54void GlobalState::readConfig(
const KConfig *configFile)
57 const KConfigGroup config(configFile, QStringLiteral(
"Kate Vi Input Mode Settings"));
59 m_macros->readConfig(config);
60 m_mappings->readConfig(config);
61 m_registers->readConfig(config);
64KSharedConfigPtr GlobalState::config()
static KSharedConfig::Ptr openConfig(const QString &fileName=QString(), OpenFlags mode=FullConfig, QStandardPaths::StandardLocation type=QStandardPaths::GenericConfigLocation)
static bool unitTestMode()
Returns true, if the unit test mode was enabled through a call of enableUnitTestMode(),...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:15:44 by
doxygen 1.10.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.