Fix bug with std::stof being locale-dependant (#3012)

This commit is contained in:
Learath2 2017-07-15 02:38:10 +02:00 committed by Ivan
parent 504fa5ffda
commit 9c547d5eef

View File

@ -1,4 +1,4 @@

#include <QApplication>
#include <QMenuBar>
#include <QMessageBox>
@ -447,11 +447,10 @@ void main_window::InstallPup()
std::string version_string = pup.get_file(0x100).to_string();
version_string.erase(version_string.find('\n'));
const float cur_version = 4.81f;
float version = std::stof(version_string);
const std::string cur_version = "4.81";
if (version < cur_version &&
QMessageBox::question(this, tr("RPCS3 Firmware Installer"), tr("Old firmware detected.\nThe newest firmware version is %1 and you are trying to install version %2\nContinue installation?").arg(cur_version).arg(QString::fromStdString(version_string)),
if (version_string < cur_version &&
QMessageBox::question(this, tr("RPCS3 Firmware Installer"), tr("Old firmware detected.\nThe newest firmware version is %1 and you are trying to install version %2\nContinue installation?").arg(QString::fromStdString(cur_version), QString::fromStdString(version_string)),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No)
{
return;