[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:11:16 UTC 2016


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

The following commit has been merged in the master branch:
commit 35b679c8976c459fb916a26e2e93df95605305ab
Author: George Goldberg <george.goldberg at collabora.co.uk>
Date:   Thu May 26 14:44:45 2011 +0100

    Remove old C++ files ready for a QML port.
---
 presence/CMakeLists.txt                     |  28 ---
 presence/plasma-applet-ktp-presence.desktop |  40 ---
 presence/src/presence.cpp                   | 374 ----------------------------
 presence/src/presence.h                     |  83 ------
 4 files changed, 525 deletions(-)

diff --git a/presence/CMakeLists.txt b/presence/CMakeLists.txt
deleted file mode 100644
index b3fa636..0000000
--- a/presence/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-project(plasma-applet-presence)
-
-find_package(KDE4 REQUIRED)
-include(KDE4Defaults)
-
-add_definitions(${KDE4_DEFINITIONS})
-
-include_directories(
-	${CMAKE_CURRENT_SOURCE_DIR}
-	${CMAKE_CURRENT_BINARY_DIR}
-	${KDE4_INCLUDES}
-)
-
-set(presence_SRCS
-	presence.cpp
-    accountimage.cpp
-    accountwidget.cpp
-    presencewidget.cpp
-    globalpresencewidget.cpp)
-
-kde4_add_plugin(plasma_applet_presence ${presence_SRCS})
-target_link_libraries(plasma_applet_presence
-	${KDE4_PLASMA_LIBS}
-	${KDE4_KDEUI_LIBS}
-)
-
-install(TARGETS plasma_applet_presence DESTINATION ${PLUGIN_INSTALL_DIR})
-install(FILES plasma-applet-presence.desktop DESTINATION ${SERVICES_INSTALL_DIR})
diff --git a/presence/plasma-applet-ktp-presence.desktop b/presence/plasma-applet-ktp-presence.desktop
deleted file mode 100644
index 23b0e70..0000000
--- a/presence/plasma-applet-ktp-presence.desktop
+++ /dev/null
@@ -1,40 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Name=Instant Messaging Presence
-Name[cs]=Přítomnost na IM
-Name[da]=Tilstedeværelse på instant messaging
-Name[es]=Presencia en mensajería instantánea
-Name[et]=Kohalolek kiirsuhtluses
-Name[nds]=Kortnarichten-Anwesigkeit
-Name[nl]=Aanwezigheid van Instant Messaging
-Name[pt]=Presença nas Mensagens Instantâneas
-Name[pt_BR]=Presença nas mensagens instantâneas
-Name[sv]=Direktmeddelande finns
-Name[uk]=Присутність у обміні повідомленнями
-Name[x-test]=xxInstant Messaging Presencexx
-Comment=Shows your instant messaging status information
-Comment[da]=Viser din statusinformation til instant messaging
-Comment[es]=Muestra información de su estado en sistemas de mensajería instantánea
-Comment[et]=Kiirsuhtluse oleku teabe näitamine
-Comment[nds]=Wiest Dien Kortnarichten-Status
-Comment[nl]=Toont de informatie over de status van "instant messaging"
-Comment[pt]=Mostra a sua informação de estado das mensagens instantâneas
-Comment[pt_BR]=Mostra a sua informação de status das mensagens instantâneas
-Comment[sv]=Visar statusinformation om direktmeddelanden
-Comment[uk]=Показує інформацію про ваш стан у системі обміну повідомленнями
-Comment[x-test]=xxShows your instant messaging status informationxx
-Icon=view-history
-Type=Service
-ServiceTypes=Plasma/Applet
-
-X-KDE-Library=plasma_applet_presence
-X-KDE-PluginInfo-Author=George Goldberg
-X-KDE-PluginInfo-Email=grundleborg at googlemail.com
-X-KDE-PluginInfo-Name=presence
-X-KDE-PluginInfo-Version=0.3
-X-KDE-PluginInfo-Website=http://telepathy.freedesktop.org/
-X-KDE-PluginInfo-Category=Online Services
-X-KDE-PluginInfo-Depends=
-X-KDE-PluginInfo-License=GPL
-X-KDE-PluginInfo-EnabledByDefault=true
-X-Plasma-NotificationArea=true
diff --git a/presence/src/presence.cpp b/presence/src/presence.cpp
deleted file mode 100644
index e66a963..0000000
--- a/presence/src/presence.cpp
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Copyright (C) 2008 George Goldberg <grundleborg at googlemail.com>
- * Copyright (C) 2009 Collabora Ltd <http://www.collabora.co.uk>
- * Copyright (C) 2009 Andre Moreira Magalhaes <andrunko at gmail.com>
- * Copyright (C) 2009 Abner Silva <abner.silva at kdemail.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Library General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-// Own
-#include "presence.h"
-#include "accountwidget.h"
-#include "globalpresencewidget.h"
-
-// Plasma
-#include <Plasma/Theme>
-#include <Plasma/Service>
-#include <Plasma/Extender>
-#include <Plasma/ExtenderItem>
-#include <Plasma/ToolTipContent>
-#include <Plasma/ToolTipManager>
-
-// Kde
-#include <KColorScheme>
-#include <KDebug>
-
-//Qt
-#include <QtGui/QGraphicsLinearLayout>
-#include <QtGui/QLabel>
-
-using namespace Plasma;
-
-PresenceApplet::PresenceApplet(QObject *parent, const QVariantList &args)
-    : Plasma::PopupApplet(parent, args),
-      m_engine(0),
-      m_widget(0),
-      m_layout(0),
-      m_global(0),
-      m_globalWidget(0),
-      m_globalLayout(0)
-{
-    KGlobal::locale()->insertCatalog("plasma_applet_presence");
-    setBackgroundHints(StandardBackground);
-    setAspectRatioMode(IgnoreAspectRatio);
-    //setHasConfigurationInterface(true);
-    setPassivePopup(false);
-
-    setPopupIcon("user-offline");
-}
-
-PresenceApplet::~PresenceApplet()
-{
-}
-
-void PresenceApplet::init()
-{
-    kDebug() << "PresenceApplet::init: initializing applet";
-
-    // Create a new extender item for global presence
-    if (!extender()->hasItem("Global")) {
-        ExtenderItem *item = new ExtenderItem(extender());
-        item->setName("Global");
-        initExtenderItem(item);
-    }
-
-    // Create a new extender item for accounts
-    if (!extender()->hasItem("Accounts")) {
-        ExtenderItem *item = new ExtenderItem(extender());
-        item->setName("Accounts");
-        initExtenderItem(item);
-    }
-
-    updateMasterPresence();
-
-    // Set up the data engine
-    m_engine = dataEngine("presence");
-
-    QStringList sources = m_engine->sources();
-    foreach(const QString &source, sources)
-        onSourceAdded(source);
-
-    connect(m_engine,
-            SIGNAL(sourceAdded(const QString &)),
-            SLOT(onSourceAdded(const QString &)));
-    connect(m_engine,
-            SIGNAL(sourceRemoved(const QString &)),
-            SLOT(onSourceRemoved(const QString &)));
-}
-
-void PresenceApplet::initExtenderItem(Plasma::ExtenderItem *item)
-{
-    // Set up global presence
-    if (item->name() == "Global") {
-        m_globalWidget = new QGraphicsWidget(item);
-        m_globalLayout = new QGraphicsLinearLayout(Qt::Vertical, m_globalWidget);
-        m_globalLayout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
-        m_globalWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
-        m_globalWidget->setLayout (m_globalLayout);
-
-        m_global = new GlobalPresenceWidget(this);
-
-        // Listening for global changes
-        connect(m_global, SIGNAL(presenceStatusChanged(const QString&)),
-                this, SLOT(onGlobalPresenceStatusChanged(const QString&)));
-        connect(m_global, SIGNAL(presenceMessageChanged(const QString&)),
-                this, SLOT(onGlobalPresenceMessageChanged(const QString&)));
-
-        m_globalLayout->addItem(m_global);
-        item->setWidget(m_globalWidget);
-        item->setTitle(i18n("Global Presence"));
-    }
-
-    // Set up user accounts
-    if (item->name() == "Accounts") {
-        m_widget = new QGraphicsWidget(item);
-        m_layout = new QGraphicsLinearLayout(Qt::Vertical, m_widget);
-        m_layout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
-        m_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
-        m_widget->setLayout (m_layout);
-
-        item->setWidget(m_widget);
-        item->setTitle(i18n("User Accounts"));
-    }
-}
-
-void PresenceApplet::onSourceAdded(const QString &source)
-{
-    kDebug() << "PresenceApplet::onSourceAdded: source:" << source;
-
-    if (!m_accounts.contains(source)) {
-        AccountWidget *account = new AccountWidget(this);
-        account->setId(source);
-        connect(account, SIGNAL(presenceChanged(const QString&, const QString&)),
-                this, SLOT(onPresenceChanged(const QString&, const QString&)));
-        m_accounts[source] = account;
-        m_engine->connectSource(source, this);
-        m_layout->addItem(account);
-
-        updateConstraints();
-        updateSize();
-    }
-}
-
-void PresenceApplet::onSourceRemoved(const QString &source)
-{
-    kDebug() << "PresenceApplet::onSourceAdded: source:" << source;
-
-    if (m_accounts.contains(source)) {
-        AccountWidget *account = m_accounts.value(source);
-        m_accounts.remove(source);
-        m_layout->removeItem(account);
-        delete account;
-        m_engine->disconnectSource(source, this);
-
-        updateMasterPresence();
-
-        updateConstraints();
-        updateSize();
-    }
-}
-
-void PresenceApplet::dataUpdated(const QString &source,
-        const Plasma::DataEngine::Data &data)
-{
-    kDebug() << "PresenceApplet::onDataUpdated: source:" << source;
-
-    if (m_accounts.contains(source)) {
-        // Get the stored account
-        AccountWidget *account = m_accounts[source];
-
-        // Set the DisplayName
-        account->setName(data["DisplayName"].toString());
-
-        // Set the Nickname
-        account->setAlias(data["Nickname"].toString());
-
-        // Set the account avatar
-        QPixmap avatar;
-        avatar.loadFromData(data["AccountAvatar"].toByteArray());
-        account->setImage(avatar);
-
-        // Set the presence and presence msg
-        account->setPresence(data["PresenceType"].toString(),
-                data["PresenceStatusMessage"].toString());
-
-        // Everytime data is updated it's also needed to update
-        // the global presence.
-        updateMasterPresence();
-    }
-}
-
-/*
- * Update the master presence state.
- *
- * We must check what presence state each account is in and use that to decide
- * which icon we display. We must also check the presence message for each
- * account to see if we can display one overall presence message.
- */
-void PresenceApplet::updateMasterPresence()
-{
-    QString accountMessage;
-    bool sameMessage = false;
-
-    QString toolTipContent;
-
-    // Next, we work out the overall presence status.
-    int accountsOffline = 0;
-    int accountsAvailable = 0;
-    int accountsAway = 0;
-    //int accountsExtendedAway = 0;
-    int accountsHidden = 0;
-    int accountsBusy = 0;
-
-    bool okOffline = true;
-    bool okAway = true;
-    bool okExtendedAway = true;
-    bool okHidden = true;
-    bool okBusy = true;
-
-    // Iterate over all the accounts in the model, and total up how many are
-    // in each type of presence state.
-    foreach (AccountWidget *account, m_accounts.values())
-    {
-        QString status_type = account->presenceStatus();
-
-        if ((status_type == "offline") || (status_type == "unknown") ||
-            (status_type == "error") || (status_type == "unset")) {
-            accountsOffline++;
-        } else if (status_type == "available") {
-            accountsAvailable++;
-            okOffline = false;
-            okHidden = false;
-            okExtendedAway = false;
-            okAway = false;
-            okBusy = false;
-        } else if (status_type == "away") {
-            accountsAway++;
-            okOffline = false;
-            okHidden = false;
-            okExtendedAway = false;
-            okBusy = false;
-        }
-/*        else if (status_type == "xa") {
-            accountsExtendedAway++;
-            okOffline = false;
-            okHidden = false;
-            okBusy = false;
-        }*/ else if (status_type == "invisible") {
-            accountsHidden++;
-            okOffline = false;
-            okExtendedAway = false;
-            okAway = false;
-            okBusy = false;
-        } else if(status_type == "busy") {
-            accountsBusy++;
-            okOffline = false;
-            okHidden = false;
-            okExtendedAway = false;
-            okAway = false;
-        }
-
-        sameMessage = (accountMessage == account->presenceMessage());
-        accountMessage = account->presenceMessage();
-
-        toolTipContent += i18n("%1: <b><i>%2</i></b><br/>",
-                account->name(), status_type);
-    }
-
-    // Chose a master presence state from this.
-    // FIXME: What should be the logic for choosing a master presence state?
-    //        Should this be user customisable?
-    //        Currently follows the kopete approach.
-    QString popupIcon;
-    if (okOffline == true) {
-        m_global->setPresenceStatus("offline");
-        popupIcon = "user-offline";
-    } else if(okHidden == true) {
-        m_global->setPresenceStatus("invisible");
-        popupIcon = "user-invisible";
-    } else if(okBusy == true) {
-        m_global->setPresenceStatus("busy");
-        popupIcon = "user-busy";
-//    } else if(okExtendedAway == true) {
-//        m_globalWidget->setPresenceStatus("offline");
-    } else if(okAway == true) {
-        m_global->setPresenceStatus("away");
-        popupIcon = "user-away";
-    } else {
-        m_global->setPresenceStatus("available");
-        popupIcon = "user-online";
-    }
-
-    // Update popup icon
-    setPopupIcon(popupIcon);
-
-    // Set presence msg
-    if (sameMessage)
-        m_global->setPresenceMessage(accountMessage);
-
-    // Update tooltip message
-    Plasma::ToolTipManager::self()->setContent(this,
-            Plasma::ToolTipContent(i18n("Presence Status"),
-            toolTipContent, this->popupIcon()));
-}
-
-void PresenceApplet::onPresenceChanged(const QString &presence,
-        const QString &msg)
-{
-    AccountWidget *account = static_cast<AccountWidget *>(sender());
-
-    Q_ASSERT(account);
-
-    setSourcePresence(account->id(), presence, msg);
-}
-
-void PresenceApplet::onJobCompleted()
-{
-    Plasma::Service *service = static_cast<Plasma::Service *>(sender());
-
-    if (service)
-        service->deleteLater();
-}
-
-void PresenceApplet::onGlobalPresenceStatusChanged(const QString &status)
-{
-    foreach (AccountWidget *account, m_accounts.values())
-        setSourcePresence(account->id(), status, account->presenceMessage());
-}
-
-void PresenceApplet::onGlobalPresenceMessageChanged(const QString &msg)
-{
-    foreach (AccountWidget *account, m_accounts.values())
-        setSourcePresence(account->id(), account->presenceStatus(), msg);
-}
-
-void PresenceApplet::updateSize()
-{
-    ExtenderItem *item = extender()->item("Accounts");
-
-    item->setMinimumSize(m_widget->minimumSize());
-    item->resize(m_widget->contentsRect().size().toSize());
-    item->adjustSize();
-}
-
-void PresenceApplet::setSourcePresence(const QString &id, const QString &status,
-        const QString &msg)
-{
-    Plasma::Service *service = m_engine->serviceForSource(id);
-
-    if (service != NULL) {
-        KConfigGroup op = service->operationDescription("setPresence");
-        op.writeEntry("status", status);
-        op.writeEntry("status_message", msg);
-        connect(service, SIGNAL(finished(Plasma::ServiceJob *)),
-                this, SLOT(onJobCompleted()));
-        service->startOperationCall(op);
-    }
-}
-
-#include "presence.moc"
-
diff --git a/presence/src/presence.h b/presence/src/presence.h
deleted file mode 100644
index 1ec4643..0000000
--- a/presence/src/presence.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2008 George Goldberg <grundleborg at googlemail.com>
- * Copyright (C) 2009 Collabora Ltd <http://www.collabora.co.uk>
- * Copyright (C) 2009 Andre Moreira Magalhaes <andrunko at gmail.com>
- * Copyright (C) 2009 Abner Silva <abner.silva at kdemail.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Library General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-#ifndef PLASMA_APPLET_PRESENCE_H
-#define PLASMA_APPLET_PRESENCE_H
-
-// Qt
-#include <QtCore/QString>
-#include <QtGui/QLabel>
-
-// Plasma
-#include <plasma/popupapplet.h>
-#include <plasma/dataengine.h>
-
-namespace Plasma {
-    class ExtenderItem;
-}
-
-class KColorScheme;
-
-class AccountWidget;
-class GlobalPresenceWidget;
-
-class PresenceApplet : public Plasma::PopupApplet
-{
-    Q_OBJECT
-
-public:
-    PresenceApplet(QObject *parent, const QVariantList &args);
-    ~PresenceApplet();
-    void init();
-
-private Q_SLOTS:
-    void onSourceAdded(const QString &source);
-    void onSourceRemoved(const QString &source);
-    void dataUpdated(const QString &source,
-            const Plasma::DataEngine::Data &data);
-    void onPresenceChanged(const QString &presence,
-            const QString &msg);
-    void onJobCompleted();
-    void onGlobalPresenceStatusChanged(const QString &status);
-    void onGlobalPresenceMessageChanged(const QString &msg);
-
-protected:
-    void initExtenderItem(Plasma::ExtenderItem *item);
-
-private:
-    void updateMasterPresence();
-    void updateSize();
-    void setSourcePresence(const QString &id, const QString &status,
-            const QString &msg);
-
-    Plasma::DataEngine *m_engine;
-    QGraphicsWidget *m_widget;
-    QGraphicsLinearLayout *m_layout;
-    QHash<QString, AccountWidget*> m_accounts;
-    GlobalPresenceWidget *m_global;
-    QGraphicsWidget *m_globalWidget;
-    QGraphicsLinearLayout *m_globalLayout;
-};
-
-K_EXPORT_PLASMA_APPLET(presence, PresenceApplet)
-
-#endif

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list