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

Jason Harris kstars at 30doradus.org
Sun Feb 18 21:53:41 CET 2007


SVN commit 634936 by harris:

Restore ability to change the projectin system used to render the map.
Apparently at some point, the internal names used for actions by 
KActionCollection stopped being available as the objectName() of the 
action.  So my use of "sender()->objectName()" in slotMapProjection() 
stopped working.  

I'm now comparing the sender() object itself to 
actionCollection()->action("action_name")

CCMAIL: kstars-devel at kde.org



 M  +6 -8      kstarsactions.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/kstarsactions.cpp #634935:634936
@@ -832,19 +832,17 @@
 }
 
 void KStars::slotMapProjection() {
-	QString aname = sender()->objectName();
-
-	if ( aname == "project_lambert" )
+	if ( sender() == actionCollection()->action("project_lambert") )
 		Options::setProjection( SkyMap::Lambert );
-	if ( aname == "project_azequidistant" )
+	if ( sender() == actionCollection()->action("project_azequidistant") )
 		Options::setProjection( SkyMap::AzimuthalEquidistant );
-	if ( aname == "project_orthographic" )
+	if ( sender() == actionCollection()->action("project_orthographic") )
 		Options::setProjection( SkyMap::Orthographic );
-	if ( aname == "project_equirectangular" )
+	if ( sender() == actionCollection()->action("project_equirectangular") )
 		Options::setProjection( SkyMap::Equirectangular );
-	if ( aname == "project_stereographic" )
+	if ( sender() == actionCollection()->action("project_stereographic") )
 		Options::setProjection( SkyMap::Stereographic );
-	if ( aname == "project_gnomonic" )
+	if ( sender() == actionCollection()->action("project_gnomonic") )
 		Options::setProjection( SkyMap::Gnomonic );
 
 	//DEBUG


More information about the Kstars-devel mailing list