changes according to code review.

This commit is contained in:
rachytski 2012-10-14 22:07:20 +03:00 committed by Alex Zolotarev
parent 7cae7216cf
commit 0375ea5bdc
5 changed files with 15 additions and 12 deletions

View file

@ -8,7 +8,7 @@ extern "C"
Java_com_mapswithme_maps_LocationState_getCompassProcessMode(JNIEnv * env, jobject thiz)
{
shared_ptr<location::State> ls = g_framework->NativeFramework()->GetInformationDisplay().locationState();
return ls->CompassProcessMode();
return ls->GetCompassProcessMode();
}
JNIEXPORT void JNICALL
@ -22,7 +22,7 @@ extern "C"
Java_com_mapswithme_maps_LocationState_getLocationProcessMode(JNIEnv * env, jobject thiz)
{
shared_ptr<location::State> ls = g_framework->NativeFramework()->GetInformationDisplay().locationState();
return ls->LocationProcessMode();
return ls->GetLocationProcessMode();
}
JNIEXPORT void JNICALL

View file

@ -726,6 +726,8 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
@Override
protected void onResume()
{
/// all actions to restore the current state of the location mark
/// are taken in OnRenderingInitialized.
startWatchingCompassStatusUpdate();
startWatchingExternalStorage();

View file

@ -924,8 +924,8 @@ void Framework::StartDrag(DragEvent const & e)
m_renderPolicy->StartDrag();
shared_ptr<location::State> locationState = m_informationDisplay.locationState();
m_dragCompassProcessMode = locationState->CompassProcessMode();
m_dragLocationProcessMode = locationState->LocationProcessMode();
m_dragCompassProcessMode = locationState->GetCompassProcessMode();
m_dragLocationProcessMode = locationState->GetLocationProcessMode();
}
void Framework::DoDrag(DragEvent const & e)
@ -1019,7 +1019,8 @@ void Framework::Move(double azDir, double factor)
//@{
void Framework::ScaleToPoint(ScaleToPointEvent const & e)
{
m2::PointD const pt = (m_informationDisplay.locationState()->LocationProcessMode() == location::ELocationDoNothing) ?
shared_ptr<location::State> locationState = m_informationDisplay.locationState();
m2::PointD const pt = (locationState->GetLocationProcessMode() == location::ELocationDoNothing) ?
m_navigator.ShiftPoint(e.Pt()) : GetPixelCenter();
m_navigator.ScaleToPoint(pt, e.ScaleFactor(), ElapsedSeconds());
@ -1047,7 +1048,7 @@ void Framework::CalcScalePoints(ScaleEvent const & e, m2::PointD & pt1, m2::Poin
shared_ptr<location::State> locationState = m_informationDisplay.locationState();
if (locationState->HasPosition()
&& (locationState->LocationProcessMode() == location::ELocationCenterOnly))
&& (locationState->GetLocationProcessMode() == location::ELocationCenterOnly))
{
m2::PointD const ptC = (pt1 + pt2) / 2;
m2::PointD const ptDiff = GetPixelCenter() - ptC;
@ -1083,7 +1084,7 @@ void Framework::DoScale(ScaleEvent const & e)
shared_ptr<location::State> locationState = m_informationDisplay.locationState();
if (m_navigator.IsRotatingDuringScale()
&& (locationState->CompassProcessMode() == location::ECompassFollow))
&& (locationState->GetCompassProcessMode() == location::ECompassFollow))
locationState->StopCompassFollowing();
}

View file

@ -91,7 +91,7 @@ namespace location
invalidate();
}
ELocationProcessMode State::LocationProcessMode() const
ELocationProcessMode State::GetLocationProcessMode() const
{
return m_locationProcessMode;
}
@ -101,7 +101,7 @@ namespace location
m_locationProcessMode = mode;
}
ECompassProcessMode State::CompassProcessMode() const
ECompassProcessMode State::GetCompassProcessMode() const
{
return m_compassProcessMode;
}
@ -471,7 +471,7 @@ namespace location
void State::CheckCompassFollowing()
{
if (m_hasCompass
&& (CompassProcessMode() == ECompassFollow)
&& (GetCompassProcessMode() == ECompassFollow)
&& IsCentered())
FollowCompass();
}

View file

@ -135,10 +135,10 @@ namespace location
bool HasCompass() const;
bool IsFirstPosition() const;
ELocationProcessMode LocationProcessMode() const;
ELocationProcessMode GetLocationProcessMode() const;
void SetLocationProcessMode(ELocationProcessMode mode);
ECompassProcessMode CompassProcessMode() const;
ECompassProcessMode GetCompassProcessMode() const;
void SetCompassProcessMode(ECompassProcessMode mode);
void TurnOff();