From dd0e996081ae820a0f16b5a6854a8a6274c5edf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 28 Oct 2016 02:19:19 +0200 Subject: GH-1697 always stale files tolerate errors if a local copy is present This fixes the situation when liteloader snapshot site is broken and there's an older local snapshot already present. --- api/logic/net/MetaCacheSink.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'api/logic/net/MetaCacheSink.cpp') diff --git a/api/logic/net/MetaCacheSink.cpp b/api/logic/net/MetaCacheSink.cpp index 539b4bb3..c9d75310 100644 --- a/api/logic/net/MetaCacheSink.cpp +++ b/api/logic/net/MetaCacheSink.cpp @@ -56,4 +56,10 @@ JobStatus MetaCacheSink::finalizeCache(QNetworkReply & reply) ENV.metacache()->updateEntry(m_entry); return Job_Finished; } + +bool MetaCacheSink::hasLocalData() +{ + QFileInfo info(m_filename); + return info.exists() && info.size() != 0; +} } -- cgit v1.2.3