[SCM] ktp-contact-applet packaging branch, master, updated. debian/15.12.1-1-966-gde83ac5

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:13:30 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=a1799e7

The following commit has been merged in the master branch:
commit a1799e75426713db51a75abb13d478d5cd1a63ff
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Thu Feb 23 12:21:00 2012 +0100

    Set "Open Contact List" as default onClick action
    
    The whole settings module was removed as it didn't provide anything useful. And some additional cleanup was done.
    
    REVIEW: 104046
    CCMAIL: rdieter at math.unl.edu
---
 presence/CMakeLists.txt          |  4 ---
 presence/src/presence-applet.cpp | 64 +++++-----------------------------------
 presence/src/presence-applet.h   | 13 --------
 3 files changed, 7 insertions(+), 74 deletions(-)

diff --git a/presence/CMakeLists.txt b/presence/CMakeLists.txt
index 80add26..48c6796 100644
--- a/presence/CMakeLists.txt
+++ b/presence/CMakeLists.txt
@@ -28,13 +28,9 @@ include_directories(${CMAKE_SOURCE_DIR}
 
 
 set(plasma_applet_ktp_presence_SRCS
-    src/generalsettings.cpp
     src/presenceapplet.cpp
 )
 
-kde4_add_ui_files(plasma_applet_ktp_presence_SRCS
-                    src/generalsettings.ui
-)
 
 kde4_add_plugin(plasma_applet_ktp_presence ${plasma_applet_ktp_presence_SRCS})
 target_link_libraries(plasma_applet_ktp_presence
diff --git a/presence/src/presence-applet.cpp b/presence/src/presence-applet.cpp
index fa21baf..ab7624f 100644
--- a/presence/src/presence-applet.cpp
+++ b/presence/src/presence-applet.cpp
@@ -17,7 +17,6 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-#include "generalsettings.h"
 #include "presenceapplet.h"
 
 #include <QDBusAbstractAdaptor>
@@ -36,12 +35,11 @@
 #include <TelepathyQt/PendingOperation>
 #include <TelepathyQt/PendingReady>
 
-TelepathyPresenceApplet::TelepathyPresenceApplet(QObject* parent, const QVariantList& args)
+TelepathyPresenceApplet::TelepathyPresenceApplet(QObject *parent, const QVariantList &args)
     : Plasma::PopupApplet(parent, args),
-    m_globalPresence(new KTp::GlobalPresence(this))
+      m_globalPresence(new KTp::GlobalPresence(this))
 {
     setupContextMenuActions();
-    setupAccountManager();
 
     resize(128, 128);
     setAspectRatioMode(Plasma::KeepAspectRatio);
@@ -69,52 +67,19 @@ QList<QAction*> TelepathyPresenceApplet::contextualActions()
     return m_contextActions;
 }
 
-void TelepathyPresenceApplet::createConfigurationInterface(KConfigDialog* parentDialog)
-{
-    GeneralSettings *genSett = new GeneralSettings(m_onClickAction);
-    parentDialog->addPage(genSett, i18n("General"), "configure");
-
-    connect(genSett, SIGNAL(modified()), parentDialog, SLOT(settingsModified()));
-    connect(genSett, SIGNAL(clickActionUpdated(TelepathyPresenceApplet::OnClickAction)), this, SLOT(updateClickAction(TelepathyPresenceApplet::OnClickAction)));
-    connect(parentDialog, SIGNAL(applyClicked()), genSett, SLOT(save()));
-}
-
 void TelepathyPresenceApplet::init()
 {
     Plasma::Applet::init();
 
-    // load on click config
-    KSharedConfigPtr config = KSharedConfig::openConfig(QLatin1String("ktelepathyrc"));
-    KConfigGroup presenceConfig = config->group("PresencePlasmoid");
-    QString actionOnClick = presenceConfig.readEntry("onClick", "nothing");
-
-    if (actionOnClick == "contactlist") {
-        m_onClickAction = SHOW_CONTACTLIST;
-    } else if (actionOnClick == "accounts") {
-        m_onClickAction = SHOW_ACCOUNT_MANAGER;
-    } else {
-        m_onClickAction = DO_NOTHING;
-    }
-
     m_dbusExporter = new DBusExporter(this);
     QDBusConnection::sessionBus().registerObject("/PresenceAppletActive", this, QDBusConnection::ExportAdaptors);
     QDBusConnection::sessionBus().registerService("org.kde.Telepathy.PresenceAppletActive");
-}
 
-void TelepathyPresenceApplet::paintInterface(QPainter* p, const QStyleOptionGraphicsItem* option, const QRect& contentsRect)
-{
-    Plasma::Applet::paintInterface(p, option, contentsRect);
-}
-
-void TelepathyPresenceApplet::setupAccountManager()
-{
     Tp::registerTypes();
 
     // setup the telepathy account manager from where I'll retrieve info on accounts and contacts
     Tp::AccountFactoryPtr  accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
                                                                        Tp::Features() << Tp::Account::FeatureCore
-                                                                       << Tp::Account::FeatureAvatar
-                                                                       << Tp::Account::FeatureCapabilities
                                                                        << Tp::Account::FeatureProtocolInfo
                                                                        << Tp::Account::FeatureProfile);
 
@@ -132,6 +97,10 @@ void TelepathyPresenceApplet::setupAccountManager()
     connect(m_accountManager->becomeReady(), SIGNAL(finished(Tp::PendingOperation*)), this, SLOT(onAccountManagerReady(Tp::PendingOperation*)));
 }
 
+void TelepathyPresenceApplet::paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
+{
+    Plasma::Applet::paintInterface(p, option, contentsRect);
+}
 
 void TelepathyPresenceApplet::setupContextMenuActions()
 {
@@ -194,11 +163,7 @@ void TelepathyPresenceApplet::onAccountManagerReady(Tp::PendingOperation* op)
 
 void TelepathyPresenceApplet::onActivated()
 {
-    if (m_onClickAction == SHOW_CONTACTLIST) {
-        startContactList();
-    } else if (m_onClickAction == SHOW_ACCOUNT_MANAGER) {
-        startAccountManager();
-    }
+    KToolInvocation::startServiceByDesktopName("ktp-contactlist");
 }
 
 void TelepathyPresenceApplet::onPresenceChanged(KTp::Presence presence)
@@ -215,16 +180,6 @@ void TelepathyPresenceApplet::onPresenceActionClicked()
     m_globalPresence->setPresence(p);
 }
 
-void TelepathyPresenceApplet::startAccountManager() const
-{
-    KToolInvocation::startServiceByDesktopName("kcm_ktp_accounts");
-}
-
-void TelepathyPresenceApplet::startContactList() const
-{
-    KToolInvocation::startServiceByDesktopName("ktp-contactlist");
-}
-
 void TelepathyPresenceApplet::toolTipAboutToShow()
 {
     Plasma::ToolTipContent content;
@@ -251,11 +206,6 @@ void TelepathyPresenceApplet::toolTipHidden()
     Plasma::ToolTipManager::self()->clearContent(this);
 }
 
-void TelepathyPresenceApplet::updateClickAction(TelepathyPresenceApplet::OnClickAction clickAction)
-{
-    m_onClickAction = clickAction;
-}
-
 #include "presenceapplet.moc"
 
 // This is the command that links your applet to the .desktop file
diff --git a/presence/src/presence-applet.h b/presence/src/presence-applet.h
index 9e62514..b58fe9f 100644
--- a/presence/src/presence-applet.h
+++ b/presence/src/presence-applet.h
@@ -46,17 +46,10 @@ class TelepathyPresenceApplet: public Plasma::PopupApplet
     Q_OBJECT
 
 public:
-    enum OnClickAction {
-        DO_NOTHING,
-        SHOW_ACCOUNT_MANAGER,
-        SHOW_CONTACTLIST
-    };
-
     TelepathyPresenceApplet(QObject *parent, const QVariantList &args);
     ~TelepathyPresenceApplet();
 
     QList<QAction*> contextualActions();
-    void createConfigurationInterface(KConfigDialog *parentDialog);
     void init();
     void paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect &contentsRect);
 
@@ -67,15 +60,10 @@ private Q_SLOTS:
     void onActivated();
     void onPresenceChanged(KTp::Presence presence);
     void onPresenceActionClicked();
-    void startAccountManager() const;
-    void startContactList() const;
     void toolTipAboutToShow();
     void toolTipHidden();
-    void updateClickAction(TelepathyPresenceApplet::OnClickAction);
 
 private:
-    void setupAccountManager();
-
     /** used only upon creation to setup a list of actions for the context menu */
     void setupContextMenuActions();
 
@@ -83,7 +71,6 @@ private:
 
     Tp::AccountManagerPtr m_accountManager;
     KTp::GlobalPresence  *m_globalPresence;
-    OnClickAction         m_onClickAction;
     DBusExporter         *m_dbusExporter;
 };
 

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list