[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kstars-devel
Subject:    [Kstars-devel] A few bug fixes.
From:       "Akarsh Simha" <akarshsimha () gmail ! com>
Date:       2007-05-29 20:52:02
Message-ID: c00c02910705291340h512c9720kaa7b4763219bfcf3 () mail ! gmail ! com
[Download RAW message or body]

Hi all.

The attached patch provides the following fixes:
1. Constellation full names are shown in the popup menu and the
Details Dialog instead of the standard abbreviations.
2. Asteroids and asteroid labels are displayed as per the limiting
magnitude set in the Options dialog.

-- 
Regards,
     Akarsh

["fix.patch" (text/x-patch)]

Index: detaildialog.cpp
===================================================================
--- detaildialog.cpp	(revision 665714)
+++ detaildialog.cpp	(working copy)
@@ -247,6 +247,7 @@
 	}
 
 	//Common to all types:
+	
 	Data->Constellation->setText( ksw->data()->skyComposite()->constellation( \
selectedObject ) );  }
 
Index: kswizard.cpp
===================================================================
--- kswizard.cpp	(revision 665714)
+++ kswizard.cpp	(working copy)
@@ -152,7 +152,9 @@
 		if ( loc->fullName() == ksw->data()->geo()->fullName() ) {
 			index = ksw->data()->geoList.indexOf( loc );
 			Geo = loc;
+
 		}
+
 	}
 
 	//Sort alphabetically
Index: skycomponents/asteroidscomponent.cpp
===================================================================
--- skycomponents/asteroidscomponent.cpp	(revision 665714)
+++ skycomponents/asteroidscomponent.cpp	(working copy)
@@ -50,7 +50,7 @@
 
 	foreach ( SkyObject *o, objectList() ) { 
 		KSAsteroid *ast = (KSAsteroid*)o;
-		if ( ast->mag() > Options::magLimitAsteroid() ) break;
+		if ( ast->mag() > Options::magLimitAsteroid() ) continue;
 
 		if ( map->checkVisibility( ast ) )
 		{
@@ -75,6 +75,7 @@
 					psky.setPen( QColor( ks->data()->colorScheme()->colorNamed( "PNameColor" ) ) );
 					ast->drawNameLabel( psky, o.x(), o.y(), scale );
 				}
+
 			}
 		}
 	}
Index: skycomponents/skymapcomposite.cpp
===================================================================
--- skycomponents/skymapcomposite.cpp	(revision 665714)
+++ skycomponents/skymapcomposite.cpp	(working copy)
@@ -82,6 +82,7 @@
 
 	connect( this, SIGNAL( progressText( const QString & ) ), 
 					data, SIGNAL( progressText( const QString & ) ) );
+	
 }
 
 void SkyMapComposite::update(KStarsData *data, KSNumbers *num )
@@ -372,12 +373,52 @@
 
 QString SkyMapComposite::constellation( SkyPoint *p, QPolygonF *bound ) {
 	QString name = m_CBounds->constellation( p );
+	QString fullname;
+	
+	if(m_ConstellationNames.isEmpty()) {
+		foreach( SkyObject *p, m_CNames->objectList() ) {
+			m_ConstellationNames[ ( p->name2().upper() ) ] = (p->name().lower().replace( 0, \
1, p->name().at(0).upper())); +		}
+	}
 	if ( bound && name != i18n("Unknown") )
 		*bound = m_CBounds->boundary( name );
+	
+	fullname = m_ConstellationNames[ name.upper() ];
+	if( fullname != "" )
+		return fullname;
+	else
+		return name;
+}
 
-	return name;
+// The following two functions are deprecated and SkyMapComposite::constellation() \
does their job +/*
+SkyObject *SkyMapComposite::constellationobject( SkyPoint *p, QPolygonF *bound ) {
+	QString abbr = constellation( p, bound );
+
+	foreach( SkyObject *p, m_CNames->objectList() ) {
+			if( p->name2().upper() == abbr.upper() ) {
+				return p;
+			}
+	}
+
+	return NULL; 
 }
 
+QString SkyMapComposite::constellationformattedname( SkyPoint *p, QPolygonF *bound ) \
{ +	SkyObject *c;
+	QString cname;
+	c = constellationobject( p, bound );
+	if( c != NULL ) {
+		cname = c->name();
+		cname = cname.lower().replace( 0, 1, cname.at(0).upper());
+	}
+	else
+		cname = constellation( p, bound );
+	return cname;
+}
+*/	
+
+
 bool SkyMapComposite::inConstellation( const QString &name, SkyPoint *p ) {
 	return m_CBounds->inConstellation( name, p );
 }
Index: skycomponents/skymapcomposite.h
===================================================================
--- skycomponents/skymapcomposite.h	(revision 665714)
+++ skycomponents/skymapcomposite.h	(working copy)
@@ -191,6 +191,7 @@
 
 		QStringList m_ObjectNames;
 		QList<SkyObject*> m_LabeledObjects;
+		QHash<QString, QString> m_ConstellationNames;
 };
 
 #endif
Index: kspopupmenu.cpp
===================================================================
--- kspopupmenu.cpp	(revision 665714)
+++ kspopupmenu.cpp	(working copy)
@@ -146,7 +146,6 @@
 		aType->setDefaultWidget( labType );
 		addAction( aType );
 	}
-
 	labConstellation = new QLabel( "<b>"+ks->data()->skyComposite()->constellation( obj \
)+"</b>", this );  labConstellation->setAlignment( Qt::AlignHCenter | \
Qt::AlignVCenter );  aConstellation = new KAction( this );



_______________________________________________
Kstars-devel mailing list
Kstars-devel@kde.org
https://mail.kde.org/mailman/listinfo/kstars-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic