summaryrefslogtreecommitdiff
path: root/LotWUsers.cpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2019-04-29 22:12:59 +0200
committerChristoph Berg <myon@debian.org>2019-04-29 22:12:59 +0200
commit70daed33540f3e59a0b1ade23054227162bb94b5 (patch)
treed7b37965eb45dcee3d6779dfe4c89765a413ee9a /LotWUsers.cpp
parent3f82cbb91d23747acad17055a738fa6aa9f0d30b (diff)
parentb7238399ea4f1ca51d8f7b8f9220af3da0913edf (diff)
Update upstream source from tag 'upstream/2.1.0_rc5+repack'
Update to upstream version '2.1.0~rc5+repack' with Debian dir 17b49a173603ba3f07a69dd6bec92e144d341596
Diffstat (limited to 'LotWUsers.cpp')
-rw-r--r--LotWUsers.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/LotWUsers.cpp b/LotWUsers.cpp
index 877e7054..fd1b5746 100644
--- a/LotWUsers.cpp
+++ b/LotWUsers.cpp
@@ -42,11 +42,12 @@ public:
{
}
- void load (QString const& url, bool forced_fetch)
+ void load (QString const& url, bool fetch, bool forced_fetch)
{
- auto csv_file_name = csv_file_.fileName ();
abort (); // abort any active download
- if (!QFileInfo::exists (csv_file_name) || forced_fetch)
+ auto csv_file_name = csv_file_.fileName ();
+ auto exists = QFileInfo::exists (csv_file_name);
+ if (fetch && (!exists || forced_fetch))
{
current_url_.setUrl (url);
if (current_url_.isValid () && !QSslSocket::supportsSsl ())
@@ -58,8 +59,11 @@ public:
}
else
{
- // load the database asynchronously
- future_load_ = std::async (std::launch::async, &LotWUsers::impl::load_dictionary, this, csv_file_name);
+ if (exists)
+ {
+ // load the database asynchronously
+ future_load_ = std::async (std::launch::async, &LotWUsers::impl::load_dictionary, this, csv_file_name);
+ }
}
}
@@ -254,9 +258,9 @@ void LotWUsers::set_local_file_path (QString const& path)
m_->csv_file_.setFileName (path);
}
-void LotWUsers::load (QString const& url, bool force_download)
+void LotWUsers::load (QString const& url, bool fetch, bool force_download)
{
- m_->load (url, force_download);
+ m_->load (url, fetch, force_download);
}
void LotWUsers::set_age_constraint (qint64 uploaded_since_days)