LandscapeMgr.cpp   LandscapeMgr.cpp 
skipping to change at line 105 skipping to change at line 105
d[0] = sNorth; d[0] = sNorth;
d[1] = sSouth; d[1] = sSouth;
d[2] = sEast; d[2] = sEast;
d[3] = sWest; d[3] = sWest;
// fun polar special cases // fun polar special cases
if (latitude == 90.0 ) d[0] = d[1] = d[2] = d[3] = sSouth; if (latitude == 90.0 ) d[0] = d[1] = d[2] = d[3] = sSouth;
if (latitude == -90.0 ) d[0] = d[1] = d[2] = d[3] = sNorth; if (latitude == -90.0 ) d[0] = d[1] = d[2] = d[3] = sNorth;
sPainter.setColor(color[0],color[1],color[2],fader.getInterstate()); sPainter.setColor(color[0],color[1],color[2],fader.getInterstate());
glEnable(GL_BLEND); sPainter.setBlending(true);
sPainter.enableTexture2d(true);
// Normal transparency mode
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Vec3f pos; Vec3f pos;
Vec3f xy; Vec3f xy;
float shift = sPainter.getFontMetrics().width(sNorth)/2.; float shift = sPainter.getFontMetrics().width(sNorth)/2.;
if (core->getProjection(StelCore::FrameJ2000)->getMaskType() == Stel Projector::MaskDisk) if (core->getProjection(StelCore::FrameJ2000)->getMaskType() == Stel Projector::MaskDisk)
shift = 0; shift = 0;
// N for North // N for North
pos.set(-1.f, 0.f, 0.f); pos.set(-1.f, 0.f, 0.f);
skipping to change at line 146 skipping to change at line 143
void Cardinals::updateI18n() void Cardinals::updateI18n()
{ {
const StelTranslator& trans = StelApp::getInstance().getLocaleMgr(). getAppStelTranslator(); const StelTranslator& trans = StelApp::getInstance().getLocaleMgr(). getAppStelTranslator();
sNorth = trans.qtranslate("N"); sNorth = trans.qtranslate("N");
sSouth = trans.qtranslate("S"); sSouth = trans.qtranslate("S");
sEast = trans.qtranslate("E"); sEast = trans.qtranslate("E");
sWest = trans.qtranslate("W"); sWest = trans.qtranslate("W");
} }
LandscapeMgr::LandscapeMgr() LandscapeMgr::LandscapeMgr()
: atmosphere(NULL) : StelModule()
, atmosphere(NULL)
, cardinalsPoints(NULL) , cardinalsPoints(NULL)
, landscape(NULL) , landscape(NULL)
, oldLandscape(NULL) , oldLandscape(NULL)
, flagLandscapeSetsLocation(false) , flagLandscapeSetsLocation(false)
, flagLandscapeAutoSelection(false) , flagLandscapeAutoSelection(false)
, flagLightPollutionFromDatabase(false) , flagLightPollutionFromDatabase(false)
, flagLandscapeUseMinimalBrightness(false) , flagLandscapeUseMinimalBrightness(false)
, defaultMinimalBrightness(0.01) , defaultMinimalBrightness(0.01)
, flagLandscapeSetsMinimalBrightness(false) , flagLandscapeSetsMinimalBrightness(false)
, flagAtmosphereAutoEnabling(false) , flagAtmosphereAutoEnabling(false)
{ {
setObjectName("LandscapeMgr"); setObjectName("LandscapeMgr"); // should be done by StelModule's con structor.
//Note: The first entry in the list is used as the default 'default landscape' in removeLandscape(). //Note: The first entry in the list is used as the default 'default landscape' in removeLandscape().
packagedLandscapeIDs = (QStringList() << "guereins"); packagedLandscapeIDs = (QStringList() << "guereins");
QDirIterator directories(StelFileMgr::getInstallationDir()+"/landsca pes/", QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot, QDirIterator:: Subdirectories); QDirIterator directories(StelFileMgr::getInstallationDir()+"/landsca pes/", QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot, QDirIterator:: Subdirectories);
while(directories.hasNext()) while(directories.hasNext())
{ {
directories.next(); directories.next();
packagedLandscapeIDs << directories.fileName(); packagedLandscapeIDs << directories.fileName();
} }
packagedLandscapeIDs.removeDuplicates(); packagedLandscapeIDs.removeDuplicates();
landscapeCache.clear();
} }
LandscapeMgr::~LandscapeMgr() LandscapeMgr::~LandscapeMgr()
{ {
delete atmosphere; delete atmosphere;
delete cardinalsPoints; delete cardinalsPoints;
if (oldLandscape) if (oldLandscape)
{ {
delete oldLandscape; delete oldLandscape;
oldLandscape=NULL; oldLandscape=NULL;
} }
delete landscape; delete landscape;
landscape = NULL; landscape = NULL;
qDebug() << "LandscapeMgr: Clearing cache of" << landscapeCache.size
() << "landscapes totalling about " << landscapeCache.totalCost() << "MB.";
landscapeCache.clear(); // deletes all objects within.
} }
/************************************************************************* /*************************************************************************
Reimplementation of the getCallOrder method Reimplementation of the getCallOrder method
*************************************************************************/ *************************************************************************/
double LandscapeMgr::getCallOrder(StelModuleActionName actionName) const double LandscapeMgr::getCallOrder(StelModuleActionName actionName) const
{ {
if (actionName==StelModule::ActionDraw) if (actionName==StelModule::ActionDraw)
return StelApp::getInstance().getModuleMgr().getModule("Spor adicMeteorMgr")->getCallOrder(actionName)+20; return StelApp::getInstance().getModuleMgr().getModule("Spor adicMeteorMgr")->getCallOrder(actionName)+20;
if (actionName==StelModule::ActionUpdate) if (actionName==StelModule::ActionUpdate)
return StelApp::getInstance().getModuleMgr().getModule("Sola rSystem")->getCallOrder(actionName)+10; return StelApp::getInstance().getModuleMgr().getModule("Sola rSystem")->getCallOrder(actionName)+10;
// GZ The next 2 lines are only required to test landscape transpare ncy. They should be commented away for releases. // GZ The next 2 lines are only required to test landscape transpare ncy. They should be commented away for releases.
if (actionName==StelModule::ActionHandleMouseClicks) if (actionName==StelModule::ActionHandleMouseClicks)
return StelApp::getInstance().getModuleMgr().getModule("Stel MovementMgr")->getCallOrder(actionName)-1; return StelApp::getInstance().getModuleMgr().getModule("Stel MovementMgr")->getCallOrder(actionName)-1;
return 0; return 0;
} }
void LandscapeMgr::update(double deltaTime) void LandscapeMgr::update(double deltaTime)
{ {
atmosphere->update(deltaTime); atmosphere->update(deltaTime);
if (oldLandscape) if (oldLandscape)
{ {
// This is only when transitioning to newly loaded landscape . We must draw the old one until the new one is faded in completely. // This is only when transitioning to newly loaded landscape . We must draw the old one until the new one is faded in completely.
oldLandscape->update(deltaTime); oldLandscape->update(deltaTime);
if (getIsLandscapeFullyVisible()) if (getIsLandscapeFullyVisible())
{ {
oldLandscape->setFlagShow(false); oldLandscape->setFlagShow(false);
if (oldLandscape->getEffectiveLandFadeValue()< 0.01f ) if (oldLandscape->getEffectiveLandFadeValue()< 0.01f )
{ {
delete oldLandscape; // new logic: try to put old landscape to ca
che.
//qDebug() << "LandscapeMgr::update: moving
oldLandscape " << oldLandscape->getId() << "to Cache. Cost:" << oldLandscap
e->getMemorySize()/(1024*1024)+1;
landscapeCache.insert(oldLandscape->getId(),
oldLandscape, oldLandscape->getMemorySize()/(1024*1024)+1);
//qDebug() << "--> LandscapeMgr::update(): c
ache now contains " << landscapeCache.size() << "landscapes totalling about
" << landscapeCache.totalCost() << "MB.";
oldLandscape=NULL; oldLandscape=NULL;
} }
} }
} }
landscape->update(deltaTime); landscape->update(deltaTime);
cardinalsPoints->update(deltaTime); cardinalsPoints->update(deltaTime);
// Compute the atmosphere color and intensity // Compute the atmosphere color and intensity
// Compute the sun position in local coordinate // Compute the sun position in local coordinate
SolarSystem* ssystem = (SolarSystem*)StelApp::getInstance().getModul eMgr().getModule("SolarSystem"); SolarSystem* ssystem = (SolarSystem*)StelApp::getInstance().getModul eMgr().getModule("SolarSystem");
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
Vec3d sunPos = ssystem->getSun()->getAltAzPosApparent(core); Vec3d sunPos = ssystem->getSun()->getAltAzPosAuto(core);
// Compute the moon position in local coordinate // Compute the moon position in local coordinate
Vec3d moonPos = ssystem->getMoon()->getAltAzPosApparent(core); Vec3d moonPos = ssystem->getMoon()->getAltAzPosAuto(core);
float lunarPhaseAngle=ssystem->getMoon()->getPhaseAngle(ssystem->get
Earth()->getHeliocentricEclipticPos());
// LP:1673283 no lunar brightening if not on Earth!
if (core->getCurrentLocation().planetName != "Earth")
{
moonPos=sunPos;
lunarPhaseAngle=0.0f;
}
// GZ: First parameter in next call is used for particularly earth-b ound computations in Schaefer's sky brightness model. Difference DeltaT mak es no difference here. // GZ: First parameter in next call is used for particularly earth-b ound computations in Schaefer's sky brightness model. Difference DeltaT mak es no difference here.
atmosphere->computeColor(core->getJDE(), sunPos, moonPos, atmosphere->computeColor(core->getJDE(), sunPos, moonPos, lunarPhase
ssystem->getMoon()->getPhaseAngle(ssystem->getEarth()->getHe Angle,
liocentricEclipticPos()),
core, core->getCurrentLocation().latitude, core->getCurrentL ocation().altitude, core, core->getCurrentLocation().latitude, core->getCurrentL ocation().altitude,
15.f, 40.f); // Temperature = 15c, relative humidity = 40 % 15.f, 40.f); // Temperature = 15c, relative humidity = 40 %
core->getSkyDrawer()->reportLuminanceInFov(3.75+atmosphere->getAvera geLuminance()*3.5, true); core->getSkyDrawer()->reportLuminanceInFov(3.75+atmosphere->getAvera geLuminance()*3.5, true);
// NOTE: Simple workaround for brightness of landscape when observin g from the Sun. // NOTE: Simple workaround for brightness of landscape when observin g from the Sun.
if (core->getCurrentLocation().planetName.contains("Sun")) if (core->getCurrentLocation().planetName == "Sun")
{ {
landscape->setBrightness(1.0f, 1.0f); landscape->setBrightness(1.0f, 1.0f);
return; return;
} }
// Compute the ground luminance based on every planets around // Compute the ground luminance based on every planets around
// TBD: Reactivate and verify this code!? Source, reference? // TBD: Reactivate and verify this code!? Source, reference?
// float groundLuminance = 0; // float groundLuminance = 0;
// const vector<Planet*>& allPlanets = ssystem->getAllPlanets(); // const vector<Planet*>& allPlanets = ssystem->getAllPlanets();
// for (vector<Planet*>::const_iterator i=allPlanets.begin();i!=allPlan ets.end();++i) // for (vector<Planet*>::const_iterator i=allPlanets.begin();i!=allPlan ets.end();++i)
skipping to change at line 370 skipping to change at line 381
// Draw the cardinal points // Draw the cardinal points
cardinalsPoints->draw(core, StelApp::getInstance().getCore()->getCur rentLocation().latitude); cardinalsPoints->draw(core, StelApp::getInstance().getCore()->getCur rentLocation().latitude);
} }
void LandscapeMgr::init() void LandscapeMgr::init()
{ {
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
landscapeCache.setMaxCost(conf->value("landscape/cache_size_mb", 100
).toInt());
qDebug() << "LandscapeMgr: initialized Cache for" << landscapeCache.
maxCost() << "MB.";
atmosphere = new Atmosphere(); atmosphere = new Atmosphere();
landscape = new LandscapeOldStyle();
defaultLandscapeID = conf->value("init_location/landscape_name").toS tring(); defaultLandscapeID = conf->value("init_location/landscape_name").toS tring();
setCurrentLandscapeID(defaultLandscapeID); setCurrentLandscapeID(defaultLandscapeID);
setFlagLandscape(conf->value("landscape/flag_landscape", conf->value ("landscape/flag_ground", true).toBool()).toBool()); setFlagLandscape(conf->value("landscape/flag_landscape", conf->value ("landscape/flag_ground", true).toBool()).toBool());
setFlagFog(conf->value("landscape/flag_fog",true).toBool()); setFlagFog(conf->value("landscape/flag_fog",true).toBool());
setFlagAtmosphere(conf->value("landscape/flag_atmosphere", true).toB ool()); setFlagAtmosphere(conf->value("landscape/flag_atmosphere", true).toB ool());
setAtmosphereFadeDuration(conf->value("landscape/atmosphere_fade_dur ation",0.5).toFloat()); setAtmosphereFadeDuration(conf->value("landscape/atmosphere_fade_dur ation",0.5).toFloat());
setAtmosphereLightPollutionLuminance(conf->value("viewing/light_poll ution_luminance",0.0).toFloat()); setAtmosphereLightPollutionLuminance(conf->value("viewing/light_poll ution_luminance",0.0).toFloat());
setFlagUseLightPollutionFromDatabase(conf->value("viewing/flag_light _pollution_database", false).toBool()); setFlagUseLightPollutionFromDatabase(conf->value("viewing/flag_light _pollution_database", false).toBool());
cardinalsPoints = new Cardinals(); cardinalsPoints = new Cardinals();
cardinalsPoints->setFlagShow(conf->value("viewing/flag_cardinal_poin ts",true).toBool()); cardinalsPoints->setFlagShow(conf->value("viewing/flag_cardinal_poin ts",true).toBool());
skipping to change at line 411 skipping to change at line 424
connect(drawer, SIGNAL(bortleScaleIndexChanged(int)), this, SLOT(set AtmosphereBortleLightPollution(int))); connect(drawer, SIGNAL(bortleScaleIndexChanged(int)), this, SLOT(set AtmosphereBortleLightPollution(int)));
connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n())); connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n()));
QString displayGroup = N_("Display Options"); QString displayGroup = N_("Display Options");
addAction("actionShow_Atmosphere", displayGroup, N_("Atmosphere"), " atmosphereDisplayed", "A"); addAction("actionShow_Atmosphere", displayGroup, N_("Atmosphere"), " atmosphereDisplayed", "A");
addAction("actionShow_Fog", displayGroup, N_("Fog"), "fogDisplayed", "F"); addAction("actionShow_Fog", displayGroup, N_("Fog"), "fogDisplayed", "F");
addAction("actionShow_Cardinal_Points", displayGroup, N_("Cardinal p oints"), "cardinalsPointsDisplayed", "Q"); addAction("actionShow_Cardinal_Points", displayGroup, N_("Cardinal p oints"), "cardinalsPointsDisplayed", "Q");
addAction("actionShow_Ground", displayGroup, N_("Ground"), "landscap eDisplayed", "G"); addAction("actionShow_Ground", displayGroup, N_("Ground"), "landscap eDisplayed", "G");
addAction("actionShow_LandscapeIllumination", displayGroup, N_("Land scape illumination"), "illuminationDisplayed", "Shift+G"); addAction("actionShow_LandscapeIllumination", displayGroup, N_("Land scape illumination"), "illuminationDisplayed", "Shift+G");
addAction("actionShow_LandscapeLabels", displayGroup, N_("Landscape labels"), "labelsDisplayed", "Ctrl+Shift+G"); addAction("actionShow_LandscapeLabels", displayGroup, N_("Landscape labels"), "labelsDisplayed", "Ctrl+Shift+G");
addAction("actionShow_LightPollution_Database", displayGroup, N_("Li ght pollution data from locations database"), "databaseUsage"); addAction("actionShow_LightPollutionFromDatabase", displayGroup, N_( "Light pollution data from locations database"), "flagUseLightPollutionFrom Database");
} }
bool LandscapeMgr::setCurrentLandscapeID(const QString& id, const double ch angeLocationDuration) bool LandscapeMgr::setCurrentLandscapeID(const QString& id, const double ch angeLocationDuration)
{ {
if (id.isEmpty()) if (id.isEmpty())
return false; return false;
//prevent unnecessary changes/file access //prevent unnecessary changes/file access
if(id==currentLandscapeID) if(id==currentLandscapeID)
return false; return false;
// We want to lookup the landscape ID (dir) from the name. Landscape* newLandscape;
Landscape* newLandscape = createFromFile(StelFileMgr::findFile("land
scapes/" + id + "/landscape.ini"), id);
if (!newLandscape) // There is a slight chance that we switch back to oldLandscape whil
e oldLandscape is still fading away.
// in this case it is not yet stored in cache, but obviously availab
le. So we just swap places.
if (oldLandscape && oldLandscape->getId()==id)
{ {
qWarning() << "ERROR while loading landscape " << "landscape newLandscape=oldLandscape;
s/" + id + "/landscape.ini"; }
return false; else
{
// We want to lookup the landscape ID (dir) from the name.
newLandscape= landscapeCache.take(id);
if (newLandscape)
{
#ifndef NDEBUG
qDebug() << "LandscapeMgr::setCurrentLandscapeID()::
taken " << id << "from cache...";
qDebug() << ".-->LandscapeMgr::setCurrentLandscapeID
(): cache contains " << landscapeCache.size() << "landscapes totalling abou
t " << landscapeCache.totalCost() << "MB.";
#endif
}
else
{
#ifndef NDEBUG
qDebug() << "LandscapeMgr::setCurrentLandscapeID: Lo
ading from file:" << id ;
#endif
newLandscape = createFromFile(StelFileMgr::findFile(
"landscapes/" + id + "/landscape.ini"), id);
}
if (!newLandscape)
{
qWarning() << "ERROR while loading landscape " << "l
andscapes/" + id + "/landscape.ini";
return false;
}
} }
// Keep current landscape for a while, while new landscape fades in! // Keep current landscape for a while, while new landscape fades in!
// This prevents subhorizon sun or grid becoming briefly visible. // This prevents subhorizon sun or grid becoming briefly visible.
if (landscape) if (landscape)
{ {
// Copy display parameters from previous landscape to new on e // Copy display parameters from previous landscape to new on e
newLandscape->setFlagShow(landscape->getFlagShow()); newLandscape->setFlagShow(landscape->getFlagShow());
newLandscape->setFlagShowFog(landscape->getFlagShowFog()); newLandscape->setFlagShowFog(landscape->getFlagShowFog());
newLandscape->setFlagShowIllumination(landscape->getFlagShow Illumination()); newLandscape->setFlagShowIllumination(landscape->getFlagShow Illumination());
newLandscape->setFlagShowLabels(landscape->getFlagShowLabels ()); newLandscape->setFlagShowLabels(landscape->getFlagShowLabels ());
//in case we already fade out one old landscape (if switchin
g too rapidly): the old one has to go immediately. // If we have an oldLandscape that is not just swapped back,
if (oldLandscape) put that into cache.
delete oldLandscape; if (oldLandscape && oldLandscape!=newLandscape)
{
#ifndef NDEBUG
qDebug() << "LandscapeMgr::setCurrent: moving oldLan
dscape " << oldLandscape->getId() << "to Cache. Cost:" << oldLandscape->get
MemorySize()/(1024*1024)+1;
#endif
landscapeCache.insert(oldLandscape->getId(), oldLand
scape, oldLandscape->getMemorySize()/(1024*1024)+1);
#ifndef NDEBUG
qDebug() << "-->LandscapeMgr::setCurrentLandscapeId(
): cache contains " << landscapeCache.size() << "landscapes totalling about
" << landscapeCache.totalCost() << "MB.";
#endif
}
oldLandscape = landscape; // keep old while transitioning! oldLandscape = landscape; // keep old while transitioning!
} }
landscape=newLandscape; landscape=newLandscape;
currentLandscapeID = id; currentLandscapeID = id;
if (getFlagLandscapeSetsLocation() && landscape->hasLocation()) if (getFlagLandscapeSetsLocation() && landscape->hasLocation())
{ {
StelCore *core = StelApp::getInstance().getCore(); StelCore *core = StelApp::getInstance().getCore();
core->moveObserverTo(landscape->getLocation(), changeLocatio nDuration); core->moveObserverTo(landscape->getLocation(), changeLocatio nDuration);
StelSkyDrawer* drawer=core->getSkyDrawer(); StelSkyDrawer* drawer=core->getSkyDrawer();
skipping to change at line 509 skipping to change at line 557
{ {
return setCurrentLandscapeID(nameToDirMap[name], changeLocat ionDuration); return setCurrentLandscapeID(nameToDirMap[name], changeLocat ionDuration);
} }
else else
{ {
qWarning() << "Can't find a landscape with name=" << name << endl; qWarning() << "Can't find a landscape with name=" << name << endl;
return false; return false;
} }
} }
// Load a landscape into cache.
// @param id the ID of a landscape
// @param replace true if existing landscape entry should be replaced (usef
ul during development to reload after edit)
// @return false if landscape could not be found, or existed already and re
place was false.
bool LandscapeMgr::precacheLandscape(const QString& id, const bool replace)
{
if (landscapeCache.contains(id) && (!replace))
return false;
Landscape* newLandscape = createFromFile(StelFileMgr::findFile("land
scapes/" + id + "/landscape.ini"), id);
if (!newLandscape)
{
qWarning() << "ERROR while preloading landscape " << "landsc
apes/" + id + "/landscape.ini";
return false;
}
bool res=landscapeCache.insert(id, newLandscape, newLandscape->getMe
morySize()/(1024*1024)+1);
#ifndef NDEBUG
if (res)
{
qDebug() << "LandscapeMgr::precacheLandscape(): Successfully
added landscape with ID " << id << "to cache";
}
qDebug() << "LandscapeMgr::precacheLandscape(): cache contains " <<
landscapeCache.size() << "landscapes totalling about " << landscapeCache.to
talCost() << "MB.";
#endif
return res;
}
// Remove a landscape from the cache of loaded landscapes.
// @param id the ID of a landscape
// @return false if landscape could not be found
bool LandscapeMgr::removeCachedLandscape(const QString& id)
{
bool res= landscapeCache.remove(id);
#ifndef NDEBUG
qDebug() << "LandscapeMgr::removeCachedLandscape(): cache contains "
<< landscapeCache.size() << "landscapes totalling about " << landscapeCach
e.totalCost() << "MB.";
#endif
return res;
}
// Change the default landscape to the landscape with the ID specified. // Change the default landscape to the landscape with the ID specified.
bool LandscapeMgr::setDefaultLandscapeID(const QString& id) bool LandscapeMgr::setDefaultLandscapeID(const QString& id)
{ {
if (id.isEmpty()) if (id.isEmpty())
return false; return false;
defaultLandscapeID = id; defaultLandscapeID = id;
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
conf->setValue("init_location/landscape_name", id); conf->setValue("init_location/landscape_name", id);
emit defaultLandscapeChanged(id); emit defaultLandscapeChanged(id);
return true; return true;
skipping to change at line 573 skipping to change at line 660
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
//this was previously logic in ViewDialog, but should really be on a non-GUI layer //this was previously logic in ViewDialog, but should really be on a non-GUI layer
if (usage) if (usage)
{ {
StelLocation loc = core->getCurrentLocation(); StelLocation loc = core->getCurrentLocation();
updateLocationBasedPollution(loc); updateLocationBasedPollution(loc);
} }
emit lightPollutionUsageChanged(usage); emit flagUseLightPollutionFromDatabaseChanged(usage);
} }
} }
void LandscapeMgr::updateLocationBasedPollution(StelLocation loc) void LandscapeMgr::updateLocationBasedPollution(StelLocation loc)
{ {
if(flagLightPollutionFromDatabase) if(flagLightPollutionFromDatabase)
{ {
//this was previously logic in ViewDialog, but should really be on a non-GUI layer //this was previously logic in ViewDialog, but should really be on a non-GUI layer
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
int bIdx = loc.bortleScaleIndex; int bIdx = loc.bortleScaleIndex;
skipping to change at line 878 skipping to change at line 965
Q_ASSERT(0); Q_ASSERT(0);
return "error"; return "error";
} }
else else
{ {
return nameToDirMap[name]; return nameToDirMap[name];
} }
} }
/************************************************************************** ** /************************************************************************** **
get a map of landscape name (from landscape.ini name field) to ID (dir nam e) get a map of landscape names (from landscape.ini name field) to ID (dir na me)
************************************************************************** **/ ************************************************************************** **/
QMap<QString,QString> LandscapeMgr::getNameToDirMap() const QMap<QString,QString> LandscapeMgr::getNameToDirMap() const
{ {
QMap<QString,QString> result; QMap<QString,QString> result;
QSet<QString> landscapeDirs = StelFileMgr::listContents("landscapes" ,StelFileMgr::Directory); QSet<QString> landscapeDirs = StelFileMgr::listContents("landscapes" ,StelFileMgr::Directory);
foreach (const QString& dir, landscapeDirs) foreach (const QString& dir, landscapeDirs)
{ {
QString fName = StelFileMgr::findFile("landscapes/" + dir + "/landscape.ini"); QString fName = StelFileMgr::findFile("landscapes/" + dir + "/landscape.ini");
if (!fName.isEmpty()) if (!fName.isEmpty())
 End of changes. 21 change blocks. 
28 lines changed or deleted 146 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/