[SCM] ktp-kded-integration-module packaging branch, master, updated. debian/15.12.1-2-382-gbd961c2

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:15:31 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-kded-module.git;a=commitdiff;h=1172c81

The following commit has been merged in the master branch:
commit 1172c8160afa5f857dcd0cc33ab4e43f0b6587eb
Author: Alexandr Akulich <akulichalexander at gmail.com>
Date:   Mon Nov 25 17:08:27 2013 +0100

    Small refactor of Telepathy KDED Module Plugins
    
    TelepathyKDEDModulePlugin: Added virtual public slot reloadConfig().
    AutoAway: Refactor readConfig() method to reloadConfig() slot.
    AutoAway: Get rid onSettingsChanged().
    ScreenSaverAway: Refactor readConfig() method to reloadConfig() slot.
    ScreenSaverAway: Get rid onSettingsChanged().
    TelepathyMPRIS: Rename onSettingsChanged() to reloadConfig().
    
    Module: Connect settingsChanged() to reloadConfig() plugins slot.
    
    Get rid some useless includes.
    
    REVIEW: 113814
---
 autoaway.cpp                   | 12 ++----------
 autoaway.h                     |  6 +-----
 contactnotify.h                |  1 -
 screensaveraway.cpp            | 11 ++---------
 screensaveraway.h              |  6 +-----
 telepathy-kded-module-plugin.h |  4 ++++
 telepathy-module.cpp           |  6 +++---
 telepathy-mpris.cpp            |  4 ++--
 telepathy-mpris.h              |  2 +-
 9 files changed, 16 insertions(+), 36 deletions(-)

diff --git a/autoaway.cpp b/autoaway.cpp
index ec2afb6..79f62f0 100644
--- a/autoaway.cpp
+++ b/autoaway.cpp
@@ -19,9 +19,6 @@
 
 #include "autoaway.h"
 
-#include <TelepathyQt/AccountManager>
-#include <TelepathyQt/AccountSet>
-
 #include <KDebug>
 #include <KIdleTime>
 #include <KConfig>
@@ -34,7 +31,7 @@ AutoAway::AutoAway(KTp::GlobalPresence* globalPresence, QObject* parent)
       m_awayTimeoutId(-1),
       m_extAwayTimeoutId(-1)
 {
-    readConfig();
+    reloadConfig();
 
     connect(KIdleTime::instance(), SIGNAL(timeoutReached(int)),
             this, SLOT(timeoutReached(int)));
@@ -82,7 +79,7 @@ void AutoAway::backFromIdle()
     setActive(false);
 }
 
-void AutoAway::readConfig()
+void AutoAway::reloadConfig()
 {
     KSharedConfigPtr config = KSharedConfig::openConfig(QLatin1String("ktelepathyrc"));
     config.data()->reparseConfiguration();
@@ -112,8 +109,3 @@ void AutoAway::readConfig()
         m_extAwayTimeoutId = KIdleTime::instance()->addIdleTimeout(xaTime * 60 * 1000);
     }
 }
-
-void AutoAway::onSettingsChanged()
-{
-    readConfig();
-}
diff --git a/autoaway.h b/autoaway.h
index 9496047..ac42718 100644
--- a/autoaway.h
+++ b/autoaway.h
@@ -23,9 +23,6 @@
 
 #include "telepathy-kded-module-plugin.h"
 
-#include <TelepathyQt/Presence>
-#include <TelepathyQt/AccountManager>
-
 namespace KTp {
 class GlobalPresence;
 }
@@ -38,11 +35,10 @@ public:
     explicit AutoAway(KTp::GlobalPresence *globalPresence, QObject* parent = 0);
     ~AutoAway();
 
-    void readConfig();
     QString pluginName() const;
 
 public Q_SLOTS:
-    void onSettingsChanged();
+    void reloadConfig();
 
 private Q_SLOTS:
     void timeoutReached(int);
diff --git a/contactnotify.h b/contactnotify.h
index e3a5bb6..ee79f89 100644
--- a/contactnotify.h
+++ b/contactnotify.h
@@ -20,7 +20,6 @@
 #define CONTACTNOTIFY_H
 
 #include <TelepathyQt/Types>
-#include <TelepathyQt/Connection>
 
 #include <KTp/global-contact-manager.h>
 
diff --git a/screensaveraway.cpp b/screensaveraway.cpp
index 14f2092..6c47cfb 100644
--- a/screensaveraway.cpp
+++ b/screensaveraway.cpp
@@ -22,8 +22,6 @@
 #include <QDBusConnectionInterface>
 #include <QDBusInterface>
 
-#include <TelepathyQt/AccountManager>
-#include <TelepathyQt/AccountSet>
 #include <KDebug>
 #include <KConfig>
 #include <KConfigGroup>
@@ -32,7 +30,7 @@
 ScreenSaverAway::ScreenSaverAway(KTp::GlobalPresence *globalPresence, QObject *parent)
     : TelepathyKDEDModulePlugin(globalPresence, parent)
 {
-    readConfig();
+    reloadConfig();
 
   //watch for screen locked
   QDBusConnection::sessionBus().connect(QString(),
@@ -68,7 +66,7 @@ void ScreenSaverAway::onActiveChanged(bool newState)
     }
 }
 
