MinorPlanets and Comets don't get selection pointers

Bug #688930 reported by Matthew Gates
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stellarium
Fix Released
Medium
Bogdan Marinov

Bug Description

Affects: MinorPlanet objects & Comet objects which have been added to SolarSystem using the Solar System Edtior plugin.
When these objects are selected (e.g. search dialog used to select them), no pointer is drawn, which is done for other planetary bodies.

Problem appears to be that when StelObjectMgr::getSelectedObject is called in drawPointer, it returns an empty list because the object type is not "Planet". See SolarSystem::drawPointer, specifically SolarSystem.cpp:152.

Two possible solutions (I would like feedback on which is preferred:

1. MinorPlanet::getType() and Comet::getType() return "Planet" (which is their parent class)
2. SolarSystem::drawPointer does three calls to StelObjectMgr::getSelectedObject, one for "Planet", one for "MinorPlanet" and one for "Comet", appending results to list before iterating over list.

Comments?

Changed in stellarium:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → 1.0.0
Revision history for this message
Bogdan Marinov (daggerstab) wrote :

SolarSystem::drawPointer() is not the only method using the type string. The other two are SolarSystem::setSelected() and SolarSystem::selectedObjectChange(). The SolarSystem class was simply not created with multiple object types in mind.

Anyway, the simpler solution for now is to have the child classes return "Planet", as the type is used only in SolarSystem. I've committed this as trunk revision 4900:
http://bazaar.launchpad.net/~stellarium/stellarium/trunk/revision/4900

Where else is the getType() function significant? Scripts?

Changed in stellarium:
status: Confirmed → In Progress
Changed in stellarium:
milestone: 1.0.0 → 0.11.0
Changed in stellarium:
assignee: nobody → Bogdan Marinov (daggerstab)
Changed in stellarium:
status: In Progress → Fix Committed
Changed in stellarium:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.