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