[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/dataengines/notifications
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2009-04-28 18:54:25
Message-ID: 1240944865.793688.8894.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 960624 by aseigo:

userClosed action


 M  +16 -12    notificationaction.cpp  
 M  +2 -0      notifications.operations  
 M  +1 -1      notificationsengine.cpp  


--- trunk/KDE/kdebase/workspace/plasma/dataengines/notifications/notificationaction.cpp #960623:960624
@@ -23,8 +23,8 @@
 
 void NotificationAction::start()
 {
-    kDebug() << "Trying to perform the action " << operationName() << " on " << destination();
-    kDebug() << "actionId: " << parameters()["actionId"].toString();
+    //kDebug() << "Trying to perform the action " << operationName() << " on " << destination();
+    //kDebug() << "actionId: " << parameters()["actionId"].toString();
 
     if (!m_engine) {
         setErrorText(i18n("The notification dataEngine is not set."));
@@ -33,18 +33,22 @@
         return;
     }
 
-    if (operationName() == "invokeAction") {
-        const QStringList dest = destination().split(" ");
+    const QStringList dest = destination().split(" ");
 
-        if (dest.count() >  1 && !dest[1].toInt()) {
-            setErrorText(i18n("Invalid destination: ", destination()));
-            setError(-2);
-            emitResult();
-            return;
-        }
+    if (dest.count() >  1 && !dest[1].toInt()) {
+        setErrorText(i18n("Invalid destination: ", destination()));
+        setError(-2);
+        emitResult();
+        return;
+    }
 
-        kDebug() << "firing";
-        emit m_engine->ActionInvoked(dest[1].toUInt(), parameters()["actionId"].toString());
+    uint id = dest[1].toUInt();
+
+    if (operationName() == "invokeAction") {
+        //kDebug() << "invoking action on " << id;
+        emit m_engine->ActionInvoked(id, parameters()["actionId"].toString());
+    } else if (operationName() == "userClosed") {
+        m_engine->CloseNotification(id);
     }
 
     emitResult();
--- trunk/KDE/kdebase/workspace/plasma/dataengines/notifications/notifications.operations #960623:960624
@@ -7,4 +7,6 @@
       <label>The id of the action to be invoked.</label>
     </entry>
   </group>
+  <group name="userClosed">
+  </group>
 </kcfg>
--- trunk/KDE/kdebase/workspace/plasma/dataengines/notifications/notificationsengine.cpp #960623:960624
@@ -115,7 +115,7 @@
 void NotificationsEngine::CloseNotification(uint id)
 {
     removeSource(QString("notification %1").arg(id));
-    emit NotificationClosed(id,0);
+    emit NotificationClosed(id, 0);
 }
 
 Plasma::Service* NotificationsEngine::serviceForSource(const QString& source)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic