Commit 756312c3 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

wallpapers/potd: skip updating when another updating process is running

parent e5a8ed88
Pipeline #215251 passed with stage
in 3 minutes and 26 seconds
......@@ -45,6 +45,10 @@ PotdClient::PotdClient(const KPluginMetaData &metadata, const QVariantList &args
void PotdClient::updateSource(bool refresh)
{
if (m_loading) {
return;
}
setLoading(true);
// Check whether it is cached already...
......@@ -285,6 +289,10 @@ void PotdEngine::updateSource(bool refresh)
m_lastUpdateSuccess = true;
for (const auto &[_, clientPair] : std::as_const(m_clientMap)) {
if (clientPair.client->m_loading) {
continue;
}
connect(clientPair.client, &PotdClient::done, this, &PotdEngine::slotDone);
m_updateCount++;
qCDebug(WALLPAPERPOTD) << clientPair.client->m_metadata.value(QStringLiteral("X-KDE-PlasmaPoTDProvider-Identifier")) << "starts updating wallpaper.";
......
Supports Markdown
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