Change in plasma-framework[master]: Reparse settings when they change

David Edmundson (Code Review) noreply at kde.org
Thu Dec 11 01:00:06 UTC 2014


David Edmundson has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/217

Change subject: Reparse settings when they change
......................................................................

Reparse settings when they change

Change-Id: Ibb13077943330417fa08d23ce1ea60f2aff5defc
---
M src/declarativeimports/core/tooltip.cpp
M src/declarativeimports/core/tooltip.h
2 files changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework refs/changes/17/217/1

diff --git a/src/declarativeimports/core/tooltip.cpp b/src/declarativeimports/core/tooltip.cpp
index dc0b457..2e19f0d 100644
--- a/src/declarativeimports/core/tooltip.cpp
+++ b/src/declarativeimports/core/tooltip.cpp
@@ -49,7 +49,7 @@
     m_showTimer->setSingleShot(true);
     connect(m_showTimer, &QTimer::timeout, this, &ToolTip::showToolTip);
 
-    settingsChanged();
+    loadSettings();
 
     const QString configFile = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + "plasmarc";
     KDirWatch::self()->addFile(configFile);
@@ -71,6 +71,11 @@
 
 void ToolTip::settingsChanged()
 {
+    KSharedConfig::openConfig("plasmarc")->reparseConfiguration();
+}
+
+void ToolTip::loadSettings()
+{
     KConfigGroup cfg = KConfigGroup(KSharedConfig::openConfig("plasmarc"), "PlasmaToolTips");
     m_interval = cfg.readEntry("Delay", 700);
     m_tooltipsEnabledGlobally = (m_interval > 0);
diff --git a/src/declarativeimports/core/tooltip.h b/src/declarativeimports/core/tooltip.h
index 105bf38..f71bdd1 100644
--- a/src/declarativeimports/core/tooltip.h
+++ b/src/declarativeimports/core/tooltip.h
@@ -180,6 +180,7 @@
     void settingsChanged();
 
 private:
+    void loadSettings();
     bool m_tooltipsEnabledGlobally;
     bool m_containsMouse;
     Plasma::Types::Location m_location;

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/217
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb13077943330417fa08d23ce1ea60f2aff5defc
Gerrit-PatchSet: 1
Gerrit-Project: plasma-framework
Gerrit-Branch: master
Gerrit-Owner: David Edmundson <david at davidedmundson.co.uk>
Gerrit-Reviewer: Marco Martin <notmart at gmail.com>


More information about the Plasma-devel mailing list