[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:10:25 UTC 2016


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

The following commit has been merged in the master branch:
commit 83cd4f6c9585c80e94d9b96862e94e046e4631f4
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Sat Jul 5 13:41:43 2008 +0000

    Change the presence applet to use the new PresenceState and values passed, making it compatible with recent dataengine changes.
    
    svn path=/trunk/playground/base/plasma/applets/presence/; revision=828348
---
 presence/CMakeLists.txt   |  2 +-
 presence/src/presence.cpp | 38 ++++++++++++++------------------------
 2 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/presence/CMakeLists.txt b/presence/CMakeLists.txt
index 2a908c5..6c3d3a6 100644
--- a/presence/CMakeLists.txt
+++ b/presence/CMakeLists.txt
@@ -8,7 +8,7 @@ set(presence_SRCS
     presence.cpp)
 
 kde4_add_plugin(plasma_applet_presence ${presence_SRCS})
-target_link_libraries(plasma_applet_presence plasmaappletdialog ${PLASMA_LIBS} decibel ${KDE4_KDEUI_LIBS})
+target_link_libraries(plasma_applet_presence plasmaappletdialog ${PLASMA_LIBS} decibel ${KDE4_KDEUI_LIBS} QtTapioca)
 
 install(TARGETS plasma_applet_presence DESTINATION ${PLUGIN_INSTALL_DIR})
 install(FILES plasma-applet-presence.desktop DESTINATION ${SERVICES_INSTALL_DIR})
diff --git a/presence/src/presence.cpp b/presence/src/presence.cpp
index 3207c01..4cca3eb 100644
--- a/presence/src/presence.cpp
+++ b/presence/src/presence.cpp
@@ -22,6 +22,10 @@
 #include <plasma/theme.h>
 #include <plasma/widgets/icon.h>
 
+#include <QtTapioca/PresenceState>
+
+#include <Decibel/Types>
+
 #include <QString>
 #include <QStandardItemModel>
 #include <QTreeView>
@@ -150,30 +154,16 @@ void Presence::dataUpdated(const QString &source, const Plasma::DataEngine::Data
      * row. If not, then we create a new row with
      * the data for that source.
      */
-    QStandardItem *online = new QStandardItem;
-    QStandardItem *status = new QStandardItem;
+    QStandardItem *presence_type = new QStandardItem;
+    QStandardItem *presence_state = new QStandardItem;
     QStandardItem *message = new QStandardItem;
     //online->setData(Plasma::Theme::self()->textColor(), Qt::ForegroundRole);
     //status->setData(Plasma::Theme::self()->textColor(), Qt::ForegroundRole);
     //message->setData(Plasma::Theme::self()->textColor(), Qt::ForegroundRole);
-    QString decibelCurrentPresence = data.value("decibel_current_presence").toString();
-    if(decibelCurrentPresence == "1")
-    {
-       /*
-        * we are offline.
-        */
-        kDebug() << "decibel_current_presence == 1";
-        online->setData(false, Qt::DisplayRole);
-    }
-    else
-    {
-       /*
-        * we are online
-        */
-        kDebug() << "decibel_current_presence != 1";
-        online->setData(true, Qt::DisplayRole);
-    }
-    status->setData(data.value("decibel_current_presence").toString(), Qt::DisplayRole);
+    QtTapioca::PresenceState currentPresence = data.value("current_presence").value<QtTapioca::PresenceState>();
+
+    presence_type->setData(static_cast<int>(currentPresence.type()), Qt::DisplayRole);
+    presence_state->setData(currentPresence.name(), Qt::DisplayRole);
     message->setData(data.value("decibel_presence_message").toString(), Qt::DisplayRole);
     /*
      * so, we need to look in the first column
@@ -192,8 +182,8 @@ void Presence::dataUpdated(const QString &source, const Plasma::DataEngine::Data
         id->setData(source, Qt::DisplayRole);
         QList<QStandardItem*> row;
         row.append(id);
-        row.append(online);
-        row.append(status);
+        row.append(presence_type);
+        row.append(presence_state);
         row.append(message);
         m_accountsModel->appendRow(row);
     }
@@ -205,8 +195,8 @@ void Presence::dataUpdated(const QString &source, const Plasma::DataEngine::Data
          * is already there for it.
          */
         int row = items.first()->row();
-        m_accountsModel->setItem(row, 1, online);
-        m_accountsModel->setItem(row, 2, status);
+        m_accountsModel->setItem(row, 1, presence_type);
+        m_accountsModel->setItem(row, 2, presence_state);
         m_accountsModel->setItem(row, 3, message);
     }
     else

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list