Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
ffa24a94
Commit
ffa24a94
authored
Mar 18, 2021
by
Alexander Lohnau
💬
Browse files
krunner: Store pinned state in krunnerstaterc and not in config
parent
9c97ee51
Changes
2
Hide whitespace changes
Inline
Side-by-side
krunner/view.cpp
View file @
ffa24a94
...
...
@@ -62,6 +62,10 @@ View::View(QWindow *)
setTitle
(
i18n
(
"KRunner"
));
m_config
=
KConfigGroup
(
KSharedConfig
::
openConfig
(),
"General"
);
m_stateData
=
KSharedConfig
::
openConfig
(
QStringLiteral
(
"krunnerstaterc"
),
//
KConfig
::
NoGlobals
,
QStandardPaths
::
GenericDataLocation
)
->
group
(
"General"
);
m_configWatcher
=
KConfigWatcher
::
create
(
KSharedConfig
::
openConfig
());
connect
(
m_configWatcher
.
data
(),
&
KConfigWatcher
::
configChanged
,
this
,
[
this
](
const
KConfigGroup
&
group
,
const
QByteArrayList
&
names
)
{
Q_UNUSED
(
names
);
...
...
@@ -156,7 +160,7 @@ void View::setFreeFloating(bool floating)
void
View
::
loadConfig
()
{
setFreeFloating
(
m_config
.
readEntry
(
"FreeFloating"
,
false
));
setPinned
(
m_
config
.
readEntry
(
"Pinned"
,
false
));
setPinned
(
m_
stateData
.
readEntry
(
"Pinned"
,
false
));
}
bool
View
::
event
(
QEvent
*
event
)
...
...
@@ -375,7 +379,7 @@ void View::setPinned(bool pinned)
{
if
(
m_pinned
!=
pinned
)
{
m_pinned
=
pinned
;
m_
config
.
writeEntry
(
"Pinned"
,
pinned
);
m_
stateData
.
writeEntry
(
"Pinned"
,
pinned
);
Q_EMIT
pinnedChanged
();
}
}
krunner/view.h
View file @
ffa24a94
...
...
@@ -99,6 +99,7 @@ private:
QPoint
m_customPos
;
KDeclarative
::
QmlObject
*
m_qmlObj
;
KConfigGroup
m_config
;
KConfigGroup
m_stateData
;
KConfigWatcher
::
Ptr
m_configWatcher
;
qreal
m_offset
;
bool
m_floating
:
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment