1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 07:18:08 +00:00

Merge pull request #13328 from FranciscoPombal/fix_geodb

Fix GeoDB download in systems with non-C locales
This commit is contained in:
Mike Tzou 2020-09-07 10:23:55 +08:00 committed by GitHub
commit 84be5ed664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,7 @@
#include <QDir>
#include <QFile>
#include <QHostAddress>
#include <QLocale>
#include "base/logger.h"
#include "base/preferences.h"
@ -124,8 +125,8 @@ void GeoIPManager::manageDatabaseUpdate()
void GeoIPManager::downloadDatabaseFile()
{
const QDate curDate = QDateTime::currentDateTimeUtc().date();
const QString curUrl = DATABASE_URL.arg(curDate.toString("yyyy-MM"));
const QDateTime curDatetime = QDateTime::currentDateTimeUtc();
const QString curUrl = DATABASE_URL.arg(QLocale::c().toString(curDatetime, "yyyy-MM"));
DownloadManager::instance()->download({curUrl}, this, &GeoIPManager::downloadFinished);
}