AppEnv wrong boolean return value fixed

This commit is contained in:
Rafael 2016-04-11 15:28:37 +02:00
parent 6cdcb018db
commit a7a6d5a1a0

View file

@ -32,17 +32,14 @@ AppEnv::AppEnv()
QString AppEnv::getGameFolder(bool *ok) QString AppEnv::getGameFolder(bool *ok)
{ {
Q_UNUSED(ok)
QDir dir; QDir dir;
bool retok;
QString GTAV_FOLDER(getenv("GTAV_FOLDER")); QString GTAV_FOLDER(getenv("GTAV_FOLDER"));
if (GTAV_FOLDER != "") if (GTAV_FOLDER != "")
{ {
dir.setPath(GTAV_FOLDER); dir.setPath(GTAV_FOLDER);
if (dir.exists()) if (dir.exists())
{ {
retok = true; *ok = true;
ok = &retok;
#ifdef GTA5SYNC_WIN #ifdef GTA5SYNC_WIN
_putenv(QString("GTAV_FOLDER=" + dir.absolutePath()).toStdString().c_str()); _putenv(QString("GTAV_FOLDER=" + dir.absolutePath()).toStdString().c_str());
#else #else
@ -67,8 +64,7 @@ QString AppEnv::getGameFolder(bool *ok)
dir.setPath(GTAV_returnFolder); dir.setPath(GTAV_returnFolder);
if (dir.exists()) if (dir.exists())
{ {
retok = true; *ok = true;
ok = &retok;
#ifdef GTA5SYNC_WIN #ifdef GTA5SYNC_WIN
_putenv(QString("GTAV_FOLDER=" + dir.absolutePath()).toStdString().c_str()); _putenv(QString("GTAV_FOLDER=" + dir.absolutePath()).toStdString().c_str());
#else #else
@ -80,8 +76,7 @@ QString AppEnv::getGameFolder(bool *ok)
dir.setPath(GTAV_defaultFolder); dir.setPath(GTAV_defaultFolder);
if (dir.exists()) if (dir.exists())
{ {
retok = true; *ok = true;
ok = &retok;
#ifdef GTA5SYNC_WIN #ifdef GTA5SYNC_WIN
_putenv(QString("GTAV_FOLDER=" + dir.absolutePath()).toStdString().c_str()); _putenv(QString("GTAV_FOLDER=" + dir.absolutePath()).toStdString().c_str());
#else #else
@ -90,8 +85,7 @@ QString AppEnv::getGameFolder(bool *ok)
return dir.absolutePath(); return dir.absolutePath();
} }
retok = false; *ok = false;
ok = &retok;
return ""; return "";
} }