Telescope.cpp   Telescope.cpp 
skipping to change at line 25 skipping to change at line 25
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "Telescope.hpp" #include "Telescope.hpp"
#include <QDebug> #include <QDebug>
#include <QSettings> #include <QSettings>
Telescope::Telescope() Telescope::Telescope()
: m_diameter(0.)
, m_focalLength(0.)
, m_hFlipped(false)
, m_vFlipped(false)
{ {
} }
Telescope::Telescope(const QObject& other) Telescope::Telescope(const QObject& other)
: m_name(other.property("name").toString())
, m_diameter(other.property("diameter").toDouble())
, m_focalLength(other.property("focalLength").toDouble())
, m_hFlipped(other.property("hFlipped").toBool())
, m_vFlipped(other.property("vFlipped").toBool())
{ {
this->m_diameter = other.property("diameter").toDouble();
this->m_focalLength = other.property("focalLength").toDouble();
this->m_hFlipped = other.property("hFlipped").toBool();
this->m_vFlipped = other.property("vFlipped").toBool();
this->m_name = other.property("name").toString();
} }
Telescope::~Telescope() Telescope::~Telescope()
{ {
} }
static QMap<int, QString> mapping; static QMap<int, QString> mapping;
QMap<int, QString> Telescope::propertyMap() QMap<int, QString> Telescope::propertyMap()
{ {
if(mapping.isEmpty()) { if(mapping.isEmpty()) {
skipping to change at line 111 skipping to change at line 115
bool Telescope::isVFlipped() const bool Telescope::isVFlipped() const
{ {
return m_vFlipped; return m_vFlipped;
} }
void Telescope::setVFlipped(bool flipped) void Telescope::setVFlipped(bool flipped)
{ {
m_vFlipped = flipped; m_vFlipped = flipped;
} }
void Telescope::writeToSettings(QSettings * settings, const int index)
{
QString prefix = "telescope/" + QVariant(index).toString() + "/";
settings->setValue(prefix + "name", this->name());
settings->setValue(prefix + "focalLength", this->focalLength());
settings->setValue(prefix + "diameter", this->diameter());
settings->setValue(prefix + "hFlip", this->isHFlipped());
settings->setValue(prefix + "vFlip", this->isVFlipped());
}
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Static Methods #pragma mark Static Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
Telescope* Telescope::telescopeFromSettings(QSettings* theSettings, int tel escopeIndex) Telescope* Telescope::telescopeFromSettings(QSettings* theSettings, int tel escopeIndex)
{ {
Telescope* telescope = new Telescope(); Telescope* telescope = new Telescope();
 End of changes. 4 change blocks. 
5 lines changed or deleted 19 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/