StelMainScriptAPI.cpp   StelMainScriptAPI.cpp 
skipping to change at line 165 skipping to change at line 165
if (ssmgr->searchByName(planet)) if (ssmgr->searchByName(planet))
loc.planetName = planet; loc.planetName = planet;
loc.name = name; loc.name = name;
nav->moveObserverTo(loc, duration); nav->moveObserverTo(loc, duration);
} }
void StelMainScriptAPI::setObserverLocation(const QString id, float duratio n) void StelMainScriptAPI::setObserverLocation(const QString id, float duratio n)
{ {
StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( ); StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( );
Q_ASSERT(nav); Q_ASSERT(nav);
StelLocation loc = StelApp::getInstance().getLocationMgr().locationF bool ok;
orSmallString(id); StelLocation loc = StelApp::getInstance().getLocationMgr().locationF
// How best to test to see if the lookup of the name was a success? orSmallString(id, &ok);
// On failure, it returns Paris, but maybe we _want_ Paris. if (!ok)
// Ugly. -MNG return; // location find failed
if (id!="Paris, France" && (loc.name=="Paris" && loc.country=="Franc
e"))
return; // location find fail
nav->moveObserverTo(loc, duration); nav->moveObserverTo(loc, duration);
} }
QString StelMainScriptAPI::getObserverLocation() QString StelMainScriptAPI::getObserverLocation()
{ {
return StelApp::getInstance().getCore()->getNavigator()->getCurrentL ocation().getID(); return StelApp::getInstance().getCore()->getNavigator()->getCurrentL ocation().getID();
} }
void StelMainScriptAPI::screenshot(const QString& prefix, bool invert, cons t QString& dir) void StelMainScriptAPI::screenshot(const QString& prefix, bool invert, cons t QString& dir)
{ {
 End of changes. 1 change blocks. 
9 lines changed or deleted 5 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/