summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-29 18:34:37 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-29 18:34:37 (GMT)
commit042cf321fb0834c9c66ca6fae3dc94212a490260 (patch)
treee5ec390b3aaada41f3d271bf29bfd921e8ce6b75
parent187e93a259c5cc984c0ffc619b631290b5b9f5ae (diff)
Double check ccdNum value
-rw-r--r--kstars/ekos/align.cpp5
-rw-r--r--kstars/ekos/capture.cpp5
-rw-r--r--kstars/ekos/focus.cpp5
-rw-r--r--kstars/ekos/guide.cpp5
4 files changed, 20 insertions, 0 deletions
diff --git a/kstars/ekos/align.cpp b/kstars/ekos/align.cpp
index 3f84a14..4528566 100644
--- a/kstars/ekos/align.cpp
+++ b/kstars/ekos/align.cpp
@@ -289,8 +289,13 @@ void Align::setDefaultCCD(QString ccd)
void Align::checkCCD(int ccdNum)
{
if (ccdNum == -1)
+ {
ccdNum = CCDCaptureCombo->currentIndex();
+ if (ccdNum == -1)
+ return;
+ }
+
if (ccdNum <= CCDs.count())
{
currentCCD = CCDs.at(ccdNum);
diff --git a/kstars/ekos/capture.cpp b/kstars/ekos/capture.cpp
index 958f92d..94b9820 100644
--- a/kstars/ekos/capture.cpp
+++ b/kstars/ekos/capture.cpp
@@ -410,8 +410,13 @@ bool Capture::setCCD(QString device)
void Capture::checkCCD(int ccdNum)
{
if (ccdNum == -1)
+ {
ccdNum = CCDCaptureCombo->currentIndex();
+ if (ccdNum == -1)
+ return;
+ }
+
foreach(ISD::CCD *ccd, CCDs)
{
disconnect(ccd, SIGNAL(numberUpdated(INumberVectorProperty*)), this, SLOT(processCCDNumber(INumberVectorProperty*)));
diff --git a/kstars/ekos/focus.cpp b/kstars/ekos/focus.cpp
index a8139b6..97fcc73 100644
--- a/kstars/ekos/focus.cpp
+++ b/kstars/ekos/focus.cpp
@@ -308,8 +308,13 @@ void Focus::setDefaultCCD(QString ccd)
void Focus::checkCCD(int ccdNum)
{
if (ccdNum == -1)
+ {
ccdNum = CCDCaptureCombo->currentIndex();
+ if (ccdNum == -1)
+ return;
+ }
+
if (ccdNum >=0 && ccdNum <= CCDs.count())
{
currentCCD = CCDs.at(ccdNum);
diff --git a/kstars/ekos/guide.cpp b/kstars/ekos/guide.cpp
index 97d64f1..275859c 100644
--- a/kstars/ekos/guide.cpp
+++ b/kstars/ekos/guide.cpp
@@ -191,8 +191,13 @@ bool Guide::setCCD(QString device)
void Guide::checkCCD(int ccdNum)
{
if (ccdNum == -1)
+ {
ccdNum = guiderCombo->currentIndex();
+ if (ccdNum == -1)
+ return;
+ }
+
if (ccdNum <= CCDs.count())
{
currentCCD = CCDs.at(ccdNum);