summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-08-17 10:34:50 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-08-17 10:47:54 (GMT)
commit234259d760a446ca7f1edf07672b7f8c24e6472f (patch)
treed32ced05ef1614cef990a637e789c97f2680dda8
parent3f0e2d2f094bc33c1e989b83484dc3f7da7c3ffb (diff)
Initialize magnitudes in DeepSkyObject c'tors.
-rw-r--r--kstars/skyobjects/deepskyobject.cpp4
-rw-r--r--kstars/skyobjects/skyobject.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/kstars/skyobjects/deepskyobject.cpp b/kstars/skyobjects/deepskyobject.cpp
index edb2b91..8423de8 100644
--- a/kstars/skyobjects/deepskyobject.cpp
+++ b/kstars/skyobjects/deepskyobject.cpp
@@ -49,7 +49,8 @@ DeepSkyObject::DeepSkyObject( const DeepSkyObject &o )
, Catalog( o.Catalog )
{
customCat = NULL;
- Flux = 0;
+ Flux = o.flux();
+ setMag( o.mag() );
updateID = updateNumID = 0;
}
@@ -89,6 +90,7 @@ DeepSkyObject::DeepSkyObject( const CatalogEntryData &data, CatalogComponent *ca
MajorAxis = data.major_axis;
MinorAxis = data.minor_axis;
PositionAngle = data.position_angle;
+ setMag( data.magnitude );
PGC = 0;
UGC = 0;
setCatalog( data.catalog_name );
diff --git a/kstars/skyobjects/skyobject.h b/kstars/skyobjects/skyobject.h
index 979e5fd..5024241 100644
--- a/kstars/skyobjects/skyobject.h
+++ b/kstars/skyobjects/skyobject.h
@@ -403,6 +403,7 @@ protected:
/**Set the object's sorting magnitude.
* @param m the object's magnitude. */
inline void setMag( float m ) { sortMagnitude = m < 36.0 ? m : NaN::f; } // Updating faintest sane magnitude to 36.0 (faintest visual magnitude visible with E-ELT, acc. to Wikipedia on Apparent Magnitude.)
+ // FIXME: We claim sortMagnitude should not be NaN, but we are setting it to NaN above!! ^
/**Set the object's primary name.
* @param name the object's primary name */