summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander V. Wolf <aw@altspu.ru>2022-01-24 16:54:03 +0700
committerAlexander V. Wolf <aw@altspu.ru>2022-01-24 16:54:03 +0700
commit5c998fe6e3e527c94ee072eccabbaf7db2d603c3 (patch)
tree77c17b90a193c9362585dd39065d8543db075ebe
parent967d239c5a39c7b17220246f038471ad186c7244 (diff)
Fixed crash on exit when Telescopes tab of Oculars is active (fix #2103)
-rw-r--r--plugins/Oculars/src/CCD.cpp14
-rw-r--r--plugins/Oculars/src/Lens.cpp7
-rw-r--r--plugins/Oculars/src/Ocular.cpp20
-rw-r--r--plugins/Oculars/src/Oculars.cpp38
-rw-r--r--plugins/Oculars/src/Telescope.cpp14
-rw-r--r--plugins/Oculars/src/gui/OcularDialog.cpp31
-rw-r--r--plugins/Oculars/src/gui/PropertyBasedTableModel.cpp13
7 files changed, 11 insertions, 126 deletions
diff --git a/plugins/Oculars/src/CCD.cpp b/plugins/Oculars/src/CCD.cpp
index 252d7bdfee..d37628bea8 100644
--- a/plugins/Oculars/src/CCD.cpp
+++ b/plugins/Oculars/src/CCD.cpp
@@ -89,13 +89,6 @@ QMap<int, QString> CCD::propertyMap()
return mapping;
}
-
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark Instance Methods
-#endif
-/* ********************************************************************* */
QString CCD::name() const
{
return m_name;
@@ -286,12 +279,7 @@ void CCD::writeToSettings(QSettings * settings, const int index)
settings->setValue(prefix + "prism_distance", this->prismDistance());
settings->setValue(prefix + "prism_pos_angle", this->prismPosAngle());
}
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark Static Methods
-#endif
-/* ********************************************************************* */
+
CCD* CCD::ccdFromSettings(QSettings* settings, int ccdIndex)
{
CCD* ccd = new CCD();
diff --git a/plugins/Oculars/src/Lens.cpp b/plugins/Oculars/src/Lens.cpp
index 64f7916f41..f334be83c9 100644
--- a/plugins/Oculars/src/Lens.cpp
+++ b/plugins/Oculars/src/Lens.cpp
@@ -74,13 +74,6 @@ void Lens::writeToSettings(QSettings * settings, const int index)
settings->setValue(prefix + "multipler", this->getMultipler());
}
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark Static Methods
-#endif
-/* ********************************************************************* */
-
Lens* Lens:: lensFromSettings(QSettings* theSettings, int lensIndex)
{
Lens* lens = new Lens();
diff --git a/plugins/Oculars/src/Ocular.cpp b/plugins/Oculars/src/Ocular.cpp
index ed2eebbc8e..2ba9d8a319 100644
--- a/plugins/Oculars/src/Ocular.cpp
+++ b/plugins/Oculars/src/Ocular.cpp
@@ -60,13 +60,6 @@ QMap<int, QString> Ocular::propertyMap(void)
return mapping;
}
-
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark Instance Methods
-#endif
-/* ********************************************************************* */
double Ocular::actualFOV(const Telescope * telescope, const Lens * lens) const
{
const double lens_multipler = (lens != Q_NULLPTR ? lens->getMultipler() : 1.0);
@@ -94,12 +87,6 @@ double Ocular::magnification(const Telescope * telescope, const Lens * lens) con
return magnifiction;
}
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark Accessors & Mutators
-#endif
-/* ********************************************************************* */
QString Ocular::name(void) const
{
return m_name;
@@ -169,13 +156,6 @@ void Ocular::setReticlePath(const QString path)
m_reticlePath = path;
}
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark Static Methods
-#endif
-/* ********************************************************************* */
-
Ocular * Ocular::ocularFromSettings(const QSettings *theSettings, const int ocularIndex)
{
Ocular* ocular = new Ocular();
diff --git a/plugins/Oculars/src/Oculars.cpp b/plugins/Oculars/src/Oculars.cpp
index ce03289e3c..023e22ade8 100644
--- a/plugins/Oculars/src/Oculars.cpp
+++ b/plugins/Oculars/src/Oculars.cpp
@@ -64,12 +64,6 @@ extern void qt_set_sequence_auto_mnemonic(bool b);
static QSettings *settings; //!< The settings as read in from the ini file.
-/* ****************************************************************************************************************** */
-#if 0
-#pragma mark -
-#pragma mark StelModuleMgr Methods
-#endif
-/* ****************************************************************************************************************** */
//! This method is the one called automatically by the StelModuleMgr just
//! after loading the dynamic library
StelModule* OcularsStelPluginInterface::getStelModule() const
@@ -93,13 +87,6 @@ StelPluginInfo OcularsStelPluginInterface::getPluginInfo() const
return info;
}
-
-/* ****************************************************************************************************************** */
-#if 0
-#pragma mark -
-#pragma mark Instance Methods
-#endif
-/* ****************************************************************************************************************** */
Oculars::Oculars()
: selectedCCDIndex(-1)
, selectedOcularIndex(-1)
@@ -239,13 +226,6 @@ QSettings* Oculars::getSettings()
return settings;
}
-
-/* ****************************************************************************************************************** */
-#if 0
-#pragma mark -
-#pragma mark StelModule Methods
-#endif
-/* ****************************************************************************************************************** */
bool Oculars::configureGui(bool show)
{
if (show)
@@ -661,12 +641,6 @@ void Oculars::init()
connect(skyDrawer, SIGNAL(flagStarMagnitudeLimitChanged(bool)), this, SLOT(handleStarMagLimitToggle(bool)));
}
-/* ****************************************************************************************************************** */
-#if 0
-#pragma mark -
-#pragma mark Private slots Methods
-#endif
-/* ****************************************************************************************************************** */
void Oculars::determineMaxEyepieceAngle()
{
if (ready)
@@ -808,12 +782,6 @@ void Oculars::updateOcularReticle(void)
}
}
-/* ****************************************************************************************************************** */
-#if 0
-#pragma mark -
-#pragma mark Slots Methods
-#endif
-/* ****************************************************************************************************************** */
void Oculars::updateLists()
{
if (oculars.isEmpty())
@@ -1502,12 +1470,6 @@ void Oculars::toggleTelrad()
toggleTelrad(!flagShowTelrad);
}
-/* ****************************************************************************************************************** */
-#if 0
-#pragma mark -
-#pragma mark Private Methods
-#endif
-/* ****************************************************************************************************************** */
void Oculars::initializeActivationActions()
{
QString ocularsGroup = N_("Oculars");
diff --git a/plugins/Oculars/src/Telescope.cpp b/plugins/Oculars/src/Telescope.cpp
index bddea7a662..9fc69d90b7 100644
--- a/plugins/Oculars/src/Telescope.cpp
+++ b/plugins/Oculars/src/Telescope.cpp
@@ -59,12 +59,6 @@ QMap<int, QString> Telescope::propertyMap()
return mapping;
}
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark Accessors & Mutators
-#endif
-/* ********************************************************************* */
const QString Telescope::name() const
{
return m_name;
@@ -136,13 +130,6 @@ void Telescope::writeToSettings(QSettings * settings, const int index)
settings->setValue(prefix + "equatorial", this->isEquatorial());
}
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark Static Methods
-#endif
-/* ********************************************************************* */
-
Telescope* Telescope::telescopeFromSettings(QSettings* theSettings, int telescopeIndex)
{
Telescope* telescope = new Telescope();
@@ -156,6 +143,7 @@ Telescope* Telescope::telescopeFromSettings(QSettings* theSettings, int telescop
telescope->setEquatorial(theSettings->value(prefix + "equatorial").toBool());
return telescope;
}
+
Telescope* Telescope::telescopeModel()
{
Telescope* model = new Telescope();
diff --git a/plugins/Oculars/src/gui/OcularDialog.cpp b/plugins/Oculars/src/gui/OcularDialog.cpp
index 5ef0307ac1..898f83fefe 100644
--- a/plugins/Oculars/src/gui/OcularDialog.cpp
+++ b/plugins/Oculars/src/gui/OcularDialog.cpp
@@ -79,21 +79,20 @@ OcularDialog::OcularDialog(Oculars* pluginPtr,
OcularDialog::~OcularDialog()
{
- ocularTableModel->disconnect();
- telescopeTableModel->disconnect();
- ccdTableModel->disconnect();
- lensTableModel->disconnect();
+ ui->telescopeListView->clearSelection();
+ ui->ocularListView->clearSelection();
+ ui->ccdListView->clearSelection();
+ ui->lensListView->clearSelection();
+
+ ocularTableModel->disconnect(ocularMapper);
+ telescopeTableModel->disconnect(telescopeMapper);
+ ccdTableModel->disconnect(ccdMapper);
+ lensTableModel->disconnect(lensMapper);
delete ui;
ui = Q_NULLPTR;
}
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark StelModule Methods
-#endif
-/* ********************************************************************* */
void OcularDialog::retranslate()
{
if (dialog) {
@@ -102,12 +101,6 @@ void OcularDialog::retranslate()
}
}
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark Slot Methods
-#endif
-/* ********************************************************************* */
void OcularDialog::closeWindow()
{
setVisible(false);
@@ -288,12 +281,6 @@ void OcularDialog::moveDownSelectedLens()
}
}
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark Protected Methods
-#endif
-/* ********************************************************************* */
void OcularDialog::createDialogContent()
{
ui->setupUi(dialog);
diff --git a/plugins/Oculars/src/gui/PropertyBasedTableModel.cpp b/plugins/Oculars/src/gui/PropertyBasedTableModel.cpp
index 7c2996a7bb..e4c12e8696 100644
--- a/plugins/Oculars/src/gui/PropertyBasedTableModel.cpp
+++ b/plugins/Oculars/src/gui/PropertyBasedTableModel.cpp
@@ -19,12 +19,6 @@
#include "PropertyBasedTableModel.hpp"
#include <QDebug>
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark instance Methods
-#endif
-/* ********************************************************************* */
PropertyBasedTableModel::PropertyBasedTableModel(QObject *parent)
: QAbstractTableModel(parent)
, content(Q_NULLPTR)
@@ -48,13 +42,6 @@ void PropertyBasedTableModel::init(QList<QObject *>* content, QObject *model, QM
endResetModel();
}
-/* ********************************************************************* */
-#if 0
-#pragma mark -
-#pragma mark Model Methods
-#endif
-/* ********************************************************************* */
-
int PropertyBasedTableModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent)