Fix GeoDB download in systems with non-C locales

Closes #13318.
This commit is contained in:
FranciscoPombal 2020-09-05 14:33:49 +01:00
parent 1c87073990
commit 9b43d260a7

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);
}