Commit 4eeb9a02 authored by Samikshan Bairagya's avatar Samikshan Bairagya

Use more user-friendly names for sky-objects when available.

parent c5bb591e
......@@ -19,7 +19,7 @@
#include "kstarsdata.h"
#include "skyobjitem.h"
SkyObjItem::SkyObjItem(SkyObject *so) : m_Name(so->name()), m_TypeName(so->typeName()), m_So(so)
SkyObjItem::SkyObjItem(SkyObject *so) : m_Name(so->name()), m_LongName(so->longname()),m_TypeName(so->typeName()), m_So(so)
{
switch (so->type())
{
......@@ -55,7 +55,7 @@ QVariant SkyObjItem::data(int role)
switch(role)
{
case DispNameRole:
return getName();
return getLongName();
case CategoryRole:
return getType();
case CategoryNameRole:
......
......@@ -67,6 +67,12 @@ public:
*/
inline QString getName() const { return m_Name; }
/**
* \brief Get longname of sky-object associated with the SkyObjItem.
* \return Longname of sky-object associated with the SkyObjItem as a QString
*/
inline QString getLongName() const { return m_LongName; }
/**
* \brief Get category of sky-object associated with the SkyObjItem as a QString.
* \return Category of sky-object associated with the SkyObjItem as a QString.
......@@ -111,6 +117,7 @@ public:
private:
QString m_Name; ///Name of sky-object
QString m_LongName; ///Longname of sky-object(if available)
QString m_TypeName; ///Category of sky-object
QString m_Position; ///Position of sky-object in the sky.
Type m_Type; ///Category of sky-object of type SkyObjItem::Type
......
......@@ -72,6 +72,7 @@ WIView::WIView(QWidget *parent, ObsConditions *obs) : QWidget(parent)
// skyMap->setOptimizationFlags(QGraphicsView::DontSavePainterState);
// skyMap->setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
// baseView->setParent(skyMap);
baseView->show();
}
......@@ -134,7 +135,7 @@ void WIView::loadDetailsView(SkyObjItem *soitem, int index)
QObject *posTextObj = m_DetailsViewObj->findChild<QObject *>("posTextObj");
QObject *descTextObj = m_DetailsViewObj->findChild<QObject *>("descTextObj");
QObject *magTextObj = m_DetailsViewObj->findChild<QObject *>("magTextObj");
sonameObj->setProperty("text", soitem->getName());
sonameObj->setProperty("text", soitem->getLongName());
posTextObj->setProperty("text", soitem->getPosition());
descTextObj->setProperty("text", soitem->getDesc());
magTextObj->setProperty("text", soitem->getMagnitude());
......
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