mirror of
https://github.com/RetroShare/RetroShare.git
synced 2026-09-12 19:50:17 +05:00
Use “QCoreApplication::applicationFilePath” instead of argv[0] for the name of the executable file, as argv[0] does not always contain the full path on Windows
This commit is contained in:
parent
086184ad21
commit
e635848438
@ -326,11 +326,13 @@ int main(int argc, char *argv[])
|
||||
qt_use_native_dialogs = false;
|
||||
#endif
|
||||
|
||||
QString applicationFilePath;
|
||||
{
|
||||
/* Set the current directory to the application dir,
|
||||
because the start dir with autostart from the registry run key is not the exe dir */
|
||||
QApplication app(argc, argv);
|
||||
QDir::setCurrent(QCoreApplication::applicationDirPath());
|
||||
applicationFilePath = QCoreApplication::applicationFilePath();
|
||||
}
|
||||
#endif
|
||||
#ifdef SIGFPE_DEBUG
|
||||
@ -427,7 +429,7 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
|
||||
|
||||
// Now start RS login system
|
||||
|
||||
conf.main_executable_path = argv[0];
|
||||
conf.main_executable_path = applicationFilePath.toStdString();
|
||||
|
||||
int initResult = RsInit::InitRetroShare(conf);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user