Commit e1229a8d authored by Rishab Arora's avatar Rishab Arora
Browse files

Complete DSO list in Find Box

Corrected PA issue. Again.
parent 418c9f48
...@@ -665,7 +665,7 @@ void CatalogDB::GetCatalogData(const QString& catalog_name, ...@@ -665,7 +665,7 @@ void CatalogDB::GetCatalogData(const QString& catalog_name,
void CatalogDB::GetAllObjects(const QString &catalog, void CatalogDB::GetAllObjects(const QString &catalog,
QList< SkyObject* > &sky_list, QList< SkyObject* > &sky_list,
QMap<int, QString> &names, QList < QPair <int, QString> > &object_names,
CatalogComponent *catalog_ptr) { CatalogComponent *catalog_ptr) {
sky_list.clear(); sky_list.clear();
QString selected_catalog = QString::number(FindCatalog(catalog)); QString selected_catalog = QString::number(FindCatalog(catalog));
...@@ -732,7 +732,7 @@ void CatalogDB::GetAllObjects(const QString &catalog, ...@@ -732,7 +732,7 @@ void CatalogDB::GetAllObjects(const QString &catalog,
} else { // Add a deep-sky object } else { // Add a deep-sky object
DeepSkyObject *o = new DeepSkyObject(iType, RA, Dec, mag, DeepSkyObject *o = new DeepSkyObject(iType, RA, Dec, mag,
name, QString(), lname, name, QString(), lname,
catPrefix, a, b, PA); catPrefix, a, b, -PA);
o->setFlux(flux); o->setFlux(flux);
o->setCustomCatalog(catalog_ptr); o->setCustomCatalog(catalog_ptr);
...@@ -740,12 +740,12 @@ void CatalogDB::GetAllObjects(const QString &catalog, ...@@ -740,12 +740,12 @@ void CatalogDB::GetAllObjects(const QString &catalog,
// Add name to the list of object names // Add name to the list of object names
if (!name.isEmpty()) { if (!name.isEmpty()) {
names.insert(iType, name); object_names.append(qMakePair<int,QString>(iType, name));
} }
} }
if (!lname.isEmpty() && lname != name) { if (!lname.isEmpty() && lname != name) {
names.insert(iType, lname); object_names.append(qMakePair<int,QString>(iType, lname));
} }
} }
......
...@@ -128,7 +128,7 @@ class CatalogDB { ...@@ -128,7 +128,7 @@ class CatalogDB {
**/ **/
void GetAllObjects(const QString &catalog_name, void GetAllObjects(const QString &catalog_name,
QList< SkyObject* > &sky_list, QList< SkyObject* > &sky_list,
QMap <int, QString> &named_objects, QList < QPair <int, QString> > &object_names,
CatalogComponent *catalog_pointer); CatalogComponent *catalog_pointer);
/** /**
......
...@@ -49,18 +49,16 @@ CatalogComponent::~CatalogComponent() { ...@@ -49,18 +49,16 @@ CatalogComponent::~CatalogComponent() {
void CatalogComponent::loadData() { void CatalogComponent::loadData() {
emitProgressText( i18n("Loading custom catalog: %1", m_catName ) ); emitProgressText( i18n("Loading custom catalog: %1", m_catName ) );
QMap <int, QString> names; QList < QPair <int, QString> > names;
KStars::Instance()->data()->catalogdb()->GetAllObjects(m_catName, KStars::Instance()->data()->catalogdb()->GetAllObjects(m_catName,
m_ObjectList, m_ObjectList,
names, names,
this); this);
const int number_of_types = 10; for (int iter = 0; iter < names.size(); iter++) {
for (int i=0; i < number_of_types; i++) { if (names.at(iter).first <= SkyObject::TYPE_UNKNOWN) {
QList<QString> retrieved = names.values(i); objectNames(names.at(iter).first).append(names.at(iter).second);
if (retrieved.length()>0) { }
objectNames(i).append(retrieved);
}
} }
CatalogData loaded_catalog_data; CatalogData loaded_catalog_data;
......
Markdown is supported
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