small optimization: prevent reconnecting (and likely a delete and new of a SignalObject) when the requested polling interval and the current one are the same

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=802273
This commit is contained in:
Aaron J. Seigo 2008-04-29 00:26:33 +00:00
parent 9a156375a3
commit b94c6913ff

View File

@ -87,6 +87,11 @@ void DataContainer::connectVisualization(QObject* visualization, uint pollingInt
if (relay) {
// connected to a relay
//kDebug() << " already connected, but to a relay";
if (relay->m_interval == pollingInterval) {
//kDebug() << " already connected to a relay of the same interval of"
// << pollingInterval << ", nothing to do";
return;
}
if (relay->receiverCount() == 1) {
//kDebug() << " removing relay, as it is now unused";