-void ScreenSaverAway::readConfig()
+void ScreenSaverAway::reloadConfig()
 {
     KSharedConfigPtr config = KSharedConfig::openConfig(QLatin1String("ktelepathyrc"));
     config.data()->reparseConfiguration();
@@ -85,8 +83,3 @@ void ScreenSaverAway::readConfig()
         setEnabled(false);
     }
 }
-
-void ScreenSaverAway::onSettingsChanged()
-{
-    readConfig();
-}
diff --git a/screensaveraway.h b/screensaveraway.h
index 9332953..92344e8 100644
--- a/screensaveraway.h
+++ b/screensaveraway.h
@@ -23,9 +23,6 @@
 
 #include "telepathy-kded-module-plugin.h"
 
-#include <TelepathyQt/Presence>
-#include <TelepathyQt/AccountManager>
-
 namespace KTp {
 class GlobalPresence;
 }
@@ -38,11 +35,10 @@ public:
     explicit ScreenSaverAway(KTp::GlobalPresence *globalPresence, QObject *parent = 0);
     ~ScreenSaverAway();
 
-    void readConfig();
     QString pluginName() const;
 
 public Q_SLOTS:
-    void onSettingsChanged();
+    void reloadConfig();
 
 private Q_SLOTS:
     void onActiveChanged(bool newState);
diff --git a/telepathy-kded-module-plugin.h b/telepathy-kded-module-plugin.h
index ac960e2..b837903 100644
--- a/telepathy-kded-module-plugin.h
+++ b/telepathy-kded-module-plugin.h
@@ -43,6 +43,10 @@ public:
 
     Tp::Presence requestedPresence() const { return m_requestedPresence; }
 
+public Q_SLOTS:
+    /// Deriving classes with configuration must have this method reimplemented
+    virtual void reloadConfig() = 0;
+
 Q_SIGNALS:
     void requestPresenceChange(const Tp::Presence &presence);
     void activate(bool);
diff --git a/telepathy-module.cpp b/telepathy-module.cpp
index 19604bb..a754283 100644
--- a/telepathy-module.cpp
+++ b/telepathy-module.cpp
@@ -112,21 +112,21 @@ void TelepathyModule::onAccountManagerReady(Tp::PendingOperation* op)
             this, SLOT(onPluginActivated(bool)));
 
     connect(this, SIGNAL(settingsChanged()),
-            m_autoAway, SLOT(onSettingsChanged()));
+            m_autoAway, SLOT(reloadConfig()));
 
     m_screenSaverAway = new ScreenSaverAway(m_globalPresence, this);
     connect(m_screenSaverAway, SIGNAL(activate(bool)),
             this, SLOT(onPluginActivated(bool)));
 
     connect(this, SIGNAL(settingsChanged()),
-            m_screenSaverAway, SLOT(onSettingsChanged()));
+            m_screenSaverAway, SLOT(reloadConfig()));
 
     m_mpris = new TelepathyMPRIS(m_globalPresence, this);
     connect(m_mpris, SIGNAL(activate(bool)),
             this, SLOT(onPluginActivated(bool)));
 
     connect(this, SIGNAL(settingsChanged()),
-            m_mpris, SLOT(onSettingsChanged()));
+            m_mpris, SLOT(reloadConfig()));
 
     m_autoConnect = new AutoConnect(this);
     m_autoConnect->setAccountManager(m_accountManager);
diff --git a/telepathy-mpris.cpp b/telepathy-mpris.cpp
index a014b51..529a100 100644
--- a/telepathy-mpris.cpp
+++ b/telepathy-mpris.cpp
@@ -43,7 +43,7 @@ TelepathyMPRIS::TelepathyMPRIS(KTp::GlobalPresence* globalPresence, QObject* par
       m_playbackActive(false)
 {
     //read settings and detect players if plugin is enabled
-    onSettingsChanged();
+    reloadConfig();
 
     QDBusConnection::sessionBus().connect(QString(), QLatin1String("/Telepathy"), QLatin1String("org.kde.Telepathy"),
                                           QLatin1String("activateNowPlaying"), this, SLOT(onActivateNowPlaying()) );
@@ -122,7 +122,7 @@ void TelepathyMPRIS::serviceNameFetchFinished(QDBusPendingCallWatcher *callWatch
     }
 }
 
-void TelepathyMPRIS::onSettingsChanged()
+void TelepathyMPRIS::reloadConfig()
 {
     KSharedConfigPtr config = KSharedConfig::openConfig(QLatin1String("ktelepathyrc"));
     config.data()->reparseConfiguration();
diff --git a/telepathy-mpris.h b/telepathy-mpris.h
index f9469f1..05b77c9 100644
--- a/telepathy-mpris.h
+++ b/telepathy-mpris.h
@@ -34,7 +34,7 @@ public:
     QString pluginName() const;
 
 public Q_SLOTS:
-    void onSettingsChanged();
+    void reloadConfig();
     void onActivateNowPlaying();
     void onDeactivateNowPlaying();
 

-- 
ktp-kded-integration-module packaging



More information about the pkg-kde-commits mailing list