refactor: Remove unneeded QVariant() when setting a setting empty to be removed

This commit is contained in:
sithlord48
2026-01-18 09:32:19 -05:00
committed by Nick Bolton
parent b25f083433
commit 7a2ceeedf4
4 changed files with 7 additions and 7 deletions

View File

@ -96,10 +96,10 @@ void DaemonApp::clearWatchdogCommand()
void DaemonApp::clearSettings() const
{
LOG_INFO("clearing daemon settings");
Settings::setValue(Settings::Daemon::Command, QVariant());
Settings::setValue(Settings::Daemon::Elevate, QVariant());
Settings::setValue(Settings::Daemon::LogFile, QVariant());
Settings::setValue(Settings::Daemon::LogLevel, QVariant());
Settings::setValue(Settings::Daemon::Command);
Settings::setValue(Settings::Daemon::Elevate);
Settings::setValue(Settings::Daemon::LogFile);
Settings::setValue(Settings::Daemon::LogLevel);
}
void DaemonApp::connectIpcServer(const ipc::DaemonIpcServer *ipcServer) const

View File

@ -36,7 +36,7 @@ void clearSettings(bool enableRestart)
Settings::proxy().clear();
// Reset the windowGeometry
Settings::setValue(Settings::Gui::WindowGeometry, QVariant());
Settings::setValue(Settings::Gui::WindowGeometry);
// save but do not emit saving signal which will prevent the current state of
// the app config and server configs from being applied.

View File

@ -1223,7 +1223,7 @@ void MainWindow::remoteHostChanged(const QString &newRemoteHost)
m_coreProcess.setAddress(newRemoteHost);
toggleCanRunCore(!newRemoteHost.isEmpty() && ui->rbModeClient->isChecked());
if (newRemoteHost.isEmpty()) {
Settings::setValue(Settings::Client::RemoteHost, QVariant());
Settings::setValue(Settings::Client::RemoteHost);
} else {
Settings::setValue(Settings::Client::RemoteHost, newRemoteHost);
}

View File

@ -67,7 +67,7 @@ void SettingsTests::checkValidSettings()
QCOMPARE(qvariant_cast<QString>(spy.first().at(0)), setting);
QCOMPARE(Settings::value(setting).toString(), "NEW_VALUE");
Settings::setValue(setting, QVariant());
Settings::setValue(setting);
QCOMPARE(spy.count(), 2);
QCOMPARE(Settings::value(setting).toString(), value);