summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-08-16 23:18:45 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-08-16 23:18:45 (GMT)
commit54ed399e4dbe3975951157774c380b68a43768fa (patch)
treedff38e67eba6208ca5bcc3ac246acd17f598aab9
parent9cd7ced15ab6aecdaab41dc3545e3129661a2c3d (diff)
Allow for fake catalogs where prefix+number designation makes no sense.
-rw-r--r--datahandlers/catalogdb.cpp12
-rw-r--r--datahandlers/catalogdb.h11
2 files changed, 20 insertions, 3 deletions
diff --git a/datahandlers/catalogdb.cpp b/datahandlers/catalogdb.cpp
index b407a59..75818e8 100644
--- a/datahandlers/catalogdb.cpp
+++ b/datahandlers/catalogdb.cpp
@@ -747,7 +747,8 @@ void CatalogDB::GetCatalogData(const QString& catalog_name,
void CatalogDB::GetAllObjects(const QString &catalog,
QList< SkyObject* > &sky_list,
QList < QPair <int, QString> > &object_names,
- CatalogComponent *catalog_ptr) {
+ CatalogComponent *catalog_ptr,
+ bool includeCatalogDesignation ) {
sky_list.clear();
QString selected_catalog = QString::number(FindCatalog(catalog));
skydb_.open();
@@ -784,7 +785,14 @@ void CatalogDB::GetAllObjects(const QString &catalog,
float PA = get_query.value(10).toFloat();
float flux = get_query.value(11).toFloat();
- QString name = catPrefix + ' ' + QString::number(id_number_in_catalog);
+ QString name;
+ if( ! includeCatalogDesignation && ! lname.isEmpty() ) {
+ name = lname;
+ lname = QString();
+ }
+ else
+ name = catPrefix + ' ' + QString::number(id_number_in_catalog);
+
SkyPoint t;
t.set(RA, Dec);
diff --git a/datahandlers/catalogdb.h b/datahandlers/catalogdb.h
index 2a4d7f0..9381341 100644
--- a/datahandlers/catalogdb.h
+++ b/datahandlers/catalogdb.h
@@ -124,12 +124,21 @@ class CatalogDB {
* @param names List of named objects in database (assigns)
* @param catalog_pointer pointer to the catalogcomponent objects
* (needed for building skyobjects)
+ * @param includeCatalogDesignation This is useful when using 'fake'
+ * catalogs to bundle up catalogs. Imagine a "Misc" catalog with a
+ * bunch of miscellaneous objects. We don't want the designations
+ * "Misc 1", "Misc 2" etc. So the only proper designations are the
+ * long name. When this is the case, this flag is set to false,
+ * and the catalog designation (cat_prefix + cat_id) will not be
+ * included in the object_names returned.
+ *
* @return void
**/
void GetAllObjects(const QString &catalog_name,
QList< SkyObject* > &sky_list,
QList < QPair <int, QString> > &object_names,
- CatalogComponent *catalog_pointer);
+ CatalogComponent *catalog_pointer,
+ bool includeCatalogDesignation = true );
/**
* @brief Get information about the catalog like Prefix etc