[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/plasma/dataengines/presence
From: George Goldberg <grundleborg () googlemail ! com>
Date: 2009-04-05 22:46:17
Message-ID: 1238971577.442001.1480.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 949799 by gberg:
Misc tidyup, error checking and consistency improvements.
M +3 -3 plasma-dataengine-presence.desktop
M +2 -2 presence.operations
M +7 -3 presenceservice.cpp
M +4 -4 presencesource.cpp
M +1 -1 presencesource.h
M +2 -4 setrequestedpresencejob.cpp
--- trunk/playground/base/plasma/dataengines/presence/plasma-dataengine-presence.desktop \
#949798:949799 @@ -2,11 +2,11 @@
Encoding=UTF-8
Name=Presence
Name[cs]=Přítomnost
-Name[el]= αρουσία
+Name[el]= αρουσία
Name[et]=Kohalolek
Name[fr]=Présence
Name[gl]=Presenza
-Name[km]=បង្ ាញ
+Name[km]=បង្ ាញ
Name[nds]=Anwesigkeit
Name[pa]=ਮੌਜੂਦਗੀ
Name[pt]=Presença
@@ -28,7 +28,7 @@
Comment[pt]=Motor de Dados de Presença do Telepathy
Comment[pt_BR]=Motor de Dados de Presença do Telepathy
Comment[sv]=Telepathy datagränssnitt för närvaro
-Comment[uk]= ушій даних присутності для Telepathy
+Comment[uk]= ушій даних присутності для Telepathy
Comment[x-test]=xxTelepathy Presence Data Enginexx
ServiceTypes=Plasma/DataEngine
Type=Service
--- trunk/playground/base/plasma/dataengines/presence/presence.operations \
#949798:949799 @@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfg>
- <group name="setRequestedPresence">
+ <group name="setPresence">
<entry name="status" type="String">
<label>The string identifier of the chosen presence status.</label>
</entry>
- <entry name="statusMessage" type="String">
+ <entry name="status_message" type="String">
<label>The text which the status message should be updated to.</label>
</entry>
</group>
--- trunk/playground/base/plasma/dataengines/presence/presenceservice.cpp \
#949798:949799 @@ -38,11 +38,15 @@
Plasma::ServiceJob * PresenceService::createJob(const QString& operation, \
QMap<QString, QVariant>& parameters) {
- if (operation == "setRequestedPresence") {
- return new SetRequestedPresenceJob(m_source, parameters);
+ if(operation == "setPresence")
+ {
+ if(parameters.contains("status") && parameters.contains("status_message"))
+ {
+ return new SetRequestedPresenceJob(m_source, parameters);
+ }
}
- // default case is to fail:
+ // If we don't know what to do for this operation, default to failing.
return new Plasma::ServiceJob(m_source->objectName(), operation, parameters, \
this); }
--- trunk/playground/base/plasma/dataengines/presence/presencesource.cpp \
#949798:949799 @@ -20,7 +20,7 @@
#include "presenceservice.h"
-#include <kdebug.h>
+#include <KDebug>
#include <TelepathyQt4/Client/Feature>
#include <TelepathyQt4/Client/PendingOperation>
@@ -101,9 +101,9 @@
kDebug(); // Output the method we are in.
// Update the data of this source
- setData("current_presence_type", presenceTypeToString(presence.type));
- setData("current_presence_status", presence.status);
- setData("current_presence_status_message", presence.statusMessage);
+ setData("presence_type", presenceTypeToString(presence.type));
+ setData("presence_status", presence.status);
+ setData("presence_status_message", presence.statusMessage);
// FIXME: Make things other than just current presence available for the source.
// Required to trigger emission of update signal after changing data
--- trunk/playground/base/plasma/dataengines/presence/presencesource.h #949798:949799
@@ -19,7 +19,7 @@
#ifndef PLASMA_DATAENGINE_PRESENCE_PRESENCESOURCE_H
#define PLASMA_DATAENGINE_PRESENCE_PRESENCESOURCE_H
-#include <plasma/datacontainer.h>
+#include <Plasma/DataContainer>
#include <QtCore/QObject>
--- trunk/playground/base/plasma/dataengines/presence/setrequestedpresencejob.cpp \
#949798:949799 @@ -28,12 +28,10 @@
SetRequestedPresenceJob::SetRequestedPresenceJob(PresenceSource *source,
const QMap<QString, QVariant> \
¶meters, QObject *parent)
- : Plasma::ServiceJob(source->objectName(), "setRequestedPresence", parameters, \
parent), + : Plasma::ServiceJob(source->objectName(), "setPresence", parameters, \
parent), m_account(source->account())
{
kDebug(); // Output the method we are in.
-
- // FIXME: Check the parameters passed are valid here.
}
void SetRequestedPresenceJob::start()
@@ -43,7 +41,7 @@
// Call the appropriate method on the Account object
Telepathy::SimplePresence rp;
rp.status = parameters().value("status").toString();
- rp.statusMessage = parameters().value("statusMessage").toString();
+ rp.statusMessage = parameters().value("status_message").toString();
// FIXME: Will all hell break lose here if we don't set the presence type?
// FIXME: What happens if there was a status message before, but we set without \
one this time. Does it stay the same?
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic