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

List:       kde-commits
Subject:    branches/KDE/4.5/kdebase/workspace/plasma/generic/dataengines/systemmonitor
From:       Alex Merry <kde () randomguy3 ! me ! uk>
Date:       2010-09-20 0:29:44
Message-ID: 20100920002944.C25FAAC7CB () svn ! kde ! org
[Download RAW message or body]

SVN commit 1177290 by alexmerry:

Backport r1177289: Fix updating of the source when it was connected to before being \
populated.

CCBUG: 251459



 M  +12 -0     systemmonitor.cpp  


--- branches/KDE/4.5/kdebase/workspace/plasma/generic/dataengines/systemmonitor/systemmonitor.cpp \
#1177289:1177290 @@ -56,6 +56,9 @@
 
 bool SystemMonitorEngine::sourceRequestEvent(const QString &name)
 {
+    // NB: do not follow this example in your own data engines!
+    // This is kept for backwards compatilibility.
+    // Visualizations should instead listen to sourceAdded()
     if (m_sensors.isEmpty()) {
         // we don't have our first data yet, so let's trust the requester, at least \
                fo rnow
         // when we get our list of sensors later, then we'll know for sure and \
remove @@ -151,6 +154,15 @@
             const QString newSensor = newSensorInfo[0];
             sensors.insert(newSensor);
             m_sensors.append(newSensor);
+            {
+                // HACK: for backwards compability
+                // in case this source was created in sourceRequestEvent, stop it \
being +                // automagically removed when disconnected from
+                Plasma::DataContainer *s = containerForSource( newSensor );
+                if ( s ) {
+                    disconnect( s, SIGNAL(becameUnused(QString)), this, \
SLOT(removeSource(QString)) ); +                }
+            }
             DataEngine::Data d;
             d.insert("value", QVariant());
             d.insert("type", newSensorInfo[1]);


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

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