* add a way to query if a visualization is already connected to a source
* don't do an immediate call using invokeMethod if the visualization is already connected and we're just adjusting it svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=800383
This commit is contained in:
parent
f24d1efa28
commit
7d1d889a47
@ -104,6 +104,11 @@ void DataContainer::setNeedsUpdate(bool update)
|
||||
d->cached = update;
|
||||
}
|
||||
|
||||
bool DataContainer::visualizationIsConnected(QObject *visualization) const
|
||||
{
|
||||
return d->relayObjects.find(visualization) != d->relayObjects.constEnd();
|
||||
}
|
||||
|
||||
void DataContainer::checkUsage()
|
||||
{
|
||||
if (d->relays.count() < 1 &&
|
||||
|
@ -101,6 +101,11 @@ class PLASMA_EXPORT DataContainer : public QObject
|
||||
**/
|
||||
void setNeedsUpdate(bool update = true);
|
||||
|
||||
/**
|
||||
* @return true if the visualization is currently connected
|
||||
*/
|
||||
bool visualizationIsConnected(QObject *visualization) const;
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
* Check if the DataContainer is still in use.
|
||||
|
@ -138,6 +138,12 @@ class DataEngine::Private
|
||||
pollingInterval = pollingInterval - (pollingInterval % 50);
|
||||
}
|
||||
|
||||
if (immediateCall) {
|
||||
// we don't want to do an immediate call if we are simply
|
||||
// reconnecting
|
||||
immediateCall = !s->visualizationIsConnected(visualization);
|
||||
}
|
||||
|
||||
s->connectVisualization(visualization, pollingInterval, align);
|
||||
|
||||
if (immediateCall) {
|
||||
|
Loading…
Reference in New Issue
Block a user