Commit ead2c3e8 authored by David Edmundson's avatar David Edmundson
Browse files

Ref KConfig whilst we're using it

Summary:
In current code we would have a KConfigGroup with a dangling KConfig
deleted after the RHS for the group fetch has finished.

BUG: 394534

Test Plan:
Wrote minimal test case of code
It produced a valgrind warning (weirdly didn't crash though)
Modified to correct version
No longer any warnings

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D13599
parent cfe05561
......@@ -31,6 +31,7 @@
#include <QX11Info>
#include <KLocalizedString>
#include <KConfig>
#include <KSharedConfig>
#include <KConfigGroup>
#include <klauncher_iface.h>
......@@ -123,7 +124,8 @@ void X11Backend::applyCursorTheme(const QString& theme, int size)
void X11Backend::kcmInit()
{
KConfigGroup group = KConfig("kcminputrc", KConfig::NoGlobals).group("Mouse");
auto config = KSharedConfig::openConfig("kcminputrc", KConfig::NoGlobals);
KConfigGroup group = config->group("Mouse");
QString theme = group.readEntry("cursorTheme", QString());
QString size = group.readEntry("cursorSize", QString());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment