summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-03 09:03:27 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-03 09:03:27 (GMT)
commit3435bcf6025f5bb016e62f7e9a5ec3cf4f937fdd (patch)
tree9ce6d3779d6b69d8778787bf3f799d4854c6f1ba
parent87e676a61853d60a85dd4a92cadd80b56c7f11d0 (diff)
Treat empty drivers as invalid as well
-rw-r--r--kstars/ekos/profileeditor.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/kstars/ekos/profileeditor.cpp b/kstars/ekos/profileeditor.cpp
index 2a8ff8c..d9bfe0c 100644
--- a/kstars/ekos/profileeditor.cpp
+++ b/kstars/ekos/profileeditor.cpp
@@ -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);