[Kstars-devel] branches/kstars/unfrozen/kstars/kstars
Jason Harris
kstars at 30doradus.org
Tue Jul 1 19:45:08 CEST 2008
SVN commit 826868 by harris:
Fix the enum issue. I now always give the enum value scope by
prefixing the classname in which it is defined (e.g.,
KSPlanetBase::MOON). Note that I had already been doing this for the
SkyObject::TYPE enum values. so some part of my brain knew this might
be an issue!
CCMAIL: kstars-devel at kde.org
M +10 -10 ksplanetbase.cpp
M +2 -2 ksplanetbase.h
M +11 -11 tools/conjunctions.cpp
--- branches/kstars/unfrozen/kstars/kstars/ksplanetbase.cpp #826867:826868
@@ -61,23 +61,23 @@
KStarsData *kd = KStarsData::Instance();
switch ( n ) {
- case MERCURY:
- case VENUS:
- case MARS:
- case JUPITER:
- case SATURN:
- case URANUS:
- case NEPTUNE:
+ case KSPlanetBase::MERCURY:
+ case KSPlanetBase::VENUS:
+ case KSPlanetBase::MARS:
+ case KSPlanetBase::JUPITER:
+ case KSPlanetBase::SATURN:
+ case KSPlanetBase::URANUS:
+ case KSPlanetBase::NEPTUNE:
return new KSPlanet( kd, n );
break;
- case PLUTO:
+ case KSPlanetBase::PLUTO:
return new KSPluto(kd);
break;
- case SUN:
+ case KSPlanetBase::SUN:
return new KSSun(kd);
break;
- case MOON:
+ case KSPlanetBase::MOON:
return new KSMoon(kd);
break;
}
--- branches/kstars/unfrozen/kstars/kstars/ksplanetbase.h #826867:826868
@@ -28,8 +28,6 @@
#include "trailobject.h"
-typedef enum { MERCURY=0, VENUS=1, MARS=2, JUPITER=3, SATURN=4, URANUS=5, NEPTUNE=6, PLUTO=7, SUN=8, MOON=9, UNKNOWN_PLANET } PLANET;
-
class QPoint;
class KSNumbers;
class KSPopupMenu;
@@ -95,6 +93,8 @@
void init(const QString &s, const QString &image_file, const QColor &c, double pSize );
+ enum { MERCURY=0, VENUS=1, MARS=2, JUPITER=3, SATURN=4, URANUS=5, NEPTUNE=6, PLUTO=7, SUN=8, MOON=9, UNKNOWN_PLANET };
+
static KSPlanetBase* createPlanet( int n );
virtual bool loadData() {
--- branches/kstars/unfrozen/kstars/kstars/tools/conjunctions.cpp #826867:826868
@@ -67,18 +67,18 @@
LocationButton -> setText( geoPlace -> fullName() );
QHash<int, QString> pNames;
- pNames[MERCURY] = i18n("Mercury");
- pNames[VENUS] = i18n("Venus");
- pNames[MARS] = i18n("Mars");
- pNames[JUPITER] = i18n("Jupiter");
- pNames[SATURN] = i18n("Saturn");
- pNames[URANUS] = i18n("Uranus");
- pNames[NEPTUNE] = i18n("Neptune");
- pNames[PLUTO] = i18n("Pluto");
- pNames[SUN] = i18n("Sun");
- pNames[MOON] = i18n("Moon");
+ pNames[KSPlanetBase::MERCURY] = i18n("Mercury");
+ pNames[KSPlanetBase::VENUS] = i18n("Venus");
+ pNames[KSPlanetBase::MARS] = i18n("Mars");
+ pNames[KSPlanetBase::JUPITER] = i18n("Jupiter");
+ pNames[KSPlanetBase::SATURN] = i18n("Saturn");
+ pNames[KSPlanetBase::URANUS] = i18n("Uranus");
+ pNames[KSPlanetBase::NEPTUNE] = i18n("Neptune");
+ pNames[KSPlanetBase::PLUTO] = i18n("Pluto");
+ pNames[KSPlanetBase::SUN] = i18n("Sun");
+ pNames[KSPlanetBase::MOON] = i18n("Moon");
- for ( int i=0; i<UNKNOWN_PLANET; ++i ) {
+ for ( int i=0; i<KSPlanetBase::UNKNOWN_PLANET; ++i ) {
Obj1ComboBox->insertItem( i, pNames[i] );
Obj2ComboBox->insertItem( i, pNames[i] );
}
More information about the Kstars-devel
mailing list