Update windows launch on start binary location

Fixes: #7672
This commit is contained in:
Hannah von Reth 2020-12-15 15:02:33 +01:00 committed by Kevin Ottens
parent 69915ab594
commit 552427ffc3
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2
2 changed files with 5 additions and 2 deletions

View file

@ -94,7 +94,7 @@ void setLaunchOnStartup_private(const QString &appName, const QString &guiName,
QString runPath = QLatin1String(runPathC);
QSettings settings(runPath, QSettings::NativeFormat);
if (enable) {
settings.setValue(appName, QCoreApplication::applicationFilePath().replace(QLatin1Char('/'), QLatin1Char('\\')));
settings.setValue(appName, QDir::toNativeSeparators(QCoreApplication::applicationFilePath()));
} else {
settings.remove(appName);
}

View file

@ -161,7 +161,10 @@ GeneralSettings::GeneralSettings(QWidget *parent)
_ui->autostartCheckBox->setDisabled(true);
_ui->autostartCheckBox->setToolTip(tr("You cannot disable autostart because system-wide autostart is enabled."));
} else {
_ui->autostartCheckBox->setChecked(Utility::hasLaunchOnStartup(Theme::instance()->appName()));
const bool hasAutoStart = Utility::hasLaunchOnStartup(Theme::instance()->appName());
// make sure the binary location is correctly set
slotToggleLaunchOnStartup(hasAutoStart);
_ui->autostartCheckBox->setChecked(hasAutoStart);
connect(_ui->autostartCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::slotToggleLaunchOnStartup);
}