Commit 3435bcf6 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Treat empty drivers as invalid as well

parent 87e676a6
......@@ -118,65 +118,65 @@ void ProfileEditor::saveProfile()
pi->country.clear();
}
if (ui->mountCombo->currentText() != "--")
pi->drivers["Mount"] = ui->mountCombo->currentText();
else
if (ui->mountCombo->currentText().isEmpty() || ui->mountCombo->currentText() == "--")
pi->drivers.remove("Mount");
if (ui->ccdCombo->currentText() != "--")
pi->drivers["CCD"] = ui->ccdCombo->currentText();
else
pi->drivers.remove("CCD");
pi->drivers["Mount"] = ui->mountCombo->currentText();
if (ui->guiderCombo->currentText() != "--")
pi->drivers["Guider"] = ui->guiderCombo->currentText();
if (ui->ccdCombo->currentText().isEmpty() || ui->ccdCombo->currentText() == "--")
pi->drivers.remove("CCD");
else
pi->drivers.remove("Guider");
pi->drivers["CCD"] = ui->ccdCombo->currentText();
if (ui->focuserCombo->currentText() != "--")
pi->drivers["Focuser"] = ui->focuserCombo->currentText();
if (ui->guiderCombo->currentText().isEmpty() || ui->guiderCombo->currentText() == "--")
pi->drivers.remove("Guider");
else
pi->drivers.remove("Focuser");
pi->drivers["Guider"] = ui->guiderCombo->currentText();
if (ui->filterCombo->currentText() != "--")
pi->drivers["Filter"] = ui->filterCombo->currentText();
if (ui->focuserCombo->currentText().isEmpty() || ui->focuserCombo->currentText() == "--")
pi->drivers.remove("Focuser");
else
pi->drivers.remove("Filter");
pi->drivers["Focuser"] = ui->focuserCombo->currentText();
if (ui->AOCombo->currentText() != "--")
pi->drivers["AO"] = ui->AOCombo->currentText();
if (ui->filterCombo->currentText().isEmpty() || ui->filterCombo->currentText() == "--")
pi->drivers.remove("Filter");
else
pi->drivers.remove("AO");
pi->drivers["Filter"] = ui->filterCombo->currentText();
if (ui->domeCombo->currentText() != "--")
pi->drivers["Dome"] = ui->domeCombo->currentText();
if (ui->AOCombo->currentText().isEmpty() || ui->AOCombo->currentText() == "--")
pi->drivers.remove("AO");
else
pi->drivers.remove("Dome");
pi->drivers["AO"] = ui->AOCombo->currentText();
if (ui->weatherCombo->currentText() != "--")
pi->drivers["Weather"] = ui->weatherCombo->currentText();
if (ui->domeCombo->currentText().isEmpty() || ui->domeCombo->currentText() == "--")
pi->drivers.remove("Dome");
else
pi->drivers.remove("Weather");
pi->drivers["Dome"] = ui->domeCombo->currentText();
if (ui->aux1Combo->currentText() != "--")
pi->drivers["Aux1"] = ui->aux1Combo->currentText();
if (ui->weatherCombo->currentText().isEmpty() || ui->weatherCombo->currentText() == "--")
pi->drivers.remove("Weather");
else
pi->drivers.remove("Aux1");
pi->drivers["Weather"] = ui->weatherCombo->currentText();
if (ui->aux2Combo->currentText() != "--")
pi->drivers["Aux2"] = ui->aux2Combo->currentText();
if (ui->aux1Combo->currentText().isEmpty() || ui->aux1Combo->currentText() == "--")
pi->drivers.remove("Aux1");
else
pi->drivers.remove("Aux2");
pi->drivers["Aux1"] = ui->aux1Combo->currentText();
if (ui->aux3Combo->currentText() != "--")
pi->drivers["Aux3"] = ui->aux3Combo->currentText();
if (ui->aux2Combo->currentText().isEmpty() || ui->aux2Combo->currentText() == "--")
pi->drivers.remove("Aux2");
else
pi->drivers.remove("Aux3");
pi->drivers["Aux2"] = ui->aux2Combo->currentText();
if (ui->aux4Combo->currentText() != "--")
pi->drivers["Aux4"] = ui->aux4Combo->currentText();
if (ui->aux3Combo->currentText().isEmpty() || ui->aux3Combo->currentText() == "--")
pi->drivers.remove("Aux3");
else
pi->drivers["Aux3"] = ui->aux3Combo->currentText();
if (ui->aux4Combo->currentText().isEmpty() || ui->aux4Combo->currentText() == "--")
pi->drivers.remove("Aux4");
else
pi->drivers["Aux4"] = ui->aux4Combo->currentText();
KStarsData::Instance()->userdb()->SaveProfile(pi);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment