[Marble-commits] KDE/kdeedu/marble/src/lib/routing
Dennis Nienhüser
earthwings at gentoo.org
Sun Sep 5 16:24:04 CEST 2010
SVN commit 1171867 by nienhueser:
Do not set the geocoordinates string as an intermediate via point description before reverse geocoding finishes. Avoids line edit input changing twice in a short amount of time.
CCMAIL: ewoerner at kde.org
M +1 -7 RoutingInputWidget.cpp
M +4 -7 RoutingWidget.cpp
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingInputWidget.cpp #1171866:1171867
@@ -105,7 +105,6 @@
GeoDataCoordinates pos = m_route->at( m_index );
if ( pos.longitude() != 0.0 && pos.latitude() != 0.0 ) {
- m_lineEdit->setText( pos.toString() );
m_pickButton->setVisible( false );
m_stateButton->setVisible( true );
}
@@ -176,10 +175,6 @@
void RoutingInputWidget::setTargetPosition( const GeoDataCoordinates &position )
{
- if ( !hasInput() || d->m_pickButton->isChecked() ) {
- d->m_lineEdit->setText( position.toString() );
- }
-
d->m_pickButton->setVisible( false );
d->m_route->setPosition( d->m_index, position );
d->m_progressTimer.stop();
@@ -278,10 +273,9 @@
d->m_pickButton->setIcon( QIcon( d->m_route->pixmap( d->m_index ) ) );
}
-void RoutingInputWidget::updatePosition( int index, const GeoDataCoordinates &position )
+void RoutingInputWidget::updatePosition( int index, const GeoDataCoordinates & )
{
if ( index == d->m_index ) {
- d->m_lineEdit->setText( position.toString() );
d->m_stateButton->setVisible( hasTargetPosition() );
d->m_stateButton->setIcon( d->m_route->pixmap( d->m_index ) );
d->m_pickButton->setVisible( !hasTargetPosition() );
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingWidget.cpp #1171866:1171867
@@ -121,17 +121,14 @@
QString text = QObject::tr( "Get Directions" );
QString tooltip = QObject::tr( "Retrieve routing instructions for the selected destinations." );
- bool search = m_inputWidgets.size() < 2;
- if ( m_inputWidgets.size() > 1 ) {
+ int validInputs = 0;
for ( int i = 0; i < m_inputWidgets.size(); ++i ) {
- if ( !m_inputWidgets[i]->hasInput() ||
- ( m_inputWidgets[i]->hasInput() && !m_inputWidgets[i]->hasTargetPosition() ) ) {
- search = true;
+ if ( m_inputWidgets[i]->hasTargetPosition() ) {
+ ++validInputs;
}
}
- }
- if ( search ) {
+ if ( validInputs < 2 ) {
text = QObject::tr( "Search" );
tooltip = QObject::tr( "Find places matching the search term" );
}
More information about the Marble-commits
mailing list