[Kstars-devel] KDE/kdeedu/kstars/kstars/skycomponents

Jason Harris kstars at 30doradus.org
Wed May 30 07:43:54 CEST 2007


SVN commit 669710 by harris:

Applying Akarsh's fixes for the following issues:

+ Asteroids were not being drawn due to a bug: a break was used where a 
continue was needed

+ Display the long version of a constellation's name, instead of the 
three-letter acronym, in the popup menu and details dialog.

I made a minor improvement to Akarsh's patch: two-word constellations 
will now have both words capitalized.

Congratulations on your first patch, Akarsh...may it be the first of 
many!

CCMAIL: kstars-devel at kde.org



 M  +1 -1      asteroidscomponent.cpp  
 M  +18 -1     skymapcomposite.cpp  
 M  +2 -1      skymapcomposite.h  


--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/asteroidscomponent.cpp #669709:669710
@@ -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 ) )
 		{
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skymapcomposite.cpp #669709:669710
@@ -382,10 +382,27 @@
 
 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() ) {
+			QString longname = p->name().lower().replace( 0, 1, p->name().at(0).upper());
+			if ( longname.contains( " " ) ) {
+				int i = longname.indexOf(" ")+1;
+				longname.replace( i, 1, longname.at(i).upper() );
+			}
+			m_ConstellationNames[ ( p->name2().upper() ) ] = longname;
+		}
+	}
+
 	if ( bound && name != i18n("Unknown") )
 		*bound = m_CBounds->boundary( name );
 
-	return name;
+	fullname = m_ConstellationNames[ name.upper() ];
+	if( ! fullname.isEmpty() )
+		return fullname;
+	else
+		return name;
 }
 
 bool SkyMapComposite::inConstellation( const QString &name, SkyPoint *p ) {
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skymapcomposite.h #669709:669710
@@ -190,8 +190,9 @@
 		StarComponent *m_Stars;
 		SatelliteComposite *m_Satellites;
 
+		QList<SkyObject*> m_LabeledObjects;
 		QHash<int, QStringList> m_ObjectNames;
-		QList<SkyObject*> m_LabeledObjects;
+		QHash<QString, QString> m_ConstellationNames;
 };
 
 #endif


More information about the Kstars-devel mailing list