mirror of
https://github.com/tnodir/fort
synced 2024-11-15 01:36:22 +00:00
UI: OsUtil::restart*: Fix args handling
This commit is contained in:
parent
e0fbeb5803
commit
cb1e07f933
@ -177,7 +177,7 @@ bool OsUtil::allowOtherForegroundWindows()
|
||||
void OsUtil::restartClient(const QString &installerPath)
|
||||
{
|
||||
QStringList args = QCoreApplication::arguments();
|
||||
args.insert(0, installerPath);
|
||||
args.replace(0, FileUtil::toNativeSeparators(installerPath)); // replace a program path
|
||||
|
||||
QProcess::startDetached("delay-start.bat", args);
|
||||
|
||||
@ -187,7 +187,9 @@ void OsUtil::restartClient(const QString &installerPath)
|
||||
void OsUtil::restart()
|
||||
{
|
||||
const QString appFilePath = QCoreApplication::applicationFilePath();
|
||||
const QStringList args = QCoreApplication::arguments();
|
||||
|
||||
QStringList args = QCoreApplication::arguments();
|
||||
args.removeFirst(); // remove a program path
|
||||
|
||||
qApp->connect(qApp, &QObject::destroyed, [=] { QProcess::startDetached(appFilePath, args); });
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user