[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [marble] src/lib: Enforce empty box check directly in MarbleWidget.
From: Dennis_Nienhüser <earthwings () gentoo ! org>
Date: 2013-10-20 6:57:11
Message-ID: E1VXmwp-0007qr-5f () scm ! kde ! org
[Download RAW message or body]
Git commit b5acbb903653fbffc33cc2a07236f5ca3743e651 by Dennis Nienhüser.
Committed on 20/10/2013 at 06:54.
Pushed by nienhueser into branch 'master'.
Enforce empty box check directly in MarbleWidget.
M +4 -0 src/lib/MarbleWidget.cpp
M +4 -9 src/lib/routing/RoutingWidget.cpp
http://commits.kde.org/marble/b5acbb903653fbffc33cc2a07236f5ca3743e651
diff --git a/src/lib/MarbleWidget.cpp b/src/lib/MarbleWidget.cpp
index 026d996..7b11a36 100644
--- a/src/lib/MarbleWidget.cpp
+++ b/src/lib/MarbleWidget.cpp
@@ -638,6 +638,10 @@ void MarbleWidget::centerOn( const GeoDataCoordinates &position, bool animated )
void MarbleWidget::centerOn( const GeoDataLatLonBox &box, bool animated )
{
+ if ( box.isEmpty() ) {
+ return;
+ }
+
int newRadius = radius();
ViewportParams* viewparams = viewport();
//prevent divide by zero
diff --git a/src/lib/routing/RoutingWidget.cpp b/src/lib/routing/RoutingWidget.cpp
index 795dade..33ee3de 100644
--- a/src/lib/routing/RoutingWidget.cpp
+++ b/src/lib/routing/RoutingWidget.cpp
@@ -603,11 +603,9 @@ void RoutingWidget::updateAlternativeRoutes()
if ( d->m_ui.routeComboBox->count() == 1) {
// Parts of the route may lie outside the route trip points
GeoDataLatLonBox const bbox = d->m_routingManager->routingModel()->route().bounds();
- if ( !bbox.isEmpty() ) {
- if ( d->m_zoomRouteAfterDownload ) {
- d->m_zoomRouteAfterDownload = false;
- d->m_widget->centerOn( bbox );
- }
+ if ( d->m_zoomRouteAfterDownload ) {
+ d->m_zoomRouteAfterDownload = false;
+ d->m_widget->centerOn( bbox );
}
}
@@ -728,10 +726,7 @@ void RoutingWidget::updateCloudSyncButtons()
void RoutingWidget::openCloudRoute(const QString &identifier)
{
d->m_routeSyncManager->openRoute( identifier );
- GeoDataLatLonBox const bbox = d->m_routingManager->routingModel()->route().bounds();
- if ( !bbox.isEmpty() ) {
- d->m_widget->centerOn( bbox );
- }
+ d->m_widget->centerOn( d->m_routingManager->routingModel()->route().bounds() );
}
bool RoutingWidget::eventFilter( QObject *o, QEvent *event )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic