Do not allow the adition of a source that is already connected

If you try to connect a source that is already connected, it should
return and not create a duplicate of that source.

Signed-off-by: Artur Duque de Souza <asouza@kde.org>
This commit is contained in:
Artur Duque de Souza 2011-04-24 19:17:25 -03:00
parent 96d7d83ee9
commit add8249568

View File

@ -193,6 +193,10 @@ Plasma::Service *DataSource::serviceForSource(const QString &source)
void DataSource::connectSource(const QString &source)
{
if (m_connectedSources.contains(source)) {
return;
}
m_newSources.append(source);
m_connectedSources.append(source);
m_changes |= SourcesChanged;