Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F116594
kazv-config.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
kazv-config.cpp
View Options
/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2021 Tusooa Zhu <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include
"kazv-config.hpp"
#include
<KSharedConfig>
#include
<KConfigGroup>
struct
KazvConfigPrivate
{
KSharedConfigPtr
sessionrc
{
KSharedConfig
::
openConfig
(
"kazvsessionrc"
)};
KConfigGroup
sessionGroup
{
sessionrc
,
"Sessions"
};
KSharedConfigPtr
shortcutsrc
{
KSharedConfig
::
openConfig
(
"kazv/shortcutsrc"
)};
KConfigGroup
shortcutsGroup
{
shortcutsrc
,
"Shortcuts"
};
KSharedConfigPtr
cacheDirectoryrc
{
KSharedConfig
::
openConfig
(
"kazv/cacheDirectoryrc"
)};
KConfigGroup
cacheDirectoryGroup
{
cacheDirectoryrc
,
"CacheDirectory"
};
};
KazvConfig
::
KazvConfig
(
QObject
*
parent
)
:
QObject
(
parent
)
,
m_d
(
new
KazvConfigPrivate
)
{
}
KazvConfig
::~
KazvConfig
()
=
default
;
QString
KazvConfig::lastSession
()
const
{
return
m_d
->
sessionGroup
.
readEntry
(
"lastSession"
,
QString
());
}
void
KazvConfig::setLastSession
(
QString
session
)
{
m_d
->
sessionGroup
.
writeEntry
(
"lastSession"
,
session
);
}
QStringList
KazvConfig::shortcutForAction
(
QString
actionName
)
const
{
return
m_d
->
shortcutsGroup
.
readEntry
(
actionName
,
QStringList
());
}
void
KazvConfig::setShortcutForAction
(
QString
actionName
,
QStringList
shortcut
)
{
m_d
->
shortcutsGroup
.
writeEntry
(
actionName
,
shortcut
);
}
QString
KazvConfig::cacheDirectory
()
const
{
return
m_d
->
cacheDirectoryGroup
.
readEntry
(
"cacheDirectory"
,
QString
());
}
void
KazvConfig::setCacheDirectory
(
QString
cacheDirectory
)
{
m_d
->
cacheDirectoryGroup
.
writeEntry
(
"cacheDirectory"
,
cacheDirectory
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sun, Dec 1, 9:12 PM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41845
Default Alt Text
kazv-config.cpp (1 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment