Engines
notificationaction.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "notificationaction.h"
00020 #include "notificationsengine.h"
00021
00022 #include <kdebug.h>
00023
00024 void NotificationAction::start()
00025 {
00026 kDebug() << "Trying to perform the action " << operationName() << " on " << destination();
00027 kDebug() << "actionId: " << parameters()["actionId"].toString();
00028
00029 if (!m_engine) {
00030 setErrorText(i18n("The notification dataEngine is not set."));
00031 setError(-1);
00032 emitResult();
00033 return;
00034 }
00035
00036 if (operationName() == "invokeAction") {
00037 const QStringList dest = destination().split(" ");
00038
00039 if (dest.count() > 1 && !dest[1].toInt()) {
00040 setErrorText(i18n("Invalid destination: ", destination()));
00041 setError(-2);
00042 emitResult();
00043 return;
00044 }
00045
00046 kDebug() << "firing";
00047 emit m_engine->ActionInvoked(dest[1].toUInt(), parameters()["actionId"].toString());
00048 }
00049
00050 emitResult();
00051 }
00052
00053 #include "notificationaction.moc"
00054