Commit 4148ddf8 authored by Akarsh Simha's avatar Akarsh Simha
Browse files

Prevent showing _Internet_Resolved # names for internet-resolved objects

parent b43e6ece
......@@ -74,19 +74,14 @@ DeepSkyObject *SyncedCatalogComponent::addObject( CatalogEntryData catalogEntry
catalogEntry.major_axis = 0.0;
if( std::isnan( catalogEntry.minor_axis ) )
catalogEntry.minor_axis = 0.0;
if( catalogEntry.catalog_name != m_catName ) {
qWarning() << "Trying to add object with catalog name = " << catalogEntry.catalog_name << " to catalog " << m_catName << "! Will over-write catalog name with " << m_catName;
catalogEntry.catalog_name = m_catName;
// NOTE: We must fix the following before we can proceed with
// debugging: 1. CatalogEntryData doesn't come fully filled
// for us. We need to fill in catalog_name and
// ID. catalog_name is easy. For ID, we must maintain a
// running ocunter like was done in AddEntry() for
// "Misc". Please implement this.
CatalogEntryData dbEntry = catalogEntry;
if( dbEntry.catalog_name != m_catName ) {
qWarning() << "Trying to add object " << catalogEntry.catalog_name << catalogEntry.ID << " to catalog " << m_catName << " will over-write catalog name with " << m_catName << " in the database and assign an arbitrary ID";
dbEntry.catalog_name = m_catName;
}
catalogEntry.ID = m_catCount;
dbEntry.ID = m_catCount;
CatalogDB *db = KStarsData::Instance()->catalogdb();
if( !( db->AddEntry( catalogEntry, m_catId ) ) )
if( !( db->AddEntry( dbEntry, m_catId ) ) )
return 0;
m_catCount++;
qDebug() << "Added object " << catalogEntry.long_name << " into database!";
......
......@@ -75,11 +75,17 @@ DeepSkyObject::DeepSkyObject( const CatalogEntryData &data )
{
// FIXME: This assumes that CatalogEntryData coordinates have
// J2000.0 as epoch as opposed to the catalog's epoch!!! -- asimha
qWarning() << "Creating a DeepSkyObject from CatalogEntryData assumes that coordinates are J2000.0";
setType( data.type );
setRA0( data.ra/15.0 ); // NOTE: CatalogEntryData stores RA in degrees, whereas setRA0() wants it in hours.
setDec0( data.dec );
setLongName( data.long_name );
setName( data.catalog_name + ' ' + QString::number( data.ID ) );
if( ! data.catalog_name.isEmpty() )
setName( data.catalog_name + ' ' + QString::number( data.ID ) );
else {
setName( data.long_name );
setLongName( QString() );
}
MajorAxis = data.major_axis;
MinorAxis = data.minor_axis;
PositionAngle = data.position_angle;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment