diff --git a/src/core/backgroundstreams.cpp b/src/core/backgroundstreams.cpp index cbb9641a3..347b95908 100644 --- a/src/core/backgroundstreams.cpp +++ b/src/core/backgroundstreams.cpp @@ -41,8 +41,7 @@ void BackgroundStreams::LoadStreams() { s.setArrayIndex(i); AddStream(s.value("name").toString(), s.value("url").toUrl(), - s.value("volume").toInt(), - s.value("enabled").toBool()); + s.value("volume").toInt()); } SaveStreams(); @@ -60,24 +59,23 @@ void BackgroundStreams::SaveStreams() { s.setValue("name", stream->name); s.setValue("url", stream->url); s.setValue("volume", stream->volume); - s.setValue("enabled", stream->id != -1); } s.endArray(); } void BackgroundStreams::AddStream(const QString& name, const QUrl& url, - int volume, - bool enabled) { + int volume) { + if (streams_.contains(name)) { + return; + } + Stream* s = new Stream; s->name = name; s->url = url; s->volume = volume; s->id = -1; streams_[name] = s; - if (enabled) { - PlayStream(s); - } } void BackgroundStreams::EnableStream(const QString& name, bool enable) { diff --git a/src/core/backgroundstreams.h b/src/core/backgroundstreams.h index ed581f714..942f40dfa 100644 --- a/src/core/backgroundstreams.h +++ b/src/core/backgroundstreams.h @@ -49,8 +49,7 @@ class BackgroundStreams : public QObject { QAction* action; }; - void AddStream( - const QString& name, const QUrl& url, int volume = 50, bool enabled = false); + void AddStream(const QString& name, const QUrl& url, int volume = 50); void PlayStream(Stream* stream); void StopStream(Stream* stream);