Verified Commit 518b6ed5 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

wallpapers/potd: fix wallpaper not being updated over metered connection

When switching providers, `setUpdateOverMeteredConnection` needs to be
called again.
parent 8879db43
Pipeline #220807 passed with stage
in 1 minute and 27 seconds
......@@ -57,11 +57,6 @@ void PotdBackend::componentComplete()
// Register the identifier in the data engine
registerClient();
#if HAVE_NetworkManagerQt
if (m_client) {
m_client->setUpdateOverMeteredConnection(m_doesUpdateOverMeteredConnection);
}
#endif
}
QString PotdBackend::identifier() const
......@@ -294,4 +289,10 @@ void PotdBackend::registerClient()
Q_EMIT remoteUrlChanged();
Q_EMIT titleChanged();
Q_EMIT authorChanged();
#if HAVE_NetworkManagerQt
if (m_client) {
m_client->setUpdateOverMeteredConnection(m_doesUpdateOverMeteredConnection);
}
#endif
}
......@@ -54,7 +54,8 @@ void PotdClient::updateSource(bool refresh)
// Check whether it is cached already...
#if HAVE_NetworkManagerQt
// Use cache even if it's outdated when using metered connection
if (!refresh && (CachedProvider::isCached(m_identifier, m_args, false) || (m_doesUpdateOverMeteredConnection == 0 && isUsingMeteredConnection()))) {
const bool ignoreAge = m_doesUpdateOverMeteredConnection == 0 && isUsingMeteredConnection();
if (!refresh && (CachedProvider::isCached(m_identifier, m_args, ignoreAge))) {
#else
if (!refresh && CachedProvider::isCached(m_identifier, m_args, false)) {
#endif
......
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