RMG: adjust the directory code in main.cpp

This commit is contained in:
Rosalie Wanders
2023-09-06 01:30:03 +02:00
parent edbce2e415
commit c70f59d7b6
+10 -2
View File
@@ -11,8 +11,8 @@
#include <QApplication>
#include <QCommandLineParser>
#include <QDir>
#include <QFile>
#include <QDir>
#include <RMG-Core/Core.hpp>
#include <iostream>
@@ -138,7 +138,15 @@ int main(int argc, char **argv)
UserInterface::MainWindow window;
#ifdef PORTABLE_INSTALL
QDir::setCurrent(app.applicationDirPath());
// we have to keep backwards compatability
// with <v0.5.2, so we'll check if a portable.txt file exists,
// or if the Config/mupen64plus.cfg file exists, if it does,
// then change the current directory to the executable path
if (QFile(app.applicationDirPath() + "/portable.txt").exists() ||
QFile(app.applicationDirPath() + "/Config/mupen64plus.cfg").exists())
{
QDir::setCurrent(app.applicationDirPath());
}
#endif
QCoreApplication::setApplicationName("Rosalie's Mupen GUI");