Commit 1c48e351 authored by David Edmundson's avatar David Edmundson

[krunner] Avoid reparsing the config load on start

Reviewers: #plasma, apol

Reviewed By: apol

Subscribers: apol, plasma-devel

Tags: #plasma

CCBUG: 416145

Differential Revision: https://phabricator.kde.org/D28365
parent 23534a3b
......@@ -63,7 +63,7 @@ View::View(QWindow *)
m_config = KConfigGroup(KSharedConfig::openConfig(QStringLiteral("krunnerrc")), "General");
setFreeFloating(m_config.readEntry("FreeFloating", false));
reloadConfig();
loadConfig();
new AppAdaptor(this);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/App"), this);
......@@ -107,8 +107,14 @@ View::View(QWindow *)
KDirWatch::self()->addFile(m_config.name());
// Catch both, direct changes to the config file ...
connect(KDirWatch::self(), &KDirWatch::dirty, this, &View::reloadConfig);
connect(KDirWatch::self(), &KDirWatch::created, this, &View::reloadConfig);
connect(KDirWatch::self(), &KDirWatch::dirty, this, [this]() {
m_config.config()->reparseConfiguration();
loadConfig();
});
connect(KDirWatch::self(), &KDirWatch::created, this, [this]() {
m_config.config()->reparseConfiguration();
loadConfig();
});
if (m_floating) {
setLocation(Plasma::Types::Floating);
......@@ -158,9 +164,8 @@ void View::setFreeFloating(bool floating)
positionOnScreen();
}
void View::reloadConfig()
void View::loadConfig()
{
m_config.config()->reparseConfiguration();
setFreeFloating(m_config.readEntry("FreeFloating", false));
const QStringList history = m_config.readEntry("history", QStringList());
......
......@@ -86,7 +86,7 @@ protected Q_SLOTS:
void screenGeometryChanged();
void resetScreenPos();
void displayOrHide();
void reloadConfig();
void loadConfig();
void objectIncubated();
void slotFocusWindowChanged();
......
Markdown is supported
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