correct re-launch implementation for windows
This commit is contained in:
@ -48,8 +48,8 @@
|
|||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <windows.h>
|
#include <process.h>
|
||||||
#define execv(exe, args) _execv(exe, args)
|
#define execl(exe, arg0, arg1) _execl(exe, arg0, arg1)
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@ -158,8 +158,9 @@ void Preferences::accept()
|
|||||||
"LAMMPS-GUI must be relaunched."),
|
"LAMMPS-GUI must be relaunched."),
|
||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
msg.exec();
|
msg.exec();
|
||||||
execv(QCoreApplication::applicationFilePath().toStdString().c_str(), nullptr);
|
const char *path = QCoreApplication::applicationFilePath().toStdString().c_str();
|
||||||
fprintf(stderr, "after relaunch\n");
|
const char *arg0 = QCoreApplication::arguments().at(0).toStdString().c_str();
|
||||||
|
execl(path, arg0, nullptr);
|
||||||
}
|
}
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user