Commit 2dadae76 authored by Andrea Scarpino's avatar Andrea Scarpino

Connect to the signals only once

parent 948e3ec5
......@@ -87,10 +87,10 @@ void ChartLyricsAPI::onGetLyricResult()
const QString text = res.namedItem(QStringLiteral("Lyric")).toElement().text();
if (!text.isEmpty()) {
qDebug() << "Got lyric text";
lyric->setText(text);
found = true;
} else {
qDebug() << "Got an empty text";
}
} else {
qDebug() << "No lyric found";
......
......@@ -95,6 +95,9 @@ void LyricsManager::setProvider(const QString &provider)
p = QStringLiteral("LyricsMania");
}
connect(api, &Provider::lyricFetched, this, &LyricsManager::searchResult);
connect(api, &Provider::lyricFetched, this, &LyricsManager::storeLyric);
qDebug() << "Setting default provider to" << p;
settings->setValue("Provider", p);
}
......@@ -139,9 +142,6 @@ void LyricsManager::search(const QString &artist, const QString &song)
} else {
qDebug() << "Querying" << api->metaObject()->className();
api->getLyric(artist, song);
connect(api, &Provider::lyricFetched, this, &LyricsManager::searchResult);
connect(api, &Provider::lyricFetched, this, &LyricsManager::storeLyric);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment