[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:45 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=e65f278
The following commit has been merged in the master branch:
commit e65f278b401be97964e54e275604378de65225f8
Author: George Goldberg <grundleborg at googlemail.com>
Date: Fri Apr 3 17:15:30 2009 +0000
Remove all tpqt4 stuff from the plasmoid - it should do stuff through the presence dataengine, not directly.
It will now display the presence correctly for individual accounts.
Outstanding Issues:
- Master presence not displayed correctly.
- Cannot set the presence.
- Code is a mess
- Looks fugly.
svn path=/trunk/playground/base/plasma/applets/presence/; revision=948749
---
presence/CMakeLists.txt | 6 +-----
presence/src/presence.cpp | 51 +++++++++++------------------------------------
presence/src/presence.h | 12 +++++------
3 files changed, 18 insertions(+), 51 deletions(-)
diff --git a/presence/CMakeLists.txt b/presence/CMakeLists.txt
index 2c2fb89..02ee44a 100644
--- a/presence/CMakeLists.txt
+++ b/presence/CMakeLists.txt
@@ -1,8 +1,6 @@
-SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
-project(plasma-presence)
+project(plasma-applet-presence)
find_package(KDE4 REQUIRED)
-find_package (TelepathyQt4 REQUIRED)
include(KDE4Defaults)
add_definitions(${KDE4_DEFINITIONS})
@@ -11,7 +9,6 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${KDE4_INCLUDES}
- ${TELEPATHY_QT4_INCLUDE_DIR}
)
set(presence_SRCS
@@ -22,7 +19,6 @@ kde4_add_plugin(plasma_applet_presence ${presence_SRCS})
target_link_libraries(plasma_applet_presence
${KDE4_PLASMA_LIBS}
${KDE4_KDEUI_LIBS}
- ${TELEPATHY_QT4_LIBRARIES}
)
install(TARGETS plasma_applet_presence DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/presence/src/presence.cpp b/presence/src/presence.cpp
index 93ea068..16d18d8 100644
--- a/presence/src/presence.cpp
+++ b/presence/src/presence.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 George Goldberg <grundleborg at googlemail.com>
+ * Copyright (C) 2009 Collabora Ltd <http://www.collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -29,11 +30,6 @@
#include <KDebug>
#include <KIcon>
-#include <TelepathyQt4/Types>
-#include <TelepathyQt4/Constants>
-#include <TelepathyQt4/Client/PendingReady>
-#include <TelepathyQt4/Client/Account>
-
#include <QtCore/QList>
#include <QtCore/QSharedPointer>
@@ -56,8 +52,7 @@ PresenceApplet::PresenceApplet(QObject * parent, const QVariantList & args)
m_accountsModel(0),
m_accountsView(0),
m_layout(0),
- m_userSet(false),
- m_accountManager(0)
+ m_userSet(false)
{
setBackgroundHints(StandardBackground);
}
@@ -101,15 +96,6 @@ void PresenceApplet::init()
QVariant("status-name"), Qt::DisplayRole);
m_accountsModel->setHeaderData(3, Qt::Horizontal,
QVariant("status-message"), Qt::DisplayRole);
- //setup Telepathy Account Manager
- m_accountManager = new Telepathy::Client::AccountManager(QDBusConnection::sessionBus());
-
- QSet<Telepathy::Client::Feature> features;
- features << Telepathy::Client::AccountManager::FeatureCore;
-
- connect(m_accountManager->becomeReady(features),
- SIGNAL(finished(Telepathy::Client::PendingOperation *)), this,
- SLOT(onReady(Telepathy::Client::PendingOperation *)));
Q_ASSERT(!m_engine); // Pointer should still be assigned to 0.
m_engine = dataEngine("presence");
@@ -126,13 +112,9 @@ void PresenceApplet::init()
this, SLOT(sourceRemoved(QString)));
}
-void PresenceApplet::onReady(Telepathy::Client::PendingOperation *result)
-{
-
-}
QWidget *PresenceApplet::widget()
{
- if(!m_widget)
+ if(!m_widget)
{
// Set up the accounts view.
Q_ASSERT(!m_accountsView); // Pointer should still be assigned to 0.
@@ -195,13 +177,13 @@ void PresenceApplet::sourceRemoved(const QString & source)
kDebug() << "started with source: " << source;
m_engine->disconnectSource(source, this);
}
-
+/*
void PresenceApplet::commitData(QWidget * editor)
{
kDebug()<<m_userSet;
//m_userSet = true;
}
-
+*/
void PresenceApplet::dataUpdated(const QString & source,
const Plasma::DataEngine::Data & data)
{
@@ -225,19 +207,9 @@ void PresenceApplet::dataUpdated(const QString & source,
presence_state->setData(Plasma::Theme::defaultTheme()->color(Plasma::Theme::BackgroundColor));
message->setData(Plasma::Theme::defaultTheme()->color(Plasma::Theme::BackgroundColor));
- // rief: setup account presence
- Telepathy::SimplePresence currentPresence
- = data.value("current_presence").value<Telepathy::SimplePresence>();
- if (m_currentPresence == currentPresence.status) {
- return;
- }
-
- m_currentPresence = currentPresence.status;
-
- presence_type->setData(static_cast<uint>(currentPresence.type),
- Qt::DisplayRole);
- presence_state->setData(currentPresence.status, Qt::DisplayRole);
- message->setData(currentPresence.statusMessage, Qt::DisplayRole);
+ presence_type->setData(data.value("current_presence_type"), Qt::DisplayRole);
+ presence_state->setData(data.value("current_presence_status"), Qt::DisplayRole);
+ message->setData(data.value("current_presence_status_message"), Qt::DisplayRole);
accountItem->setData(source, Qt::DisplayRole);
/*
@@ -290,7 +262,7 @@ void PresenceApplet::dataUpdated(const QString & source,
// Update the master presence.
updateMasterPresence();
}
-
+/*
void PresenceApplet::onItemChanged(QStandardItem * item)
{
QModelIndex index = m_accountsModel->indexFromItem(item);
@@ -314,7 +286,7 @@ void PresenceApplet::onItemChanged(QStandardItem * item)
}
}
-
+*/
/**
* @brief Update the master presence state.
*
@@ -377,6 +349,7 @@ void PresenceApplet::updateMasterPresence()
// Iterate over all the accounts in the model, and total up how many are
// in each type of presence state.
+ /* // FIXME: Port to new method
for(int i=0; i<rowCount; i++)
{
Telepathy::ConnectionPresenceType status_type =
@@ -413,7 +386,7 @@ void PresenceApplet::updateMasterPresence()
break;
}
}
-
+*/
// Chose a master presence state from this.
// FIXME: What should be the logic for choosing a master presence state?
// Shoud this be user customisable?
diff --git a/presence/src/presence.h b/presence/src/presence.h
index 148c3eb..f269986 100644
--- a/presence/src/presence.h
+++ b/presence/src/presence.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 George Goldberg <grundleborg at googlemail.com>
+ * Copyright (C) 2009 Collabora Ltd <http://www.collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -32,8 +33,6 @@ namespace Plasma
#include <QtGui/QLabel>
#include <QtGui/QStandardItemModel>
-#include <TelepathyQt4/Client/AccountManager>
-
class KColorScheme;
class QHBoxLayout;
@@ -60,9 +59,8 @@ private Q_SLOTS:
const Plasma::DataEngine::Data & data);
void sourceAdded(const QString & source);
void sourceRemoved(const QString & source);
- void commitData(QWidget*editor);
- void onItemChanged(QStandardItem*);
- void onReady(Telepathy::Client::PendingOperation*);
+// void commitData(QWidget*editor);
+// void onItemChanged(QStandardItem*);
private:
void iconChanged();
@@ -81,7 +79,6 @@ private:
QTreeView * m_accountsView;
QVBoxLayout * m_layout;
QWidget *m_widget;
- Telepathy::Client::AccountManager* m_accountManager;
bool m_userSet;
QString m_currentPresence;
@@ -91,5 +88,6 @@ private:
K_EXPORT_PLASMA_APPLET(presence, PresenceApplet)
-#endif
+
+#endif // Include guard
--
ktp-contact-applet packaging
More information about the pkg-kde-commits
mailing list