set: fix wrong save path / fixed null deref / more env refactor

This commit is contained in:
Hane 2025-01-07 18:53:17 +01:00
commit c87c8d0990
5 changed files with 117 additions and 119 deletions

View file

@ -947,9 +947,12 @@ HeaderWidget::HeaderWidget(QWidget *parent) : QWidget(parent) {
channels->setChecked(true);
}
connect(channels, &QCheckBox::stateChanged, [this, parent](){
set->setValue("show_channels", channels->isChecked(), sizeof("show_channels"));
if(!OverseerHandler::settingsPath.empty()){
set->save(OverseerHandler::settingsPath.c_str());
//TODO: Find a better way to auto no-op when there's no settings file
if(set) {
set->setValue("show_channels", channels->isChecked(), sizeof("show_channels"));
if(!OverseerHandler::settingsPath.empty()){
set->save(OverseerHandler::settingsPath.c_str());
}
}
if(parent) {
QEvent explosion = QEvent((QEvent::Type)CustomQEvent::RecomposeMainWindow);